diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-05-14 17:56:00 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:52:25 -0500 |
commit | 5eb7420f119df890e2e4b7acd904dc2da70793a6 (patch) | |
tree | 6ff37658214b5454182d3ebb547ebacf3f7adf1e | |
parent | 0543c06d2598ccd476bcb78e7701e50e6a85e51f (diff) | |
download | samba-5eb7420f119df890e2e4b7acd904dc2da70793a6.tar.gz samba-5eb7420f119df890e2e4b7acd904dc2da70793a6.tar.bz2 samba-5eb7420f119df890e2e4b7acd904dc2da70793a6.zip |
r22864: in SMB2 mode we need to cancel an existing lock with a conflicting lock
if they're on the same handle and the same range
metze
(This used to be commit 36384bb4a071dcc366ae1039bd0579f08b84e238)
-rw-r--r-- | source4/ntvfs/posix/pvfs_lock.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_lock.c b/source4/ntvfs/posix/pvfs_lock.c index 4527cd3ed2..9b5823e69e 100644 --- a/source4/ntvfs/posix/pvfs_lock.c +++ b/source4/ntvfs/posix/pvfs_lock.c @@ -69,8 +69,13 @@ static void pvfs_lock_async_failed(struct pvfs_state *pvfs, int i, NTSTATUS status) { + /* in SMB2 mode we also try to unlock failing lock */ + if (req->ctx->protocol != PROTOCOL_SMB2) { + i--; + } + /* undo the locks we just did */ - for (i=i-1;i>=0;i--) { + for (;i>=0;i--) { brl_unlock(pvfs->brl_context, f->brl_handle, locks[i].pid, @@ -377,8 +382,12 @@ NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs, DLIST_ADD(f->pending_list, pending); return NT_STATUS_OK; } + /* in SMB2 mode we also try to unlock failing lock */ + if (req->ctx->protocol != PROTOCOL_SMB2) { + i--; + } /* undo the locks we just did */ - for (i=i-1;i>=0;i--) { + for (;i>=0;i--) { brl_unlock(pvfs->brl_context, f->brl_handle, locks[i].pid, |