Your message dated Sun, 13 May 2012 11:19:24 +0200
with message-id <[email protected]>
and subject line Re: smbfs: mount -o remount, brl or -o remount,, nobrl changes
the reported "mand" option, but has no effect
has caused the Debian Bug report #483502,
regarding smbfs: mount -o remount, brl or -o remount, nobrl changes the
reported "mand" option, but has no effect
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
483502: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=483502
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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@squeak ~]# grep /mnt /proc/mounts
[1 root@squeak ~]# mount -t cifs -o guest,uid=dkg,sec=none //bob/dmz /mnt
[0 root@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@squeak ~]# touch /mnt/foo
[0 root@squeak ~]# ~dkg/src/cmrg/test/testlocking/testlocking /mnt/foo
write lock failed
[1 root@squeak ~]# mount -o remount,nobrl,guest,uid=dkg,sec=none /mnt
[0 root@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@squeak ~]# ~dkg/src/cmrg/test/testlocking/testlocking /mnt/foo
write lock failed
[1 root@squeak ~]# umount /mnt
[0 root@squeak ~]# grep /mnt /proc/mounts
[1 root@squeak ~]# mount -t cifs -o nobrl,guest,uid=dkg,sec=none //bob/dmz /mnt
[0 root@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@squeak ~]# ~dkg/src/cmrg/test/testlocking/testlocking /mnt/foo
[0 root@squeak ~]# mount -o remount,brl,guest,uid=dkg,sec=none /mnt
[0 root@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@squeak ~]# ~dkg/src/cmrg/test/testlocking/testlocking /mnt/foo
[0 root@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-----
/* grep open(2) for O_LARGEFILE to explain this: */
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
/*
Author: Daniel Kahn Gillmor <[email protected]>
Date: 2008-05-28
This is a demonstration program for testing
http://bugs.debian.org/483216
*/
int main(int argc, char* argv[]) {
struct flock flock;
int fd;
flock.l_whence=SEEK_SET;
/* open file, get file descriptor */
fd = open(argv[1], O_RDWR|O_CREAT, 0644);
fcntl(fd, F_SETFD, FD_CLOEXEC | fcntl(fd, F_GETFD));
/* get read lock: */
flock.l_type=F_RDLCK;
flock.l_start=0;
flock.l_len = 1;
if (0 != fcntl(fd, F_SETLK64, &flock)) {
fprintf(stderr, "read lock failed\n");
return 1;
}
/* get write lock for same range: */
flock.l_type=F_WRLCK;
if (0 != fcntl(fd, F_SETLK64, &flock)) {
/* fails here when used on CIFS share mounted without nobrl option */
fprintf(stderr, "write lock failed\n");
return 1;
}
return 0;
}
--- End Message ---
--- Begin Message ---
Version: 2:5.3-1
Hi
This bug was fixed in the previous upstream version:
mount.cifs: Properly update mtab during remount
Cheers
Luk
--- End Message ---