summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-09-26 18:39:03 -0700
committerJeremy Allison <jra@samba.org>2008-09-26 18:39:03 -0700
commit3b02b9e40ee5b1c4dbdf503fdeb0351832a1e9c9 (patch)
tree3abe31e4f6835968af709f9c8d95fa0550b633e6
parentfae2fce47e28ccfe5f43744200ce2ae68da3a9aa (diff)
downloadsamba-3b02b9e40ee5b1c4dbdf503fdeb0351832a1e9c9.tar.gz
samba-3b02b9e40ee5b1c4dbdf503fdeb0351832a1e9c9.tar.bz2
samba-3b02b9e40ee5b1c4dbdf503fdeb0351832a1e9c9.zip
Second part of the fix for bug #5790 - samba returns STATUS_OBJECT_NAME_NOT_FOUND on set file disposition call.
This was my fault. I use a singleton cache (positive and negative) to speed up pathname based qfileinfo/setfileinfo lookups for alternate fsp's open on the same path. I only invalidated the negative cache on adding a new file fsp, as I incorrectly imagined the new fsp was put at the *end* of the open files list. DLIST_ADD puts it at the start, meaning any subsequent open wasn't seen once the cache was set. Doh ! Jeremy.
-rw-r--r--source3/smbd/files.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 777f8e1e23..8d06e20f81 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -122,10 +122,12 @@ NTSTATUS file_new(connection_struct *conn, files_struct **result)
chain_fsp = fsp;
- /* A new fsp invalidates a negative fsp_fi_cache. */
- if (fsp_fi_cache.fsp == NULL) {
- ZERO_STRUCT(fsp_fi_cache);
- }
+ /* A new fsp invalidates the positive and
+ negative fsp_fi_cache as the new fsp is pushed
+ at the start of the list and we search from
+ a cache hit to the *end* of the list. */
+
+ ZERO_STRUCT(fsp_fi_cache);
*result = fsp;
return NT_STATUS_OK;