The Samba-Bugzilla – Bug 5994
mount.cifs: brl option does not produce documented semantics for fcntl(F_SETLK)
Last modified: 2011-01-28 04:31:06 UTC
The above URL gives the entire bug report from our user. I'm just passing it through as, frankly, this goes much further than my own expertise
Getting more details or rationale probably needs to get in touch with the original bug submitter...
Christian Perrier, on behalf of samba package maintainers in Debian
I'm the original reporter. it's been a while since i reported this, but i'm happy to dig back into my notes if i can help move the problem toward a resolution.
I am using the test program, the only modification I did was to add a printf in
the else of both if (0 != fcntl()) statements.
I do not see errors, the F_SETLK command with F_WRLCK type succeeds.
Using cifs vfs version 1.57 and samba server version 3.2.5.
cifstest6:~ # grep mnt /proc/mounts
//cifstest8/smb8 /mnt/smb_a cifs rw,mand,unc=\\cifstest8\smb8,
username=root,addr=184.108.40.2066,posixpaths,acl,rsize=16384,wsize=57344 0 0
cifstest6:~ # echo -n a > /mnt/smb_a/foo
cifstest6:~ # chmod g+s,g-x /mnt/smb_a/foo
cifstest6:~ # ls -la /mnt/smb_a/foo
-rwxr--r-- 1 nobody nobody 1 Mar 5 13:35 /mnt/smb_a/foo
cifstest6:~ # /tmp/fcntltest /mnt/smb_a/foo
fcntl fd F_RDLCK SETLK64 succeeded
fcntl fd F_WRLCK SETLK64 succeeded
Shirish mentioned this bug is not reproducible on 3.2.5
How about this situation:
I have an sqlite3 file that is hosted on a Windows XP machine. The share is mounted via mount.cifs on my Fedora 14 client machine. Whenever I try to use the sqlite3 file, I get locking errors. Some searches on the web referred to the nobrl option and eventually lead to this bug report. Using nobrl indeed does remove the locking errors, but is not really a good solution.
I googled for "sqlite3 cifs" and it returned several threads along the same lines. The problem also appears when a Vista server is used (according to these threads). And some seem to suggest that the problem doesn't happen when working between Windows machines (ie using a Windows pc for both the server side and the client side).
It's not clear to me if my issue is what this bug is about, but I got here via lauchpad bug 117730, which linked to the debian bug in the url above which got me here.
It seems this bug has been closed because it was not reproducible with a Samba server. I am however using a Windows XP machine as a server, and only use the mount.cifs client application. Is that supposed to work without problems ? I sure doesn't for me. If it should, then IMO this bug should be reopened.