Re: [Samba] oplocks issue when trying to copy file

2011-10-24 Thread Philip Ong
I don't have a linux vendor. We compile kernel.org kernel on top of Centos 5.x. 
kernel.org is still under construction so I'm not able to submit a bug. Any 
other suggestions?

-Original Message-
From: Jeremy Allison [mailto:j...@samba.org] 
Sent: Monday, October 24, 2011 5:36 PM
To: Jeremy Allison
Cc: Philip Ong; 'samba@lists.samba.org'
Subject: Re: [Samba] oplocks issue when trying to copy file

On Mon, Oct 24, 2011 at 05:35:01PM -0700, Jeremy Allison wrote:
> On Wed, Oct 19, 2011 at 11:33:32PM -0700, Philip Ong wrote:
> > I've narrowed this problem down to a patch that is applied in 2.6.36.3. I 
> > replaced file.c from 2.6.36.2 into 2.6.36.3 and Samba works fine. The 
> > problem is I'm not sure if Samba needs to be fixed or the kernel needs to 
> > be. Anyone know what the right action is? One thing I noticed was the 
> > invalid argument being sent in the debugging log.
> > 
> > "  linux_set_kernel_oplock: Refused oplock on file home/foo/open/test.cfg, 
> > fd = 33, file_id = 17:aa41ab:0. (Invalid argument)"
> > 
> > Any advice would help.
> > 
> > Thanks,
> > Phil
> > 
> > 
> > The commit 129a84de2347002f09721cda3155ccfd19fade40 (locks: fix F_GETLK
> > regression (failure to find conflicts)) fixed the posix_test_lock()
> > function by itself, however, its usage in NFS changed by the commit
> > 9d6a8c5c213e34c475e72b245a8eb709258e968c (locks: give posix_test_lock
> > same interface as ->lock) remained broken - subsequent NFS-specific
> > locking code received F_UNLCK instead of the user-specified lock type.
> > To fix the problem, fl->fl_type needs to be saved before the
> > posix_test_lock() call and restored if no local conflicts were reported.
> 
> Looking closer at the problem...
> 
> We simply call fcntl(fd, F_SETLEASE, leasetype) on a fd to
> get a kernel oplock on it.
> 
> int leasetype can be F_WRLCK or F_UNLCK (from Samba). This
> matches the fcntl F_SETLEASE documentation completely. There
> has been no change whatsoever in Samba in this regard.
> 
> So I'm definitely calling kernel regression bug on this one.

FYI. Can you help me by logging a bug with your Linux
vendor on this one so we can get this fixed please ?

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] oplocks issue when trying to copy file

2011-10-21 Thread Philip Ong
I also tried 3.6.1 and it still has the issue

-Original Message-
From: Michael Wood [mailto:esiot...@gmail.com] 
Sent: Friday, October 21, 2011 12:09 AM
To: Philip Ong
Cc: samba@lists.samba.org; samba-techni...@lists.samba.org
Subject: Re: [Samba] oplocks issue when trying to copy file

Try the samba-technical list.

