|
@@ -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)) {
|