Bug 479287 - [RHEL-5.3] mount -a & bind with /proc/mounts linked to /etc/mtab creates doubled entries
[RHEL-5.3] mount -a & bind with /proc/mounts linked to /etc/mtab creates doub...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: util-linux (Show other bugs)
5.2
All Linux
low Severity medium
: rc
: ---
Assigned To: Karel Zak
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-08 12:07 EST by Flavio Leitner
Modified: 2010-10-23 02:51 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-13 05:54:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Flavio Leitner 2009-01-08 12:07:07 EST
Description of problem:

The 'mount' manpage suggests that /etc/mtab can be linked to /proc/mounts:
...
      It is possible to replace
      /etc/mtab by a symbolic link to /proc/mounts, and especially  when  you
      have  very large numbers of mounts things will be much faster with that
      symlink, but some information is lost that way, and in particular work-
      ing  with the loop device will be less convenient, and using the "user"
      option will fail.
...

The problem happens when you run 'mount -a' and /etc/fstab contains entries
using 'bind' option. The result is multiple mounts, see below:

# grep rhel4 /etc/fstab
/tmp  /rhel4/tmp    ext3    defaults,bind    1 1
                                     ^^^^

I did the symlink manually
# ls -la /etc/mtab
lrwxrwxrwx 1 root root 12 Jan  8 14:18 /etc/mtab -> /proc/mounts

# grep 'rhel4/tmp' /etc/mtab
#

# mount -a
# grep 'rhel4/tmp' /etc/mtab
/dev/root /rhel4/tmp ext3 rw,data=ordered 0 0
# mount -a
# grep 'rhel4/tmp' /etc/mtab
/dev/root /rhel4/tmp ext3 rw,data=ordered 0 0
/dev/root /rhel4/tmp ext3 rw,data=ordered 0 0
#

There is a upstream thread about this:
http://lkml.org/lkml/2007/6/20/350

and also an old bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=251030 
with analysis on comment#2 and a suggested patch.

Version-Release number of selected component (if applicable):
util-linux-2.13-0.50.el5
2.6.18-128.el5xen

How reproducible:
always.

Actual results:
Multiple mounts events

Expected results:
Just one mount event
Comment 1 Flavio Leitner 2009-01-08 12:10:29 EST
This bugzilla is interesting too:
https://bugzilla.redhat.com/show_bug.cgi?id=214891

Note You need to log in before you can comment on or make changes to this bug.