Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 2017 17:02:03 +0100
From:      Edward Napierala <trasz@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, Kirk McKusick <mckusick@mckusick.com>,  freebsd-fs <freebsd-fs@freebsd.org>,  "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: mount / unmount and mountcheckdirs()
Message-ID:  <CAFLM3-rEo1wwYpgV5rmm8wXuCPKXM8it3sp5om%2BVna53_%2BjF0g@mail.gmail.com>
In-Reply-To: <f84704ce-3596-86d0-3c41-6256a7aae8d1@FreeBSD.org>
References:  <134c7c6e-f4f1-ef38-cc50-0e56c27c9fb8@FreeBSD.org> <201709150314.v8F3Ea6B085072@chez.mckusick.com> <20170915092001.GK78693@kib.kiev.ua> <CAFLM3-rqg9Pso636Y3Vm6JT0WxWossEfvnsMmmAbC-jEkvyS7Q@mail.gmail.com> <f84704ce-3596-86d0-3c41-6256a7aae8d1@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2017-09-15 12:56 GMT+01:00 Andriy Gapon <avg@freebsd.org>:

> On 15/09/2017 13:08, Edward Napierala wrote:
> > It does.  For example:
> >
> > [trasz@v2:~]% cd /media/md0
> > [trasz@v2:/media/md0]% mount
> > /dev/ada0s1a on / (ufs, local, noatime, journaled soft-updates)
> > devfs on /dev (devfs, local, multilabel)
> > map -hosts on /net (autofs)
> > map -media on /media (autofs)
>
> Interesting, I thought that /dev/md0 would get mounted as soon as
> /media/md0 is
> looked up.  But maybe that would be sub-optimal for some common
> scenarios...
> FWIW, ZFS snapshots get auto-mounted under .zfs as soon as there is a
> lookup.


You really don't want it to work that way.  If you have a directory with
thousands
of mountpoints inside, you don't want to mount all of them every time you
do "ls"
in that directory.  Same problem with mounting on "cd".  That's why autofs
triggers
in three cases: in VOP_READDIR(9), VOP_GETATTR(9), and VOP_LOOKUP(9)
with the vnode as a parent dir.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFLM3-rEo1wwYpgV5rmm8wXuCPKXM8it3sp5om%2BVna53_%2BjF0g>