Bug 479287 - [RHEL-5.3] mount -a & bind with /proc/mounts linked to /etc/mtab creates doubled entries
Summary: [RHEL-5.3] mount -a & bind with /proc/mounts linked to /etc/mtab creates doub...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: util-linux
Version: 5.2
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-08 17:07 UTC by Flavio Leitner
Modified: 2018-10-20 02:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-13 10:54:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Flavio Leitner 2009-01-08 17:07:07 UTC
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 17:10:29 UTC
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.