X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fautofs4%2Fexpire.c;h=4b6fb3f628c04be94a2863ad5f7ee05feace9c44;hb=8b805ef617cf0e02f6d18b891f8deb6246421b01;hp=cde2f8e8935a680bd62243dcc4b92f6909ea7789;hpb=92b29b86fe2e183d44eb467e5e74a5f718ef2e43;p=linux-2.6-omap-h63xx.git diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c index cde2f8e8935..4b6fb3f628c 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c @@ -56,12 +56,23 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry) mntget(mnt); dget(dentry); - if (!autofs4_follow_mount(&mnt, &dentry)) + if (!follow_down(&mnt, &dentry)) goto done; - /* This is an autofs submount, we can't expire it */ - if (is_autofs4_dentry(dentry)) - goto done; + if (is_autofs4_dentry(dentry)) { + struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); + + /* This is an autofs submount, we can't expire it */ + if (sbi->type == AUTOFS_TYPE_INDIRECT) + 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(dentry)) + goto done; + } /* Update the expiry counter if fs is busy */ if (!may_umount_tree(mnt)) {