summaryrefslogtreecommitdiff
path: root/source/smbd/files.c
diff options
context:
space:
mode:
authorbubulle <bubulle@alioth.debian.org>2008-11-01 11:09:46 +0000
committerbubulle <bubulle@alioth.debian.org>2008-11-01 11:09:46 +0000
commita2b71a0141763c20552bb45eeb4cb78c4b513118 (patch)
tree85b64d98387145ea4e00c1b529e1820542a979a3 /source/smbd/files.c
parent2203bd59918d6d70515f9dad601cb5c0ef098092 (diff)
downloadsamba-a2b71a0141763c20552bb45eeb4cb78c4b513118.tar.gz
Revert the merge of 3.3.0~pre2 in upstream branch
git-svn-id: svn://svn.debian.org/svn/pkg-samba/branches/samba/upstream@2200 fc4039ab-9d04-0410-8cac-899223bdd6b0
Diffstat (limited to 'source/smbd/files.c')
-rw-r--r--source/smbd/files.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/smbd/files.c b/source/smbd/files.c
index 8d06e20f81..d6e91c67be 100644
--- a/source/smbd/files.c
+++ b/source/smbd/files.c
@@ -122,12 +122,10 @@ NTSTATUS file_new(connection_struct *conn, files_struct **result)
chain_fsp = fsp;
- /* 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);
+ /* A new fsp invalidates a negative fsp_fi_cache. */
+ if (fsp_fi_cache.fsp == NULL) {
+ ZERO_STRUCT(fsp_fi_cache);
+ }
*result = fsp;
return NT_STATUS_OK;
@@ -328,7 +326,8 @@ files_struct *file_find_di_first(struct file_id id)
fsp_fi_cache.id = id;
for (fsp=Files;fsp;fsp=fsp->next) {
- if (file_id_equal(&fsp->file_id, &id)) {
+ if ( fsp->fh->fd != -1 &&
+ file_id_equal(&fsp->file_id, &id)) {
/* Setup positive cache. */
fsp_fi_cache.fsp = fsp;
return fsp;
@@ -349,7 +348,8 @@ files_struct *file_find_di_next(files_struct *start_fsp)
files_struct *fsp;
for (fsp = start_fsp->next;fsp;fsp=fsp->next) {
- if (file_id_equal(&fsp->file_id, &start_fsp->file_id)) {
+ if ( fsp->fh->fd != -1 &&
+ file_id_equal(&fsp->file_id, &start_fsp->file_id)) {
return fsp;
}
}
@@ -539,6 +539,7 @@ NTSTATUS dup_file_fsp(files_struct *fsp,
dup_fsp->print_file = fsp->print_file;
dup_fsp->modified = fsp->modified;
dup_fsp->is_directory = fsp->is_directory;
+ dup_fsp->is_stat = fsp->is_stat;
dup_fsp->aio_write_behind = fsp->aio_write_behind;
string_set(&dup_fsp->fsp_name,fsp->fsp_name);