From: Al Viro <viro@ZenIV.linux.org.uk>
To: Ian Kent <raven@themaw.net>
Cc: Valerie Aurora <vaurora@redhat.com>,
linux-fsdevel@vger.kernel.org, Jan Blunck <jblunck@suse.de>,
autofs@linux.kernel.org
Subject: Re: [PATCH 1/7] autofs4: Save autofs trigger's vfsmount in super block info
Date: Thu, 14 Jan 2010 05:43:22 +0000 [thread overview]
Message-ID: <20100114054322.GA16106@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20100102004423.GA2131@zeus.themaw.net>
On Sat, Jan 02, 2010 at 08:44:25AM +0800, Ian Kent wrote:
> On Wed, Dec 23, 2009 at 03:36:57PM -0800, Valerie Aurora wrote:
> > From: Jan Blunck <jblunck@suse.de>
> >
> > This is a bugfix/replacement for commit
> > 051d381259eb57d6074d02a6ba6e90e744f1a29f:
> >
> > During a path walk if an autofs trigger is mounted on a dentry,
> > when the follow_link method is called, the nameidata struct
> > contains the vfsmount and mountpoint dentry of the parent mount
> > while the dentry that is passed in is the root of the autofs
> > trigger mount. I believe it is impossible to get the vfsmount of
> > the trigger mount, within the follow_link method, when only the
> > parent vfsmount and the root dentry of the trigger mount are
> > known.
> >
> > The solution in this commit was to replace the path embedded in the
> > parent's nameidata with the path of the link itself in
> > __do_follow_link(). This is a relatively harmless misuse of the
> > field, but union mounts ran into a bug during follow_link() caused by
> > the nameidata containing the wrong path (we count on it being what it
> > is all other places - the path of the parent).
> >
> > A cleaner and easier to understand solution is to save the necessary
> > vfsmount in the autofs superblock info when it is mounted. Then we
> > can easily update the vfsmount in autofs4_follow_link().
> >
> > Signed-off-by: Jan Blunck <jblunck@suse.de>
> > Signed-off-by: Valerie Aurora <vaurora@redhat.com>
> Acked-by: <raven@themaw.net>
>
> Don't know how I missed such an obvious solution when I did this.
> Thanks, Ian
TBH, I don't like either variant (both the in-tree one and that).
The reason why vfsmount does *NOT* belong in superblock, TYVM: you've
messed the lifetime rules. You can't pin it down, or the damn thing will
be impossible to kill. OTOH, you have no promise whatsoever that superblock
won't outlive the initial vfsmount. You might get another vfsmount over
the same thing and once the original one is gone...
So this is simply broken.
next prev parent reply other threads:[~2010-01-14 5:43 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-23 23:36 [PATCH 0/7] VFS prep for union mounts/writable overlays Valerie Aurora
2009-12-23 23:36 ` [PATCH 1/7] autofs4: Save autofs trigger's vfsmount in super block info Valerie Aurora
2009-12-23 23:36 ` [PATCH 2/7] VFS: Make lookup_hash() return a struct path Valerie Aurora
2009-12-23 23:36 ` [PATCH 3/7] VFS: Make real_lookup() " Valerie Aurora
2009-12-23 23:37 ` [PATCH 4/7] VFS: Propagate mnt_flags into do_loopback Valerie Aurora
2009-12-23 23:37 ` [PATCH 5/7] VFS: Add read-only users count to superblock Valerie Aurora
2009-12-23 23:37 ` [PATCH 6/7] VFS: BUG_ON() rehash of an already hashed dentry Valerie Aurora
2009-12-23 23:37 ` [PATCH 7/7] VFS: Remove unnecessary micro-optimization in cached_lookup() Valerie Aurora
2010-01-02 0:44 ` [PATCH 1/7] autofs4: Save autofs trigger's vfsmount in super block info Ian Kent
2010-01-14 5:43 ` Al Viro [this message]
2010-01-14 19:18 ` Valerie Aurora
2010-01-15 6:05 ` Ian Kent
2010-01-15 8:03 ` Al Viro
2010-01-15 17:36 ` Steve French
2010-01-18 5:08 ` Ian Kent
2010-01-15 14:55 ` David Howells
2010-01-15 16:58 ` Al Viro
2010-01-15 17:08 ` David Howells
2010-01-15 17:26 ` Al Viro
2010-01-16 10:17 ` Al Viro
2010-01-17 17:57 ` Al Viro
2010-01-18 4:21 ` Ian Kent
2010-01-18 5:59 ` Al Viro
2010-01-18 9:14 ` Ian Kent
2010-01-18 10:27 ` Al Viro
2010-01-18 19:35 ` Trond Myklebust
2010-01-19 7:05 ` Ian Kent
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=20100114054322.GA16106@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=autofs@linux.kernel.org \
--cc=jblunck@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=raven@themaw.net \
--cc=vaurora@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).