On 20 October 2011 08:33, Philip Ong  wrote:
> I've narrowed this problem down to a patch that is applied in 2.6.36.3. I 
> replaced file.c from 2.6.36.2 into 2.6.36.3 and Samba works fine. The problem 
> is I'm not sure if Samba needs to be fixed or the kernel needs to be. Anyone 
> know what the right action is? One thing I noticed was the invalid argument 
> being sent in the debugging log.
>
> "  linux_set_kernel_oplock: Refused oplock on file home/foo/open/test.cfg, fd 
> = 33, file_id = 17:aa41ab:0. (Invalid argument)"
>
> Any advice would help.
>
> Thanks,
> Phil
>
>
> The commit 129a84de2347002f09721cda3155ccfd19fade40 (locks: fix F_GETLK
> regression (failure to find conflicts)) fixed the posix_test_lock()
> function by itself, however, its usage in NFS changed by the commit
> 9d6a8c5c213e34c475e72b245a8eb709258e968c (locks: give posix_test_lock
> same interface as ->lock) remained broken - subsequent NFS-specific
> locking code received F_UNLCK instead of the user-specified lock type.
> To fix the problem, fl->fl_type needs to be saved before the
> posix_test_lock() call and restored if no local conflicts were reported.
>
> Reference: https://bugzilla.kernel.org/show_bug.cgi?id=23892
> Tested-by: Alexander Morozov 
> Signed-off-by: Sergey Vlasov 
> Signed-off-by: Trond Myklebust 
> Signed-off-by: Greg Kroah-Hartman 
> Signed-off-by: Andi Kleen 
>
> ---
> fs/nfs/file.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> Index: linux-2.6.35.y/fs/nfs/file.c
> ===
> --- linux-2.6.35.y.orig/fs/nfs/file.c
> +++ linux-2.6.35.y/fs/nfs/file.c
> @@ -696,6 +696,7 @@ static int do_getlk(struct file *filp, i
> {
> struct inode *inode = filp->f_mapping->host;
> int status = 0;
> +       unsigned int saved_type = fl->fl_type;
>
> /* Try local locking first */
> posix_test_lock(filp, fl);
> @@ -703,6 +704,7 @@ static int do_getlk(struct file *filp, i
> /* found a conflict */
> goto out;
> }
> +       fl->fl_type = saved_type;
>
> if (nfs_have_delegation(inode, FMODE_READ))
> goto out_noconflict;
> --
>
> -Original Message-
> From: Philip Ong
> Sent: Tuesday, September 27, 2011 10:41 PM
> To: samba@lists.samba.org
> Cc: Philip Ong
> Subject: oplocks issue when trying to copy file
>
> I'm not sure if this a Kernel/samba or NFS issue. We run this on Centos 5.6 
> using a kernel.org kernel.
>
> Please find below the problem description
>
> When trying to copy a file to a samba share which has NFS backend on 2.6.36.3 
> or newer Linux kernel following message is displayed on windows client
>
> "An unexpected error is keeping you from copying the file. If you continue to 
> receive this error, you can use the error code to search for help with this 
> problem.
> Error 0x80070021: The process cannot access the file because another process 
> has locked a portion of the file"
>
> I am able to delete a file within the same directory structure. I am also 
> able to create a file or folder by right-clicking within Windows Explorer on 
> XP. Below are the logs generated by samba in debug mode. The main line of 
> interest was:
>
>  linux_set_kernel_oplock: Refused oplock on file home/foo/open/test.cfg, fd = 
> 33, file_id = 17:aa41ab:0. (Invalid argument)
>
>
> Please note "test.cfg" was the file which we were trying to copy from windows
>
>  check_reduced_name [home/foo/open/test.cfg] [/]
> [2011/09/27 17:41:41.128330, 10] smbd/vfs.c:968(check_reduced_name)
>  check_reduced_name realpath [home/foo/open/test.cfg] -> 
> [/home/foo/open/test.cfg]
> [2011/09/27 17:41:41.128339,  3] smbd/vfs.c:1038(check_reduced_name)
>  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
> [2011/09/27 17:41:41.128348, 10] smbd/open.c:3414(create_file_default)
>  create_file: access_mask = 0x6019f file_attributes = 0x20, share_access = 
> 0x0, create_disposition = 0x2 create_options = 0x44 oplock_request
> = 0x3 root_dir_fid = 0x0, ea_list = 0x(nil), sd = 0x(nil), fname = 
> home/foo/open/test.cfg
> [2011/09/27 17:41:41.128359,  3] smbd/vfs.c:881(check_reduced_name)
>  check_reduced_name [home/foo/open/test.cfg] [/]
> [2011/09/27 17:41:41.128377, 10] smbd/vfs.c:968(check_reduced_name)
>  check_reduced_name realpath [home/foo/open/test.cfg] -> 
> [/home/f

Re: [Samba] oplocks issue when trying to copy file

2011-10-19 Thread Philip Ong
I've narrowed this problem down to a patch that is applied in 2.6.36.3. I 
replaced file.c from 2.6.36.2 into 2.6.36.3 and Samba works fine. The problem 
is I'm not sure if Samba needs to be fixed or the kernel needs to be. Anyone 
know what the right action is? One thing I noticed was the invalid argument 
being sent in the debugging log.

"  linux_set_kernel_oplock: Refused oplock on file home/foo/open/test.cfg, fd = 
33, file_id = 17:aa41ab:0. (Invalid argument)"

Any advice would help.

Thanks,
Phil


The commit 129a84de2347002f09721cda3155ccfd19fade40 (locks: fix F_GETLK
regression (failure to find conflicts)) fixed the posix_test_lock()
function by itself, however, its usage in NFS changed by the commit
9d6a8c5c213e34c475e72b245a8eb709258e968c (locks: give posix_test_lock
same interface as ->lock) remained broken - subsequent NFS-specific
locking code received F_UNLCK instead of the user-specified lock type.
To fix the problem, fl->fl_type needs to be saved before the
posix_test_lock() call and restored if no local conflicts were reported.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=23892
Tested-by: Alexander Morozov 
Signed-off-by: Sergey Vlasov 
Signed-off-by: Trond Myklebust 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Andi Kleen 

---
fs/nfs/file.c | 2 ++
1 file changed, 2 insertions(+)

Index: linux-2.6.35.y/fs/nfs/file.c
===
--- linux-2.6.35.y.orig/fs/nfs/file.c
+++ linux-2.6.35.y/fs/nfs/file.c
@@ -696,6 +696,7 @@ static int do_getlk(struct file *filp, i
{
struct inode *inode = filp->f_mapping->host;
int status = 0;
+   unsigned int saved_type = fl->fl_type;

/* Try local locking first */
posix_test_lock(filp, fl);
@@ -703,6 +704,7 @@ static int do_getlk(struct file *filp, i
/* found a conflict */
goto out;
}
+   fl->fl_type = saved_type;

if (nfs_have_delegation(inode, FMODE_READ))
goto out_noconflict;
--

-----Original Message-
From: Philip Ong 
Sent: Tuesday, September 27, 2011 10:41 PM
To: samba@lists.samba.org
Cc: Philip Ong
Subject: oplocks issue when trying to copy file 

I'm not sure if this a Kernel/samba or NFS issue. We run this on Centos 5.6 
using a kernel.org kernel.

Please find below the problem description

When trying to copy a file to a samba share which has NFS backend on 2.6.36.3 
or newer Linux kernel following message is displayed on windows client 

"An unexpected error is keeping you from copying the file. If you continue to 
receive this error, you can use the error code to search for help with this 
problem.
Error 0x80070021: The process cannot access the file because another process 
has locked a portion of the file"

I am able to delete a file within the same directory structure. I am also able 
to create a file or folder by right-clicking within Windows Explorer on XP. 
Below are the logs generated by samba in debug mode. The main line of interest 
was:

  linux_set_kernel_oplock: Refused oplock on file home/foo/open/test.cfg, fd = 
33, file_id = 17:aa41ab:0. (Invalid argument)


Please note "test.cfg" was the file which we were trying to copy from windows

  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128330, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128339,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128348, 10] smbd/open.c:3414(create_file_default)
  create_file: access_mask = 0x6019f file_attributes = 0x20, share_access = 
0x0, create_disposition = 0x2 create_options = 0x44 oplock_request
= 0x3 root_dir_fid = 0x0, ea_list = 0x(nil), sd = 0x(nil), fname = 
home/foo/open/test.cfg
[2011/09/27 17:41:41.128359,  3] smbd/vfs.c:881(check_reduced_name)
  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128377, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128386,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128394, 10] smbd/open.c:2941(create_file_unixpath)
  create_file_unixpath: access_mask = 0x6019f file_attributes = 0x20, 
share_access = 0x0, create_disposition = 0x2 create_options = 0x44 oplock
_request = 0x3 ea_list = 0x(nil), sd = 0x(nil), fname = home/foo/open/test.cfg
[2011/09/27 17:41:41.128406,  5] smbd/files.c:119(file_new)
  allocated file structure 14342, fnum = 18438 (4 used)
[2011/09/27 17:41:41.128416,  3] smbd/dosmode.c:166(unix_mode)
  unix_mode(home/foo/open/test.cfg) returning 0744
[2011/09/27 17:41:41.128424, 10] smbd/open.c:1556(open_file_ntcreate)
  open_file_ntcreate: fname=home/foo/open/test.cfg, dos_attrs=0x20 
access_mask=0x6019f share_ac

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-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 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


[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


Re: [Samba] oplocks issue when trying to copy file

2011-09-29 Thread Philip Ong
Kernel tried on Centos 4.5 was 2.6.38.8

-Original Message-
From: Philip Ong 
Sent: Wednesday, September 28, 2011 3:44 PM
To: Philip Ong; 'samba@lists.samba.org'
Subject: RE: oplocks issue when trying to copy file 

I also tried this on Centos 4.5 and it has the same results so it is probably 
not distro related.

-Original Message-----
From: Philip Ong 
Sent: Tuesday, September 27, 2011 10:41 PM
To: samba@lists.samba.org
Cc: Philip Ong
Subject: oplocks issue when trying to copy file 

I'm not sure if this a Kernel/samba or NFS issue. We run this on Centos 5.6 
using a kernel.org kernel.

Please find below the problem description

When trying to copy a file to a samba share which has NFS backend on 2.6.36.3 
or newer Linux kernel following message is displayed on windows client 

"An unexpected error is keeping you from copying the file. If you continue to 
receive this error, you can use the error code to search for help with this 
problem.
Error 0x80070021: The process cannot access the file because another process 
has locked a portion of the file"

I am able to delete a file within the same directory structure. I am also able 
to create a file or folder by right-clicking within Windows Explorer on XP. 
Below are the logs generated by samba in debug mode. The main line of interest 
was:

  linux_set_kernel_oplock: Refused oplock on file home/foo/open/test.cfg, fd = 
33, file_id = 17:aa41ab:0. (Invalid argument)


Please note "test.cfg" was the file which we were trying to copy from windows

  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128330, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128339,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128348, 10] smbd/open.c:3414(create_file_default)
  create_file: access_mask = 0x6019f file_attributes = 0x20, share_access = 
0x0, create_disposition = 0x2 create_options = 0x44 oplock_request
= 0x3 root_dir_fid = 0x0, ea_list = 0x(nil), sd = 0x(nil), fname = 
home/foo/open/test.cfg
[2011/09/27 17:41:41.128359,  3] smbd/vfs.c:881(check_reduced_name)
  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128377, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128386,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128394, 10] smbd/open.c:2941(create_file_unixpath)
  create_file_unixpath: access_mask = 0x6019f file_attributes = 0x20, 
share_access = 0x0, create_disposition = 0x2 create_options = 0x44 oplock
_request = 0x3 ea_list = 0x(nil), sd = 0x(nil), fname = home/foo/open/test.cfg
[2011/09/27 17:41:41.128406,  5] smbd/files.c:119(file_new)
  allocated file structure 14342, fnum = 18438 (4 used)
[2011/09/27 17:41:41.128416,  3] smbd/dosmode.c:166(unix_mode)
  unix_mode(home/foo/open/test.cfg) returning 0744
[2011/09/27 17:41:41.128424, 10] smbd/open.c:1556(open_file_ntcreate)
  open_file_ntcreate: fname=home/foo/open/test.cfg, dos_attrs=0x20 
access_mask=0x6019f share_access=0x0 create_disposition = 0x2 create_options
=0x44 unix mode=0744 oplock_request=3
[2011/09/27 17:41:41.128434,  3] smbd/vfs.c:881(check_reduced_name)
  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128462, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128471,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128480, 10] smbd/open.c:1738(open_file_ntcreate)
  open_file_ntcreate: fname=home/foo/open/test.cfg, after mapping 
access_mask=0x6019f
[2011/09/27 17:41:41.128489,  4] smbd/open.c:2000(open_file_ntcreate)
  calling open_file with flags=0x2 flags2=0xC0 mode=0744, access_mask = 
0x6019f, open_access_mask = 0x6019f
[2011/09/27 17:41:41.132844, 10] smbd/open.c:180(fd_open)
  fd_open: name home/foo/open/test.cfg, flags = 0302 mode = 0744, fd = 33.
[2011/09/27 17:41:41.132887, 10] smbd/notify_internal.c:890(notify_trigger)
  notify_trigger called action=0x1, filter=0x1, path=//home/foo/open/test.cfg
[2011/09/27 17:41:41.132897,  2] smbd/open.c:657(open_file)
  jneil opened file home/foo/open/test.cfg read=Yes write=Yes (numopen=4)
[2011/09/27 17:41:41.132909, 10] lib/dbwrap_tdb.c:100(db_tdb_fetch_locked)
  Locking key 1700AB41
[2011/09/27 17:41:41.132919, 10] lib/dbwrap_tdb.c:129(db_tdb_fetch_locked)
  Allocated locked data 0x0x782393a0
[2011/09/27 17:41:41.132938, 10] smbd/open.c:1057(delay_for_oplocks)
  delay_for_oplocks: oplock type 0x3 on file home/foo/open/test.cfg
[2011/09/27 17:41:41.13

Re: [Samba] oplocks issue when trying to copy file

2011-09-28 Thread Philip Ong
I also tried this on Centos 4.5 and it has the same results so it is probably 
not distro related.

-Original Message-
From: Philip Ong 
Sent: Tuesday, September 27, 2011 10:41 PM
To: samba@lists.samba.org
Cc: Philip Ong
Subject: oplocks issue when trying to copy file 

I'm not sure if this a Kernel/samba or NFS issue. We run this on Centos 5.6 
using a kernel.org kernel.

Please find below the problem description

When trying to copy a file to a samba share which has NFS backend on 2.6.36.3 
or newer Linux kernel following message is displayed on windows client 

"An unexpected error is keeping you from copying the file. If you continue to 
receive this error, you can use the error code to search for help with this 
problem.
Error 0x80070021: The process cannot access the file because another process 
has locked a portion of the file"

I am able to delete a file within the same directory structure. I am also able 
to create a file or folder by right-clicking within Windows Explorer on XP. 
Below are the logs generated by samba in debug mode. The main line of interest 
was:

  linux_set_kernel_oplock: Refused oplock on file home/foo/open/test.cfg, fd = 
33, file_id = 17:aa41ab:0. (Invalid argument)


Please note "test.cfg" was the file which we were trying to copy from windows

  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128330, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128339,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128348, 10] smbd/open.c:3414(create_file_default)
  create_file: access_mask = 0x6019f file_attributes = 0x20, share_access = 
0x0, create_disposition = 0x2 create_options = 0x44 oplock_request
= 0x3 root_dir_fid = 0x0, ea_list = 0x(nil), sd = 0x(nil), fname = 
home/foo/open/test.cfg
[2011/09/27 17:41:41.128359,  3] smbd/vfs.c:881(check_reduced_name)
  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128377, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128386,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128394, 10] smbd/open.c:2941(create_file_unixpath)
  create_file_unixpath: access_mask = 0x6019f file_attributes = 0x20, 
