Re: [Samba] strict locking and kernel oplocks in the smb.conf

2011-10-03 Thread Jeremy Allison
On Mon, Oct 03, 2011 at 04:38:32PM -0700, Philip Ong wrote:
> Does disabling "strict locking" cause a problem if one user is writing to the 
> file from the local host and another user is writing to NFS via the samba 
> share at the same time?

That will mess up any coherence in the file, over NFS or
CIFS unless the applications are written to respect each
others locks.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] strict locking and kernel oplocks in the smb.conf

2011-10-03 Thread Philip Ong
Does disabling "strict locking" cause a problem if one user is writing to the 
file from the local host and another user is writing to NFS via the samba share 
at the same time?

-Original Message-
From: samba-boun...@lists.samba.org [mailto:samba-boun...@lists.samba.org] On 
Behalf Of Jeremy Allison
Sent: Saturday, October 01, 2011 6:57 PM
To: Volker Lendecke
Cc: 'samba@lists.samba.org'; Jeremy Allison
Subject: Re: [Samba] strict locking and kernel oplocks in the smb.conf

On Sat, Oct 01, 2011 at 08:29:03AM +0200, Volker Lendecke wrote:
> On Fri, Sep 30, 2011 at 04:44:17PM -0700, Jeremy Allison wrote:
> > On Fri, Sep 30, 2011 at 04:39:18PM -0700, Philip Ong wrote:
> > > 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?
> > 
> > When "strict locking = yes" we make fcntl() locking query calls
> > to make sure we're safe against existing POSIX locks.
> > 
> > The NFS locking code is probably just broken.
> 
> I think you're talking about "posix locking = yes/no".

Well yeah, but "strict locking" will map onto posix locks
underneath if "posix locking = yes", which it is by default.

So I still think it's the underlying POSIX locking on NFS
that's probably broken and causing this :-).

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
---
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.
---
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] strict locking and kernel oplocks in the smb.conf

2011-10-01 Thread Jeremy Allison
On Sat, Oct 01, 2011 at 08:29:03AM +0200, Volker Lendecke wrote:
> On Fri, Sep 30, 2011 at 04:44:17PM -0700, Jeremy Allison wrote:
> > On Fri, Sep 30, 2011 at 04:39:18PM -0700, Philip Ong wrote:
> > > 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?
> > 
> > When "strict locking = yes" we make fcntl() locking query calls
> > to make sure we're safe against existing POSIX locks.
> > 
> > The NFS locking code is probably just broken.
> 
> I think you're talking about "posix locking = yes/no".

Well yeah, but "strict locking" will map onto posix locks
underneath if "posix locking = yes", which it is by default.

So I still think it's the underlying POSIX locking on NFS
that's probably broken and causing this :-).

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] strict locking and kernel oplocks in the smb.conf

2011-10-01 Thread Volker Lendecke
On Fri, Sep 30, 2011 at 04:44:17PM -0700, Jeremy Allison wrote:
> On Fri, Sep 30, 2011 at 04:39:18PM -0700, Philip Ong wrote:
> > 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?
> 
> When "strict locking = yes" we make fcntl() locking query calls
> to make sure we're safe against existing POSIX locks.
> 
> The NFS locking code is probably just broken.

I think you're talking about "posix locking = yes/no".

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-37-0, fax: +49-551-37-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] strict locking and kernel oplocks in the smb.conf

2011-09-30 Thread Jeremy Allison
On Fri, Sep 30, 2011 at 04:39:18PM -0700, Philip Ong wrote:
> 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?

When "strict locking = yes" we make fcntl() locking query calls
to make sure we're safe against existing POSIX locks.

The NFS locking code is probably just broken.

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] strict locking and kernel oplocks in the smb.conf

2011-09-30 Thread Philip Ong
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 [j...@samba.org<mailto:j...@samba.org>]
Sent: Friday, September 30, 2011 03:09 PM Pacific Standard Time
To: Philip Ong
Cc: 'Jeremy Allison'; 'samba@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.
---
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] strict locking and kernel oplocks in the smb.conf

2011-09-30 Thread Jeremy Allison
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.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] strict locking and kernel oplocks in the smb.conf

2011-09-30 Thread Philip Ong


-Original Message-
From: Jeremy Allison [mailto:j...@samba.org] 
Sent: Friday, September 30, 2011 11:31 AM
To: Philip Ong
Cc: 'samba@lists.samba.org'
Subject: Re: [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.
[Philip Ong] What are the repercussions of having "strict locking = no" or 
scenarios where this might be a problem?

> 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 ?[Philip Ong]  A lock from kernel if 
on NFS.

> Any clarification between the two would be helpful.

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?

Thanks,
Phil
---
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.
---
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] strict locking and kernel oplocks in the smb.conf

2011-09-30 Thread Jeremy Allison
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.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


[Samba] strict locking and kernel oplocks in the smb.conf

2011-09-30 Thread Philip Ong
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.
---
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba