]> git.hungrycats.org Git - linux/commitdiff
Fix vfsmnt leak: make autofs4 mount point expiry release
authorLinus Torvalds <torvalds@home.osdl.org>
Tue, 5 Aug 2003 08:58:59 +0000 (01:58 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 5 Aug 2003 08:58:59 +0000 (01:58 -0700)
the entry that we got through the lookup_mnt().

Noted by Dick Streefland.

fs/autofs4/expire.c

index 07021a4d1ca038568fe6e25b43b29bbd90a172d9..4339a52a01f76269b5d7979ba19a37314ece932f 100644 (file)
@@ -70,8 +70,11 @@ static int check_vfsmnt(struct vfsmount *mnt, struct dentry *dentry)
        int ret = dentry->d_mounted;
        struct vfsmount *vfs = lookup_mnt(mnt, dentry);
 
-       if (vfs && is_vfsmnt_tree_busy(vfs))
-               ret--;
+       if (vfs) {
+               mntput(vfs);
+               if (is_vfsmnt_tree_busy(vfs))
+                       ret--;
+       }
        DPRINTK(("check_vfsmnt: ret=%d\n", ret));
        return ret;
 }