[cifs-protocol] SMB2 mixed lock & unlock requests in a single SMB_LOCK request
Steven Danneman
steven.danneman at isilon.com
Mon Nov 30 16:57:35 MST 2009
Hello,
I've come across another SMB2 locking issue that I can't find explicit
documentation for in MS-SMB2 (v18.0).
My first question, is whether a single SMB_LOCK request can contain both
unlock and lock requests as the LockingAndX command type in SMBv1 could?
The MS-SMB2 document hints that the answer to this question is "no" but
it doesn't seem to explicitly state it anywhere.
Section 2.2.26 states: "The SMB2 LOCK Request packet is sent by the
client to either lock or unlock portions of a file."
This statement is ambiguous as to whether the "or" is inclusive or
exclusive.
In my testing, sending both lock and unlock requests in a single SMB2
locking request returns a STATUS_INVALID_PARAMETER. However, if the
requests are ordered such that a unlock structure come first, the unlock
request seems to succeed.
The attached pcap, against W2K8R2 shows:
1) Packet 27-28: A single lock request succeeding on range 0-10.
2) Packet 29-30: A lock request with unlock(0-10) and lock(10-10)
failing with INVALID_PARAMETER.
3) Packet 31-32: A lock request with lock(0-10) and lock(10-10)
succeeding, showing that the previous request, though it returned an
error, succeeded in unlocking.
It seems to me the server behavior should be to return
STATUS_INVALID_PARAMETER without completing any of the lock/unlock
requests when they are mixed. Both the fact that this isn't allowed,
and the W2K8R2 behavior deviation should be documented.
Thanks,
Steven Danneman | Software Development Engineer
Isilon Systems P +1-206-315-7500 F +1-206-315-7501
www.isilon.com
How breakthroughs begin. (tm)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20091130/8e3961b2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 4773 bytes
Desc: image001.gif
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20091130/8e3961b2/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smb2-lock-multiple.pcap
Type: application/octet-stream
Size: 11184 bytes
Desc: smb2-lock-multiple.pcap
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20091130/8e3961b2/attachment-0001.obj>
More information about the cifs-protocol
mailing list