lkml.org 
[lkml]   [2013]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 0/9] [RFC v2] safely drop directory dentry on failed revalidate
From
Date
Ian,

I'm having problems fully understanding what autofs4 is trying to do
with have_submounts().


> On Wed, 2013-08-21 at 06:40 +0100, Al Viro wrote:

> fs/autofs4/dev-ioctl.c:542: err = have_submounts(path.dentry);

This is an ioctl() asking whether we have anything mounted on the autofs
mount. Using have_submounts() and then a separate follow_down() looks
racy. have_submounts() could succeed and then follow_down() could fail.
Or the other way round. Shouldn't the two cases be handled separately
here? If the autofs is a just a simple trigger then use follow_down().
If it's a multi-mount thing, then use have_submounts().

What is the userspace automount daemon using this for? Do we really
need the recursive check for submounts?


> fs/autofs4/root.c:381: if (have_submounts(dentry)) {

Here it explicitly says it's for v5 and for rootless mutli-mount. So
for example:

/mnt/auto/ root of an indirect mount
/mnt/auto/foo directory with DCACHE_NEED_AUTOMOUNT
/mnt/auto/foo/bar directory without DCACHE_NEED_AUTOMOUNT
/mnt/auto/foo/bar/baz directory with an automount trigger mounted on it

In this case when d_automount for "foo" is called we don't call the
userspace daemon because things are mounted under foo. If there was no
trigger under baz, then we would try to handle "foo" as an indirect
mount and call userspace.

But it's pretty confusing. Do we really *ever* need to call automount
on "foo" if it was part of a multi-mount thing?

> fs/autofs4/waitq.c:338: if (have_submounts(dentry))

And here we re-validate the thing after taking another autofs4 lock.
Why this double checking?

Thanks,
Miklos



\
 
 \ /
  Last update: 2013-08-29 06:01    [W:0.344 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site