From be8e7cdf6e2191db53814b910cf62e74b264153f Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Thu, 6 Nov 2008 12:53:22 -0800 Subject: [PATCH] --- yaml --- r: 118427 b: refs/heads/master c: bc9c4068388eea01d3b5da31016879f2341ecec5 h: refs/heads/master i: 118425: 40f88a2beca6f5e63abd2e799b47c20b666e120b 118423: 1e61878b44e9020bbf0ba9712e3711f41eff1ea9 v: v3 --- [refs] | 2 +- trunk/fs/autofs4/expire.c | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index a2d23f5247e6..c95ddb7bed4e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eefc488f96cdde6e152b45675b50bf380b95d99f +refs/heads/master: bc9c4068388eea01d3b5da31016879f2341ecec5 diff --git a/trunk/fs/autofs4/expire.c b/trunk/fs/autofs4/expire.c index cde2f8e8935a..4b6fb3f628c0 100644 --- a/trunk/fs/autofs4/expire.c +++ b/trunk/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)) {