Author: metze Date: 2007-05-14 17:56:00 +0000 (Mon, 14 May 2007) New Revision: 22864
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22864 Log: 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 Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_lock.c Changeset: Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_lock.c =================================================================== --- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_lock.c 2007-05-14 17:51:19 UTC (rev 22863) +++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_lock.c 2007-05-14 17:56:00 UTC (rev 22864) @@ -69,8 +69,13 @@ 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 @@ 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,
