[cifs-protocol] SMB2 mixed lock & unlock requests in a single SMB_LOCK request

Sebastian Canevari Sebastian.Canevari at microsoft.com
Mon Nov 30 21:28:16 MST 2009

Hi Steven,

Thank you for your email.

Someone from my team will be working with you and will be contacting you tomorrow.

Thanks and regards,

Sebastian Canevari
Senior Support Escalation Engineer, US-CSS DSC PROTOCOL TEAM
7100 N Hwy 161, Irving, TX - 75039
"Las Colinas - LC2"
Tel: +1 469 775 7849
e-mail: sebastc at microsoft.com<mailto:sebastc at microsoft.com>

From: Steven Danneman [mailto:steven.danneman at isilon.com]
Sent: Monday, November 30, 2009 5:58 PM
To: Interoperability Documentation Help; cifs-protocol at samba.org; pfif at tridgell.net
Subject: SMB2 mixed lock & unlock requests in a single SMB_LOCK request


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.


Steven Danneman | Software Development Engineer
Isilon Systems    P +1-206-315-7500     F  +1-206-315-7501

[cid:image001.gif at 01C81005.1792D9C0]   How breakthroughs begin. (tm)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20091201/8b40f5c2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 4773 bytes
Desc: image001.gif
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20091201/8b40f5c2/attachment.gif>

More information about the cifs-protocol mailing list