summaryrefslogtreecommitdiff
path: root/source4/ntvfs/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-05 01:14:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:29 -0500
commit80eef3ea6647a9f8600466b2b468d38bd2eb0664 (patch)
treea2fd3a82ae58ce98746001762954197a106376e0 /source4/ntvfs/common
parent96ffc6d945e9318f749796e63a76e6b52a289daa (diff)
downloadsamba-80eef3ea6647a9f8600466b2b468d38bd2eb0664.tar.gz
samba-80eef3ea6647a9f8600466b2b468d38bd2eb0664.tar.bz2
samba-80eef3ea6647a9f8600466b2b468d38bd2eb0664.zip
r3539: much nicer async open delay code.
The previous code didn't handle the case where the file got renamed or deleted while waiting for the sharing violation delay. To handle this we need to make the 2nd open a full open call, including the name resolve call etc. Luckily this simplifies the logic. I also expanded the RAW-MUX test to include the case where we do open/open/open/close/close, with the 3rd open async, and that open gets retried after both the first close and the 2nd close, with the first retry failing and the 2nd retry working. The tests the "async reply after a async reply" logic in pvfs_open(). (This used to be commit eded2ad9c91f5ba587ef4f7f5f5a6dceb4b51ff3)
Diffstat (limited to 'source4/ntvfs/common')
-rw-r--r--source4/ntvfs/common/opendb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/ntvfs/common/opendb.c b/source4/ntvfs/common/opendb.c
index 39d4f37ec2..bed4910be4 100644
--- a/source4/ntvfs/common/opendb.c
+++ b/source4/ntvfs/common/opendb.c
@@ -331,12 +331,14 @@ NTSTATUS odb_close_file(struct odb_lock *lck, uint16_t fnum)
elist = (struct odb_entry *)dbuf.dptr;
count = dbuf.dsize / sizeof(struct odb_entry);
- /* send any pending notifications */
+ /* send any pending notifications, removing them once sent */
for (i=0;i<count;i++) {
if (elist[i].pending) {
messaging_send_ptr(odb->messaging_ctx, elist[i].server,
MSG_PVFS_RETRY_OPEN, elist[i].notify_ptr);
-
+ memmove(&elist[i], &elist[i+1], sizeof(struct odb_entry)*(count-(i+1)));
+ i--;
+ count--;
}
}