autofs - remove autofs dentry mount check
authorDavid Jeffery <djeffery@redhat.com>
Mon, 6 May 2013 05:49:30 +0000 (13:49 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 30 May 2013 13:34:52 +0000 (14:34 +0100)
commit ce8a5dbdf9e709bdaf4618d7ef8cceb91e8adc69 upstream.

When checking if an autofs mount point is busy it isn't sufficient to
only check if it's a mount point.

For example, if the mount of an offset mountpoint in a tree is denied
for this host by its export and the dentry becomes a process working
directory the check incorrectly returns the mount as not in use at
expire.

This can happen since the default when mounting within a tree is
nostrict, which means ingnore mount fails on mounts within the tree and
continue.  The nostrict option is meant to allow mounting in this case.

Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/autofs4/expire.c

index 450f529..2c69d12 100644 (file)
@@ -61,15 +61,6 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
                /* This is an autofs submount, we can't expire it */
                if (autofs_type_indirect(sbi->type))
                        goto done;
-
-               /*
-                * Otherwise it's an offset mount and we need to check
-                * if we can umount its mount, if there is one.
-                */
-               if (!d_mountpoint(path.dentry)) {
-                       status = 0;
-                       goto done;
-               }
        }
 
        /* Update the expiry counter if fs is busy */