Skip to content

Commit

Permalink
autofs_dir_rmdir(): check ino->count for deciding whether it's empty...
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Sep 18, 2019
1 parent 41ca197 commit c3aed16
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/autofs/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c3aed16

Please sign in to comment.