byte locking bug?

David Collier-Brown davecb at
Wed Jan 19 12:55:52 GMT 2000

You wrote:
| I'm having trouble with file locking in DOS over Samba.  The trouble
| Samba seems to be translating my lock request to a different range.  
| We attempt to put a lock on the byte 0x7ffffff0 from one of the
| however when we run a UNIX program that reveals where the lock was
put on
| the file it indicates that the lock was put at 0x3ffffff0. 

	Yes, the lock requests are indeed being mapped, to avoid
	the last two bits of a 32-bit quantity.  This avoids
	some disfeatures of a number of Unix OSs.

	It's probably better to lock a byte that's within the file
	than use a lock past the end for an IPC mechanism. There
	was a dicussion the the tchnical list a few days ago about
	reworking the locks, so I'd be cautious about depending on
	anything past the end of the file: the implementation is,
	as always, free to change.

David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | //
Work: (905) 415-2849 Home: (416) 223-8968 Email: davecb at

More information about the samba mailing list