From: Timo Wendt Subject: Re: autofs 5 not recognizing manual umounts properly Date: Thu, 16 Nov 2006 13:48:25 +0100 Message-ID: <16B02FD4-DC07-4D2D-AC2F-9DAEFA10D462@online.de> References: <10272992.2537671162323983680.JavaMail.servlet@kundenserver> <1162720118.13896.25.camel@localhost> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: multipart/mixed; boundary="===============8564587283663096083==" Return-path: In-Reply-To: <1162720118.13896.25.camel@localhost> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autofs-bounces@linux.kernel.org Errors-To: autofs-bounces@linux.kernel.org To: Ian Kent Cc: autofs@linux.kernel.org --===============8564587283663096083== Content-Type: multipart/alternative; boundary=Apple-Mail-45-690511682 --Apple-Mail-45-690511682 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hi, that are really good news. Thanks for the effort. I will see if I can check these patches out. Timo Am 05.11.2006 um 10:48 schrieb Ian Kent: > On Tue, 2006-10-31 at 20:46 +0100, twendt@online.de wrote: >>> On Sat, 2006-10-28 at 18:41 +0200, Timo Wendt wrote: >>>> Hi, >>>> >>>> >>>> I have just installed FC6 to do some tests with autofs 5 as I >>>> need to >>>> use direct mounts. The new version works really great. The only >>>> thing >>>> I figured out so far that does not work fine is, when I umount >>>> one of >>>> the automounted fs manually. >>>> If I then try to list the contents of that directory it says, >>>> that it >>>> is empty. As soon as I try to create a file in that directory, it >>>> fails and seems to realize, that the directory should be mounted >>>> and >>>> remounts it, without creating the file though. >>> >>> And what kernel are you using? >>> And the version of autofs? >>> >>> Ian >>> >>> >> Hi, >> >> sorry for the delay I didn't get to check this yesterday. >> >> I have the following maps: >> >> /etc/auto.master: >> >> /- /etc/auto.direct >> >> /etc/auto.direct: >> >> /home/timo 192.168.178.187:/mnt >> >> The IP is actually the local IP, therefore I get bind mounts >> instead of NFS mounts. >> >> Here is what I am doing: >> >> [root@localhost autofs-5.0.1]# mount >> /dev/mapper/vg00-lvroot on / type ext3 (rw) >> proc on /proc type proc (rw) >> sysfs on /sys type sysfs (rw) >> devpts on /dev/pts type devpts (rw,gid=5,mode=620) >> /dev/hda5 on /boot type ext3 (rw) >> tmpfs on /dev/shm type tmpfs (rw) >> /dev/mapper/vg00-lvxen on /xen_domains type ext3 (rw) >> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) >> sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) >> nfsd on /proc/fs/nfsd type nfsd (rw) >> >> [root@localhost autofs-5.0.1]# ll /home/timo >> total 0 >> -rw-r--r-- 1 root root 0 Oct 27 20:09 a >> >> [root@localhost autofs-5.0.1]# umount /mnt >> >> [root@localhost autofs-5.0.1]# mount >> /dev/mapper/vg00-lvroot on / type ext3 (rw) >> proc on /proc type proc (rw) >> sysfs on /sys type sysfs (rw) >> devpts on /dev/pts type devpts (rw,gid=5,mode=620) >> /dev/hda5 on /boot type ext3 (rw) >> tmpfs on /dev/shm type tmpfs (rw) >> /dev/mapper/vg00-lvxen on /xen_domains type ext3 (rw) >> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) >> sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) >> nfsd on /proc/fs/nfsd type nfsd (rw) >> >> [root@localhost autofs-5.0.1]# ll /home/timo >> total 0 >> >> [root@localhost autofs-5.0.1]# ll /home/timo >> total 0 >> >> [root@localhost autofs-5.0.1]# touch /home/timo/b >> touch: cannot touch `/home/timo/b': Permission denied >> >> [root@localhost autofs-5.0.1]# mount >> /dev/mapper/vg00-lvroot on / type ext3 (rw) >> proc on /proc type proc (rw) >> sysfs on /sys type sysfs (rw) >> devpts on /dev/pts type devpts (rw,gid=5,mode=620) >> /dev/hda5 on /boot type ext3 (rw) >> tmpfs on /dev/shm type tmpfs (rw) >> /dev/mapper/vg00-lvxen on /xen_domains type ext3 (rw) >> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) >> sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) >> nfsd on /proc/fs/nfsd type nfsd (rw) >> /mnt on /home/timo type none (rw,bind) >> >> [root@localhost autofs-5.0.1]# ll /home/timo >> total 0 >> -rw-r--r-- 1 root root 0 Oct 27 20:09 a >> > > There are three kernel patches that resulted from testing that aren't > present in the FC6 kernel. They are working their way through the rc > process for 2.6.19 at the moment. I've attached them. > > I think that the autofs4-2.6.18-rc4-mm1-follow_link-false- > negative.patch > patch resolves this issue. This patch allows autofs4 to recognize a > direct mount trigger as a mount point even if it has remnant dentrys > (basically stale or never instantiated directories). I'm a little > surprised as I didn't think this was a case where remnant dentrys are > created and I can't see where it happens in the log. The other two > patches address quite different issues. > > Additionally, I noticed that the manual umount can lead to a file > handle > leak and the patch > autofs-5.0.1-rc2-check-fh-on-mount-trigger.patch should fix that. > > I haven't tested this last patch yet apart from that it compiles. > > I must reiterate that manually umounting mounts is not recommended > although it should be fine for simple indirect and direct mounts. > Multi-mounts are another matter altogether. If you know the autofs > internals of how they work, manually umounting such a tree (including > the internal autofs trigger mounts) in the correct order may work but > you could easily get yourself into the situation where entries won't > mount or expire, which would require a restart to fix. > > Ian > > > > > --Apple-Mail-45-690511682 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1

