From: David Howells <dhowells@warthog.cambridge.redhat.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org, dhowells@redhat.com
Subject: Re: [PATCH] VFS autmounter support
Date: Tue, 17 Jun 2003 19:07:37 +0100 [thread overview]
Message-ID: <16634.1055873257@warthog.warthog> (raw)
In-Reply-To: Message from "H. Peter Anvin" <hpa@zytor.com> of "17 Jun 2003 09:08:28 PDT." <bcneds$or6$1@cesium.transmeta.com>
> This seems a bit heavyweight; although some VFS support is needed for
> a complex filesystem, effectively doing it all in the kernel (#3)
> seems a bit... excessive.
One of the problems I have to deal with is namespaces. This means I can't just
have an automounter running in userspace that's passed requests to mount
things as it might not be able to access the target namespace.
Doing it this way means that I don't need to care which namespace the
automount needs to take effect in. I can just return a vfsmount to the VFS (as
acquired from do_kern_mount()) and let that paste it into the right place.
Furthermore, for AFS at least, it's a lot less excessive than, say, calling
back into userspace.
> At least #2 can be done with existing means using follow_link.
How? I want to be able to mount on the location in question (so it has to be a
directory), but I don't want "ls -l" to cause it to mount (otherwise
accidentally doing that or tab expansion if /afs, say, will take ages).
Maybe you mean construct a symlink that points to somewhere I can actually
mount the filesystem? If so, that too can suffer from namespace problems.
Whatever happens, stat() must _not_ cause the automount point to mount.
> I think using a revalidation pointer like dentries might be a better
> way to do #4/#5, although using the existing one in the dentries is
> probably better.
Do you mean dispose of the expired mount point when it's next revalidated? If
so, surely you _don't_ want to do it then, as that's normally a prelude to
reusing it.
Or do you mean do it actually inside dentry->d_op->d_revalidate()? But you
can't do it there because you don't know what vfsmount you are dealing with.
> #1 isn't really clear to me what you're going for, but it seems to be
> to duplicate bookkeeping.
Duplicate of what bookkeeping?
The fact that the operation is provided indicates that a dentry is an
automount point, and as such should be handled specially by path-walk. All the
logic to link the new vfsmount into the filesystem topology can be handled
easily by the VFS at that point because all the details are to hand.
> I also don't see how this solves the biggest problems with complex
> automounts, which are:
>
> a) how to guarantee that a large mount tree can be safely destroyed;
What do you mean by safely? I check that the usage count on vfsmount
structures is 1 under lock just before unlinking it - thereby making sure that
no one has a file open on it, no process has it as its root or cwd, and that
nothing is mounted upon it.
Also, I do the actual unmounting from process context by walking the
namespace's extant mount list, rather than directly nominating a vfsmount for
removal.
One drawback is that - taking AFS as an example - doing a umount of /afs won't
work until all the subtrees have either been manually unmounted or have
expired (though I can make umount capable of handling this).
> b) how to detect partial unmounts.
What do you mean by a partial unmount?
David
next prev parent reply other threads:[~2003-06-17 17:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-17 14:55 [PATCH] VFS autmounter support David Howells
2003-06-17 16:08 ` H. Peter Anvin
2003-06-17 18:07 ` David Howells [this message]
2003-06-17 18:19 ` H. Peter Anvin
2003-06-18 8:37 ` David Howells
2003-06-18 8:48 ` viro
2003-06-18 17:16 ` H. Peter Anvin
2003-06-19 7:20 ` David Howells
2003-06-19 7:30 ` H. Peter Anvin
2003-06-24 15:23 ` David Howells
2003-06-18 4:55 ` Linus Torvalds
2003-06-18 5:10 ` viro
2003-06-18 7:55 ` David Howells
2003-06-18 8:36 ` viro
2003-06-18 11:01 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16634.1055873257@warthog.warthog \
--to=dhowells@warthog.cambridge.redhat.com \
--cc=dhowells@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox