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>

authored by Ian Kent and committed by Al Viro f9398c23 3c319985

+3 -4
+3 -4
fs/autofs4/expire.c
··· 290 spin_lock(&sbi->fs_lock); 291 ino = autofs4_dentry_ino(root); 292 /* No point expiring a pending mount */ 293 - if (ino->flags & AUTOFS_INF_PENDING) { 294 - spin_unlock(&sbi->fs_lock); 295 - return NULL; 296 - } 297 if (!autofs4_direct_busy(mnt, root, timeout, do_now)) { 298 struct autofs_info *ino = autofs4_dentry_ino(root); 299 ino->flags |= AUTOFS_INF_EXPIRING; ··· 299 spin_unlock(&sbi->fs_lock); 300 return root; 301 } 302 spin_unlock(&sbi->fs_lock); 303 dput(root); 304
··· 290 spin_lock(&sbi->fs_lock); 291 ino = autofs4_dentry_ino(root); 292 /* No point expiring a pending mount */ 293 + if (ino->flags & AUTOFS_INF_PENDING) 294 + goto out; 295 if (!autofs4_direct_busy(mnt, root, timeout, do_now)) { 296 struct autofs_info *ino = autofs4_dentry_ino(root); 297 ino->flags |= AUTOFS_INF_EXPIRING; ··· 301 spin_unlock(&sbi->fs_lock); 302 return root; 303 } 304 + out: 305 spin_unlock(&sbi->fs_lock); 306 dput(root); 307