Hi,


that are really = good news. Thanks for the effort. I will see if I can check these = patches out.


Timo



Am = 05.11.2006 um 10:48 schrieb Ian Kent:

On Tue, 2006-10-31 at 20:46 +0100, twendt@online.de wrote:
=
On Sat, 2006-10-28 at 18:41 +0200, Timo Wendt = wrote:
Hi,


I have just = installed FC6 to do some tests with autofs 5 as I need to
use direct mounts. The new version works really = great. The only thing
I figured out so far that = does not work fine is, when I umount one of
the = automounted fs manually.
If I then try = to list the contents of that directory it says, that it
is empty. As soon as I try to create a file in that = directory, it
fails and seems to realize, that = the directory should be mounted and
remounts it, = without creating the file though.

And what = kernel are you using?
And the version of = autofs?

Ian


=
Hi,

sorry for the = delay I didn't get to check this yesterday.

I have the = following maps:

/etc/auto.master:

/- = /etc/auto.direct

/etc/auto.direct:

=A0 =A0 =A0 = 192.168.178.187:/mnt

The IP is actually the local IP, = therefore I get bind mounts instead of NFS mounts.

Here is = what I am doing:

[root@localhost autofs-5.0.1]# mount
/dev/mapper/vg00-lvroot on / type ext3 = (rw)
proc on /proc type proc = (rw)
sysfs on /sys type sysfs = (rw)
devpts on /dev/pts type devpts = (rw,gid=3D5,mode=3D620)
/dev/hda5 on = /boot type ext3 (rw)
tmpfs on /dev/shm type = tmpfs (rw)
/dev/mapper/vg00-lvxen on = /xen_domains type ext3 (rw)
none on = /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs = (rw)
nfsd on /proc/fs/nfsd type nfsd = (rw)

[root@localhost autofs-5.0.1]# ll = /home/timo
total 0
-rw-r--r-- 1 root root 0 Oct 27 20:09 a


proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts = (rw,gid=3D5,mode=3D620)
/dev/hda5 on = /boot type ext3 (rw)
tmpfs on /dev/shm type = tmpfs (rw)
/dev/mapper/vg00-lvxen on = /xen_domains type ext3 (rw)
none on = /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs = (rw)
nfsd on /proc/fs/nfsd type nfsd = (rw)

[root@localhost autofs-5.0.1]# ll = /home/timo
total 0

total 0

[root@localhost autofs-5.0.1]# = touch /home/timo/b
touch: cannot touch = `/home/timo/b': Permission denied

[root@localhost autofs-5.0.1]# = mount
/dev/mapper/vg00-lvroot on / = type ext3 (rw)
proc on /proc type proc = (rw)
sysfs on /sys type sysfs = (rw)
devpts on /dev/pts type devpts = (rw,gid=3D5,mode=3D620)
/dev/hda5 on = /boot type ext3 (rw)
tmpfs on /dev/shm type = tmpfs (rw)
/dev/mapper/vg00-lvxen on = /xen_domains type ext3 (rw)
none on = /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs = (rw)
nfsd on /proc/fs/nfsd type nfsd = (rw)
/mnt on /home/timo type none = (rw,bind)

[root@localhost autofs-5.0.1]# ll = /home/timo
total 0
-rw-r--r-- 1 root root 0 Oct 27 20:09 a


There = are three kernel patches that resulted from testing that = aren't
present in the FC6 kernel. They = are working their way through the rc
process for = 2.6.19 at the moment. I've attached them.

I think that = the autofs4-2.6.18-rc4-mm1-follow_link-false-negative.patch
patch resolves this issue. This patch allows autofs4 = to recognize a
direct mount trigger as a mount = point even if it has remnant dentrys
(basically = stale or never instantiated directories). I'm a little
surprised as I didn't think this was a case where = remnant dentrys are
created and I can't see = where it happens in the log. The other two
patches = address quite different issues.

Additionally, I noticed that the = manual umount can lead to a file handle
leak and = the patch=A0
autofs-5.0.1-rc2-check-fh-on-mount-trigger.patch = should fix that.

I haven't tested this last patch yet apart from that = it compiles.

I must reiterate that manually umounting mounts is = not recommended
although it should be fine for = simple indirect and direct mounts.
Multi-mounts = are another matter altogether. If you know the autofs
internals of how they work, manually umounting such = a tree (including
the internal autofs trigger = mounts) in the correct order may work but
you = could easily get yourself into the situation where entries = won't
mount or expire, which would = require a restart to fix.

Ian