[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#585944: /proc/mounts ambiguity in output for same disk mounted more than once



Package: linux-2.6
Version: 2.6.32-15
Severity: minor

For the same disk mounted more than once, it is impossible to tell the
actual options in effect.

$ cat script
{ cat /proc/mounts;mount;}|perl -nwle '
next unless /sdb/;
print STDERR;
tr/()//d;
next unless /\S+exec\S+/;
$_=$&;tr/,/\n/;print;'|sort|uniq -c|sort -n

$ sh script
/dev/sdb1 /media/usb0 vfat rw,sync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1000,fmask=0133,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0
/dev/sdb1 /mnt/usb/cf vfat rw,sync,nosuid,nodev,noexec,noatime,uid=1000,gid=1000,fmask=0133,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0
/dev/sdb1 on /media/usb0 type vfat (rw,noexec,nosuid,nodev,sync,noatime,nodiratime,shortname=mixed,fmask=133,uid=1000,gid=1000,iocharset=ascii)
/dev/sdb1 on /mnt/usb/cf type vfat (rw,noexec,nosuid,nodev,noatime,iocharset=ascii,shortname=mixed,fmask=133,uid=1000,gid=1000)
      2 codepage=cp437
      2 dmask=0022
      2 errors=remount-ro
      2 fmask=0133
      2 fmask=133
      2 nodiratime
      3 sync
      4 gid=1000
      4 iocharset=ascii
      4 noatime
      4 nodev
      4 noexec
      4 nosuid
      4 rw
      4 shortname=mixed
      4 uid=1000

One sees that some conflicting options are blocked,
# mount -o ro /dev/sdb1 /mnt/usb/extra/
mount: /dev/sdb1 already mounted or /mnt/usb/extra/ busy
mount: according to mtab, /dev/sdb1 is mounted on /media/usb0
# mount -o rw /dev/sdb1 /mnt/usb/extra/
# umount /mnt/usb/extra/

but some get through,
# mount -o async /dev/sdb1 /mnt/usb/extra/
# umount /mnt/usb/extra/
# mount -o sync /dev/sdb1 /mnt/usb/extra/
#

and end up in /proc/mounts as double ambiguous entries.

And thus here e.g., one cannot tell if sync is in effect, or the
default async is really the one in effect.

Or it may seem to the user that different options apply according to
with path a user uses when writing!



Reply to: