Greetings.

My employer has has a policy of automounting user home dirs even when
said home dirs are on the local filesystem.  The automount procedure is
a two-step procedure: first the home fs is mounted, then the specific
user's home dir within that home fs is mounted (via --bind, or, as in
the old days, via a symlink).  For example:

$ cat /etc/auto.master
/A/homes /etc/auto.homes
/home /etc/auto.home
$ cat /etc/auto.homes
home1 -fstype=ext2,rw :/dev/hda11
home2 -fstype=ext2,rw :/dev/hda12
#
# etc, etc, etc.
#
$ cat /etc/auto.home
foo -rw :/A/homes/home1/&
bar -rw :/A/homes/home2/&
#
# etc, etc, etc.
#

This all works fine if the /home/ mounts are symlinks (eg, if mount
doesn't support --bind).  Now assume mount supports --bind (as it does
in our case) and user foo logs in (and /A/homes/home1 is currently not
in use anywhere).  Automount will proceed to:

1) mkdir -p /A/homes/home1
2) mount -t ext2 -s -o rw /dev/hda11 /A/homes/home1/
3) mount --bind /A/homes/home1/foo /home/foo

OK, fine.  But now, after some timeout, the mount for /A/homes/home1
will *expire*, even if /home/foo is still in use (eg, user foo is still
logged in).  Assume now that user bar goes to log in.  Automount will
attempt to do steps (1) and (2) again but (2) will fail before
/dev/hda11 is really still mounted.

Feb  6 15:06:05 vader automount[21447]: >> /dev/hda11 is mounted.
e2fsck: Cannot continue, aborting.

(I can provide full kernel logs pertaining to automount if desired.)

Hrmm.  Buggy mount?  Buggy autofs?  Buggy kernel?  Kernel version is
2.4.17 btw.  mount is version 2.11n.

So far the workaround has been to nuke the "mount --bind" check code in
mount_ext2.so so that bind_works is always set to zero.

Ideas?

Regards.
kw
--
They were not girls, they were WOMEN!
FEEL the difference!
                 -- anonymous Russian

Reply via email to