share_access = 0x0, create_disposition = 0x2 create_options = 0x44 oplock
_request = 0x3 ea_list = 0x(nil), sd = 0x(nil), fname = home/foo/open/test.cfg
[2011/09/27 17:41:41.128406,  5] smbd/files.c:119(file_new)
  allocated file structure 14342, fnum = 18438 (4 used)
[2011/09/27 17:41:41.128416,  3] smbd/dosmode.c:166(unix_mode)
  unix_mode(home/foo/open/test.cfg) returning 0744
[2011/09/27 17:41:41.128424, 10] smbd/open.c:1556(open_file_ntcreate)
  open_file_ntcreate: fname=home/foo/open/test.cfg, dos_attrs=0x20 
access_mask=0x6019f share_access=0x0 create_disposition = 0x2 create_options
=0x44 unix mode=0744 oplock_request=3
[2011/09/27 17:41:41.128434,  3] smbd/vfs.c:881(check_reduced_name)
  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128462, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128471,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128480, 10] smbd/open.c:1738(open_file_ntcreate)
  open_file_ntcreate: fname=home/foo/open/test.cfg, after mapping 
access_mask=0x6019f
[2011/09/27 17:41:41.128489,  4] smbd/open.c:2000(open_file_ntcreate)
  calling open_file with flags=0x2 flags2=0xC0 mode=0744, access_mask = 
