aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2011-03-25 01:51:14 +0800
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-24 14:54:34 -0400
commitf9398c233e3201874395eea8558eb616fb198648 (patch)
treeadf805206a5bba08a44878dba61256a9dca6120d /fs/autofs4
parent3c3199852905ceb90a70e98777e71d369a5f0823 (diff)
downloadkernel_samsung_crespo-f9398c233e3201874395eea8558eb616fb198648.zip
kernel_samsung_crespo-f9398c233e3201874395eea8558eb616fb198648.tar.gz
kernel_samsung_crespo-f9398c233e3201874395eea8558eb616fb198648.tar.bz2
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>
Diffstat (limited to 'fs/autofs4')
-rw-r--r--fs/autofs4/expire.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index c896dd6..c403abc 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -290,10 +290,8 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
spin_lock(&sbi->fs_lock);
ino = autofs4_dentry_ino(root);
/* No point expiring a pending mount */
- if (ino->flags & AUTOFS_INF_PENDING) {
- spin_unlock(&sbi->fs_lock);
- return NULL;
- }
+ if (ino->flags & AUTOFS_INF_PENDING)
+ goto out;
if (!autofs4_direct_busy(mnt, root, timeout, do_now)) {
struct autofs_info *ino = autofs4_dentry_ino(root);
ino->flags |= AUTOFS_INF_EXPIRING;
@@ -301,6 +299,7 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
spin_unlock(&sbi->fs_lock);
return root;
}
+out:
spin_unlock(&sbi->fs_lock);
dput(root);