Skip to content

Commit

Permalink
autofs4 - fix dentry leak in autofs4_expire_direct()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ian Kent authored and Al Viro committed Mar 24, 2011
1 parent 3c31998 commit f9398c2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,16 @@ 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;
init_completion(&ino->expire_complete);
spin_unlock(&sbi->fs_lock);
return root;
}
out:
spin_unlock(&sbi->fs_lock);
dput(root);

Expand Down

0 comments on commit f9398c2

Please sign in to comment.