Philip Ong
2011-Sep-30 18:28 UTC
[Samba] strict locking and kernel oplocks in the smb.conf
1) Does "strict locking = no" negate "kernel oplocks = yes" ? 2) What's the difference between the two? 3) What a good way to test if a file got a lock seen from the linux side and the windows side? 4) If a file has a lock, does that mean you can still open the file in linux or in windows, but can't write to it? Any clarification between the two would be helpful. ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
Jeremy Allison
2011-Sep-30 18:30 UTC
[Samba] strict locking and kernel oplocks in the smb.conf
On Fri, Sep 30, 2011 at 11:28:43AM -0700, Philip Ong wrote:> 1) Does "strict locking = no" negate "kernel oplocks = yes" ?No.> 2) What's the difference between the two?One controls kernel oplocks, the other one controls whether smbd checks SMB/SMB2/CIFS read/write requests against existing mandatory locks.> 3) What a good way to test if a file got a lock seen from the linux side and the windows side?cat /proc/locks On windows, write a Win32 program.> 4) If a file has a lock, does that mean you can still open the file in linux or in windows, but can't write to it?A lock from who ? CIFS/NFS/local process ?> Any clarification between the two would be helpful.Hope this helps.
Philip Ong
2011-Sep-30 23:39 UTC
[Samba] strict locking and kernel oplocks in the smb.conf
No other process is accessing it. So any idea why it would work fine without "strict locking = no" in previous kernels below 2.6.36.3? -----Original Message----- From: Jeremy Allison [jra at samba.org<mailto:jra at samba.org>] Sent: Friday, September 30, 2011 03:09 PM Pacific Standard Time To: Philip Ong Cc: 'Jeremy Allison'; 'samba at lists.samba.org' Subject: Re: [Samba] strict locking and kernel oplocks in the smb.conf On Fri, Sep 30, 2011 at 11:48:52AM -0700, Philip Ong wrote:> > Hope this helps. > [Philip Ong] Thanks, yes, it does. I'm having a problem with being able to copy a local > Windows file to NFS area shared by samba on WinXP. If I set "strict locking = no", I'm > able to copy the file to the NFS area shared via samba. This seems to only happen when > upgrading from a kernel.org kernel of 2.6.36.3 and higher. I've tried on Centos 4.5 and > 5.6 and all seems to point to either kernel or samba mix (3.5.11 and 3.6). I'd like to > know the damage setting "strict locking = no" could possibly cause especially since I'm > not sure if I'd want to ignore mandatory locks. Is this going to be a big problem? What > are considered mandatory locks?Actually you probably do want to ignore mandatory locks :-). Is there another process accessing this file at the same time ? If there is, and that process has taken a POSIX/NFS lock out on the file, then "strict locking = yes" will conflict. More likely it's just an NFS bug in the locking code though :-). Jeremy. ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
Maybe Matching Threads
- Can't remember name of command to temporarily disable a share
- [SMB 3.0.10] File Locking Mechanism Windows <-> Unix
- smb locks
- oplocks, kernel oplocks, kernel share modes, .. - how it all works?
- oplocks, kernel oplocks, kernel share modes, .. - how it all works?