autofs4 - fix dentry leak in autofs4_expire_direct()
There is a missing dput() when returning from autofs4_expire_direct() when we see that the dentry is already a pending mount. Signed-off-by: Ian Kent <raven@themaw.net> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
3c31998529
commit
f9398c233e
@ -290,10 +290,8 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
|
|||||||
spin_lock(&sbi->fs_lock);
|
spin_lock(&sbi->fs_lock);
|
||||||
ino = autofs4_dentry_ino(root);
|
ino = autofs4_dentry_ino(root);
|
||||||
/* No point expiring a pending mount */
|
/* No point expiring a pending mount */
|
||||||
if (ino->flags & AUTOFS_INF_PENDING) {
|
if (ino->flags & AUTOFS_INF_PENDING)
|
||||||
spin_unlock(&sbi->fs_lock);
|
goto out;
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (!autofs4_direct_busy(mnt, root, timeout, do_now)) {
|
if (!autofs4_direct_busy(mnt, root, timeout, do_now)) {
|
||||||
struct autofs_info *ino = autofs4_dentry_ino(root);
|
struct autofs_info *ino = autofs4_dentry_ino(root);
|
||||||
ino->flags |= AUTOFS_INF_EXPIRING;
|
ino->flags |= AUTOFS_INF_EXPIRING;
|
||||||
@ -301,6 +299,7 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
|
|||||||
spin_unlock(&sbi->fs_lock);
|
spin_unlock(&sbi->fs_lock);
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
spin_unlock(&sbi->fs_lock);
|
spin_unlock(&sbi->fs_lock);
|
||||||
dput(root);
|
dput(root);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user