mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
autofs_dir_rmdir(): check ino->count for deciding whether it's empty...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
41ca19740a
commit
c3aed16680
1 changed files with 3 additions and 4 deletions
|
@ -691,11 +691,10 @@ static int autofs_dir_rmdir(struct inode *dir, struct dentry *dentry)
|
||||||
if (sbi->flags & AUTOFS_SBI_CATATONIC)
|
if (sbi->flags & AUTOFS_SBI_CATATONIC)
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
|
||||||
spin_lock(&sbi->lookup_lock);
|
if (atomic_read(&ino->count) != 1)
|
||||||
if (!simple_empty(dentry)) {
|
|
||||||
spin_unlock(&sbi->lookup_lock);
|
|
||||||
return -ENOTEMPTY;
|
return -ENOTEMPTY;
|
||||||
}
|
|
||||||
|
spin_lock(&sbi->lookup_lock);
|
||||||
__autofs_add_expiring(dentry);
|
__autofs_add_expiring(dentry);
|
||||||
d_drop(dentry);
|
d_drop(dentry);
|
||||||
spin_unlock(&sbi->lookup_lock);
|
spin_unlock(&sbi->lookup_lock);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue