summaryrefslogtreecommitdiffstats
path: root/fs/autofs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-09-17 23:28:08 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2019-09-17 23:28:08 -0400
commitc3aed16680cd0c0e5abf1bfc0dc1338e6a41b29f (patch)
tree1f5d5d9fd3b01494de6fc9744c958f0cbb283d2c /fs/autofs
parent41ca19740a0e772eff1f9ba67293649feb836662 (diff)
downloadlinux-c3aed16680cd0c0e5abf1bfc0dc1338e6a41b29f.tar.bz2
autofs_dir_rmdir(): check ino->count for deciding whether it's empty...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/autofs')
-rw-r--r--fs/autofs/root.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/autofs/root.c b/fs/autofs/root.c
index 7806b110e79d..ae1d112b6f64 100644
--- a/fs/autofs/root.c
+++ b/fs/autofs/root.c
@@ -691,11 +691,10 @@ static int autofs_dir_rmdir(struct inode *dir, struct dentry *dentry)
if (sbi->flags & AUTOFS_SBI_CATATONIC)
return -EACCES;
- spin_lock(&sbi->lookup_lock);
- if (!simple_empty(dentry)) {
- spin_unlock(&sbi->lookup_lock);
+ if (atomic_read(&ino->count) != 1)
return -ENOTEMPTY;
- }
+
+ spin_lock(&sbi->lookup_lock);
__autofs_add_expiring(dentry);
d_drop(dentry);
spin_unlock(&sbi->lookup_lock);