0x6019f, open_access_mask = 0x6019f
[2011/09/27 17:41:41.132844, 10] smbd/open.c:180(fd_open)
  fd_open: name home/foo/open/test.cfg, flags = 0302 mode = 0744, fd = 33.
[2011/09/27 17:41:41.132887, 10] smbd/notify_internal.c:890(notify_trigger)
  notify_trigger called action=0x1, filter=0x1, path=//home/foo/open/test.cfg
[2011/09/27 17:41:41.132897,  2] smbd/open.c:657(open_file)
  jneil opened file home/foo/open/test.cfg read=Yes write=Yes (numopen=4)
[2011/09/27 17:41:41.132909, 10] lib/dbwrap_tdb.c:100(db_tdb_fetch_locked)
  Locking key 1700AB41
[2011/09/27 17:41:41.132919, 10] lib/dbwrap_tdb.c:129(db_tdb_fetch_locked)
  Allocated locked data 0x0x782393a0
[2011/09/27 17:41:41.132938, 10] smbd/open.c:1057(delay_for_oplocks)
  delay_for_oplocks: oplock type 0x3 on file home/foo/open/test.cfg
[2011/09/27 17:41:41.132947, 10] smbd/open.c:1057(delay_for_oplocks)
  delay_for_oplocks: oplock type 0x3 on file home/foo/open/test.cfg
