[Pkg-samba-maint] Bug#483502: smbfs: mount -o remount, brl or -o remount, nobrl changes the reported "mand" option, but has no effect
Daniel Kahn Gillmor
dkg-debian.org at fifthhorseman.net
Thu May 29 04:04:29 UTC 2008
Package: smbfs
Version: 1:3.0.28a-3
Severity: normal
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
When remounting a CIFS mount to change the byte-range locking option,
the system reports success; but the system's behavior continues to
reflect the originally-mounted choice.
While researching http://bugs.debian.org/483216, i discovered that
byte-range locks against files CIFS shares mounted with mount.cifs are
normally interpreted as "mandatory" locks, instead of "advisory"
locks. This is adjustable with the nobrl/brl mount options. mount
claims to be able to successfully modify those options using -o
remount, but in practice, the changed options don't seem to have any
effect at all, and the option selected at initial mount time is the
persistent behavior.
In particular, locking a certain range of a file with a read lock and
then locking the same range with a write lock gives an error when a
CIFS share is mounted with "brl". This doesn't make much sense to me,
but i'm willing to accept it as intended for now.
I wrote a simple program (source attached) to test this locking
behavior. I also observed that "brl" is translated into the "mand"
option in the relevant line in /proc/mounts, and that "nobrl" maps to
the *absence* of the "mand" option in the /proc/mounts entry.
You can adjust the options reported in /proc/mounts using the standard
"mount -o remount,newoptions" syntax, but the mountpoint's behavior
does not change.
Here's a transcript demonstrating the problem. "bob" is running the
most recent version of samba available in debian etch. Note that the
behavior of the "testlocking" program is not changed by the -o remount
commands, even though /proc/mounts reflects the change:
[0 root at squeak ~]# grep /mnt /proc/mounts
[1 root at squeak ~]# mount -t cifs -o guest,uid=dkg,sec=none //bob/dmz /mnt
[0 root at squeak ~]# grep /mnt /proc/mounts
//bob/dmz /mnt cifs rw,mand,unc=\\bob\dmz,username=,uid=1000,posixpaths,rsize=16384,wsize=57344 0 0
[0 root at squeak ~]# touch /mnt/foo
[0 root at squeak ~]# ~dkg/src/cmrg/test/testlocking/testlocking /mnt/foo
write lock failed
[1 root at squeak ~]# mount -o remount,nobrl,guest,uid=dkg,sec=none /mnt
[0 root at squeak ~]# grep /mnt /proc/mounts
//bob/dmz /mnt cifs rw,unc=\\bob\dmz,username=,uid=1000,posixpaths,rsize=16384,wsize=57344 0 0
[0 root at squeak ~]# ~dkg/src/cmrg/test/testlocking/testlocking /mnt/foo
write lock failed
[1 root at squeak ~]# umount /mnt
[0 root at squeak ~]# grep /mnt /proc/mounts
[1 root at squeak ~]# mount -t cifs -o nobrl,guest,uid=dkg,sec=none //bob/dmz /mnt
[0 root at squeak ~]# grep /mnt /proc/mounts
//bob/dmz /mnt cifs rw,unc=\\bob\dmz,username=,uid=1000,posixpaths,rsize=16384,wsize=57344 0 0
[0 root at squeak ~]# ~dkg/src/cmrg/test/testlocking/testlocking /mnt/foo
[0 root at squeak ~]# mount -o remount,brl,guest,uid=dkg,sec=none /mnt
[0 root at squeak ~]# grep /mnt /proc/mounts
//bob/dmz /mnt cifs rw,mand,unc=\\bob\dmz,username=,uid=1000,posixpaths,rsize=16384,wsize=57344 0 0
[0 root at squeak ~]# ~dkg/src/cmrg/test/testlocking/testlocking /mnt/foo
[0 root at squeak ~]#
Thanks for maintaining samba packages in debian! Let me know if i can
help debug further.
--dkg
[0] http://cmrg.fifthhorseman.net/browser/trunk/test/testlocking/testlocking.c
- -- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing'), (200, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages smbfs depends on:
ii libc6 2.7-10 GNU C Library: Shared libraries
ii netbase 4.32 Basic TCP/IP networking system
ii samba-common 1:3.0.28a-3 Samba common files used by both th
smbfs recommends no packages.
- -- no debconf information
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iQIVAwUBSD4rTMzS7ZTSFznpAQIAlA/8D1AIGKTtIdR4wXYj6oj/VULGixDT1oLK
IZu3nNpx5E8yglplA4HqaodwUw6otc6orrUJxiZ5ZXB8rEx1XEZlMM+we2yVlbMC
hak4FJ2IGGee7XZjzdC5iTGLxO5O3vKlfGBUolK4uBdbZqbAV7M7GklkpEsEgVYE
KDNDBWwUHT4xvBaH9GhqMkPZsSHIZRo6jQ+hQ6eFUrNlEvN9mPwh5mEc1PsGe5gl
RjO+j5lUhZJX+ARzQOqrl6Z9rJN+DzQ7i2RMx9AnlM0AKICcAYQjNCDelfHAB6pe
u4od64XGOmyxJAYzQt5O1POpYQrsOBrZuH0h3IMYrG8mNmKHKGmgmNcPc23llUQq
+Sjw9FRPVrZap4KO1VBxDoZsMfxjLR6vGLNXtXVjWMXR9zFJJN4WsP/rWBZ1qM1i
HCvR0bWaF6WAYVTpTEQsrQxUM+/2cD5iLRY6cCrv2kZxVRgjgMWIBGM5/yqX/b5w
lkk7zBm5Quja5iMii9G0ZNbjijypwkP8IISa6/T/KVlbWzklDbiozGCT2damPlZN
s3NvfLAD9bRgCPdcq+kEbHs5LZmyMoBZEukNp80OzbL6DZTipEtHyOhdS+25grSr
e7IsAYi7D7fScnbFzURDDH9CKuWh75nHO5xSnxE2fUPl9lLqAccqREKi2yZZpw81
TPzLHm+REVw=
=5HK4
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testlocking.c
Type: text/x-c
Size: 1049 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-samba-maint/attachments/20080529/a00acb6f/attachment.bin
More information about the Pkg-samba-maint
mailing list