[Samba] Locking for Linux/WinXP clients (-or- CIFS issues)
Jeremy Allison
jra at samba.org
Tue Nov 1 01:29:57 GMT 2005
On Mon, Oct 31, 2005 at 09:41:04AM +0000, Phill Gillespie wrote:
> Hi...
>
> I've been running samba 3.0 for quite some time now (Debian's stable
> version, currently 3.0.14) and I've had no problems. That's probably
> been because all my clients were Windows XP boxes. I've now moved
> several users to Linux (Ubuntu Breezy) as their desktop and I've noticed
> there seems to be a problem in accessing files across the platforms.
>
> If a Linux box opens a file and then another Linux box tries to open the
> same file it gets a read-only copy. The same thing happens if an XP box
> opens the file and then another XP box tries to open it. If a Linux box
> opens a file and then an XP box tries to open it nothing at all happens
> and if the XP box has the file open and a Linux box tries to open it I
> get a "general input/output error while accessing X" message from
> OpenOffice.org.
>
> I though it might be something to do with the oplocks so I tested all
> possible combinations and the results stayed exactly as above. The only
> thing that changed was the line from smbstatus:
>
> No oplocks, XP opening file:
> 9868 DENY_WRITE 0x2019f RDWR NONE
>
> No oplocks, Linux opening file:
> 9871 DENY_NONE 0x12019f RDWR NONE
>
> Level 1 only, XP opening file:
> 9966 DENY_WRITE 0x2019f RDWR EXCLUSIVE+BATCH
>
> Level 1 only, Linux opening file:
> 9968 DENY_NONE 0x12019f RDWR EXCLUSIVE
>
> Level 1 and 2 oplocks, XP opening file:
> 10028 DENY_WRITE 0x2019f RDWR LEVEL_II
>
> Level 1 and 2 oplocks, Linux opening file:
> 10026 DENY_NONE 0x12019f RDWR EXCLUSIVE (changes to NONE
> when a second linux box opens the file and gets Read-Only)
>
>
> These problems only seemed to start when I added the Linux boxes to my
> network as they use CIFS rather than SMBFS (the fstab line is simply
> \\Greyskull\Intranet /home/phill/Snipef/Intranet cifs
> username=phill,passwd=phill 0 0)
> Can somebody please help me change this so I can open a file on one
> platform and then be able to open it read-only on the other one.
We need to know how OpenOffice on Linux does the exclusion of "another
user has this file open" and how this interacts with a Windows user.
Windows apps usually use "share modes" to provide exclusive access,
POSIX doesn't have this so it uses byte range locks to do the same thing.
Until we know how OO on Linux does this it's hard to speculate
as to exactly what is wrong. This is important enough to Novell
(who pay my wages :-) that I'll look into this - it's something
we just solved for simultaneous access from NetWare and CIFS from
Windows clients.
Jeremy.
More information about the samba
mailing list