Byte range locking beyond 64 bits

Zack Kirsch zack.kirsch at
Wed Dec 10 23:59:18 GMT 2008

Hi Jeremy,
While trying to make sense of the Windows byte range locking semantics
which go beyond 64 bits, I remembered that MS passed around a "File
System Behavior" document at the MS Plugfest in June.  In that document
they explicitly say "ranges that extend past the 64 bit limit (that is,
adding offset + length overflows 64 bits) must not be used as Windows is
not prepared to deal with them and they lead to highly unexpected and
inconsistent behavior. This is also fixed in Windows 7, which will
ensure locks in those ranges will always fail, with
STATUS_INVALID_LOCK_RANGE".  This makes sense, because the semantics
beyond 64 bits are pretty silly; they conflict with "exact match"
semantics for the range start and length.
Given that they're admitting to this being a Windows bug and giving us
proper semantics, are you okay with me replacing the following check
from brl_overlap() to return STATUS_INVALID_LOCK_RANGE?
        /* this extra check is not redundent - it copes with locks
           that go beyond the end of 64 bit file space */
        if (lck1->size != 0 &&
            lck1->start == lck2->start &&
            lck1->size == lck2->size) {
                return True;
Zack Kirsch | Software Development Engineer
Isilon Systems    P +1-206-315-7500     F  +1-206-315-7501 <>     D +1-206-315-7487    M
Isilon Systems: How breakthroughs begin. (tm)

More information about the samba-technical mailing list