[2011/09/27 17:41:41.267573,  3] 
smbd/oplock_linux.c:120(linux_set_kernel_oplock)
  linux_set_kernel_oplock: Refused opl

[Samba] oplocks issue when trying to copy file

2011-09-27 Thread Philip Ong
I'm not sure if this a Kernel/samba or NFS issue. We run this on Centos 5.6 
using a kernel.org kernel.

Please find below the problem description

When trying to copy a file to a samba share which has NFS backend on 2.6.36.3 
or newer Linux kernel following message is displayed on windows client 

"An unexpected error is keeping you from copying the file. If you continue to 
receive this error, you can use the error code to search for help with this 
problem.
Error 0x80070021: The process cannot access the file because another process 
has locked a portion of the file"

I am able to delete a file within the same directory structure. I am also able 
to create a file or folder by right-clicking within Windows Explorer on XP. 
Below are the logs generated by samba in debug mode. The main line of interest 
was:

  linux_set_kernel_oplock: Refused oplock on file home/foo/open/test.cfg, fd = 
33, file_id = 17:aa41ab:0. (Invalid argument)


Please note "test.cfg" was the file which we were trying to copy from windows

  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128330, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128339,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128348, 10] smbd/open.c:3414(create_file_default)
  create_file: access_mask = 0x6019f file_attributes = 0x20, share_access = 
