I am reporting a problem that was originally posted to the samba list by Philip Ong: http://lists.samba.org/archive/samba/2011-October/164564.html
Server with Samba 3.5.12, exporting a share that is mounted via NFS.
Samba config includes (default setting):
kernel oplocks = yes
Kernel commit (for SLES11 SP1 http://kernel.opensuse.org/cgit/kernel/commit/?h=SLE11-SP1&id=dd143426eaaadea159c8dd2d3c9ff5e9da94bcfd) seems to break the copying/saving of files to such a share, which was possible before this commit.
Steps to reproduce:
0) use kernel that include above mentioned commit
1) mount NFS share without "nolock" option
2) share NFS mount via Samba
3) copy or save a file on Samba share
Error Message when saving or copying a file to such a share:
- Windows client: "The process cannot access the file because another process has locked a portion of the file"
- In log.smbd: "smbd/oplock_linux.c:120(linux_set_kernel_oplock)
linux_set_kernel_oplock: Refused oplock on file <FILENAME>, fd = 32, file_id = 15:100811:0. (Invalid argument)"
Saving/copying files on share works without problems.
a) revert to a kernel without the mentioned patch
b) turn off kernel oplocks with: "kernel oplocks = yes"
c) mount NFS share with "nolock" option
Please find attached:
- debug level 10 log of working kernel without mentioned patch
- debug level 10 log of non-working kernel including the patch
- strace of smbd on non-working kernel (taken at different time instance with different user)
Created attachment 7204 [details]
Created attachment 7205 [details]
Log from SLES11SP1 kernel 184.108.40.206 - working
User brauchle succesfully saves "New Text Document.txt"
Created attachment 7206 [details]
Log from SLES11SP1 kernel 220.127.116.11 - not working
User brauchle tries to save "New Text Document.txt", which fails
Created attachment 7207 [details]
Strace on smbd on kernel 18.104.22.168 - not working
User "zzteststaff" tries to save "New Text Document.txt", which fails
NFS mount (no custom options):
mount -t nfs <SERVER>:<PATH> /mnt
For the possible solutions I have an obvious typo:
b) turn off kernel oplocks with: "kernel oplocks = no"
(In reply to comment #3)
> Created attachment 7206 [details]
> Log from SLES11SP1 kernel 22.214.171.124 - not working
> User brauchle tries to save "New Text Document.txt", which fails
An here this is kernel 126.96.36.199 of SLES11SP1...
Actually I just noticed that BOTH logs (working and non-working case) contain the line:
linux_set_kernel_oplock: Refused oplock on file ... (Invalid agrument)
But the non-working one somewhere later fails with "NT_STATUS_FILE_LOCK_CONFLICT"