0x0, create_disposition = 0x2 create_options = 0x44 oplock_request
= 0x3 root_dir_fid = 0x0, ea_list = 0x(nil), sd = 0x(nil), fname = 
home/foo/open/test.cfg
[2011/09/27 17:41:41.128359,  3] smbd/vfs.c:881(check_reduced_name)
  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128377, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128386,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128394, 10] smbd/open.c:2941(create_file_unixpath)
  create_file_unixpath: access_mask = 0x6019f file_attributes = 0x20, 
share_access = 0x0, create_disposition = 0x2 create_options = 0x44 oplock
_request = 0x3 ea_list = 0x(nil), sd = 0x(nil), fname = home/foo/open/test.cfg
[2011/09/27 17:41:41.128406,  5] smbd/files.c:119(file_new)
  allocated file structure 14342, fnum = 18438 (4 used)
[2011/09/27 17:41:41.128416,  3] smbd/dosmode.c:166(unix_mode)
  unix_mode(home/foo/open/test.cfg) returning 0744
[2011/09/27 17:41:41.128424, 10] smbd/open.c:1556(open_file_ntcreate)
  open_file_ntcreate: fname=home/foo/open/test.cfg, dos_attrs=0x20 
access_mask=0x6019f share_access=0x0 create_disposition = 0x2 create_options
=0x44 unix mode=0744 oplock_request=3
[2011/09/27 17:41:41.128434,  3] smbd/vfs.c:881(check_reduced_name)
  check_reduced_name [home/foo/open/test.cfg] [/]
[2011/09/27 17:41:41.128462, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [home/foo/open/test.cfg] -> 
[/home/foo/open/test.cfg]
[2011/09/27 17:41:41.128471,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: home/foo/open/test.cfg reduced to /home/foo/open/test.cfg
[2011/09/27 17:41:41.128480, 10] smbd/open.c:1738(open_file_ntcreate)
  open_file_ntcreate: fname=home/foo/open/test.cfg, after mapping 
access_mask=0x6019f
[2011/09/27 17:41:41.128489,  4] smbd/open.c:2000(open_file_ntcreate)
  calling open_file with flags=0x2 flags2=0xC0 mode=0744, access_mask = 
0x6019f, open_access_mask = 0x6019f
[2011/09/27 17:41:41.132844, 10] smbd/open.c:180(fd_open)
  fd_open: name home/foo/open/test.cfg, flags = 0302 mode = 0744, fd = 33.
[2011/09/27 17:41:41.132887, 10] smbd/notify_internal.c:890(notify_trigger)
  notify_trigger called action=0x1, filter=0x1, path=//home/foo/open/test.cfg
[2011/09/27 17:41:41.132897,  2] smbd/open.c:657(open_file)
  jneil opened file home/foo/open/test.cfg read=Yes write=Yes (numopen=4)
[2011/09/27 17:41:41.132909, 10] lib/dbwrap_tdb.c:100(db_tdb_fetch_locked)
  Locking key 1700AB41
[2011/09/27 17:41:41.132919, 10] lib/dbwrap_tdb.c:129(db_tdb_fetch_locked)
  Allocated locked data 0x0x782393a0
[2011/09/27 17:41:41.132938, 10] smbd/open.c:1057(delay_for_oplocks)
  delay_for_oplocks: oplock type 0x3 on file home/foo/open/test.cfg
[2011/09/27 17:41:41.132947, 10] smbd/open.c:1057(delay_for_oplocks)
  delay_for_oplocks: oplock type 0x3 on file home/foo/open/test.cfg
[2011/09/27 17:41:41.267573,  3] 
smbd/oplock_linux.c:120(linux_set_kernel_oplock)
  linux_set_kernel_oplock: Refused oplock on file home/foo/open/test.cfg, fd = 
33, file_id = 17:aa41ab:0. (Invalid argument)
[2011/09/27 17:41:41.267612, 10] smbd/dosmode.c:701(file_set_dosmode)
  file_set_dosmode: setting dos mode 0x20 on file home/foo/open/test.cfg
[2011/09/27 17:41:41.267631,  8] smbd/dosmode.c:613(dos_mode)
  dos_mode: home/foo/op