Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343605
b: refs/heads/master
c: 0259cb0
h: refs/heads/master
i:
  343603: 854094f
v: v3
  • Loading branch information
Ian Kent authored and Linus Torvalds committed Dec 14, 2012
1 parent 0bee131 commit 52dceb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f55fb0c24386cee8b78f60d60186716bd0909493
refs/heads/master: 0259cb02c4004d3088b0999799f8f5c8801f6b97
22 changes: 5 additions & 17 deletions trunk/fs/autofs4/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,10 @@ static int autofs4_dir_open(struct inode *inode, struct file *file)
* it.
*/
spin_lock(&sbi->lookup_lock);
spin_lock(&dentry->d_lock);
if (!d_mountpoint(dentry) && list_empty(&dentry->d_subdirs)) {
spin_unlock(&dentry->d_lock);
if (!d_mountpoint(dentry) && simple_empty(dentry)) {
spin_unlock(&sbi->lookup_lock);
return -ENOENT;
}
spin_unlock(&dentry->d_lock);
spin_unlock(&sbi->lookup_lock);

out:
Expand Down Expand Up @@ -386,12 +383,8 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
goto done;
}
} else {
spin_lock(&dentry->d_lock);
if (!list_empty(&dentry->d_subdirs)) {
spin_unlock(&dentry->d_lock);
if (!simple_empty(dentry))
goto done;
}
spin_unlock(&dentry->d_lock);
}
ino->flags |= AUTOFS_INF_PENDING;
spin_unlock(&sbi->fs_lock);
Expand Down Expand Up @@ -610,9 +603,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)

spin_lock(&sbi->lookup_lock);
__autofs4_add_expiring(dentry);
spin_lock(&dentry->d_lock);
__d_drop(dentry);
spin_unlock(&dentry->d_lock);
d_drop(dentry);
spin_unlock(&sbi->lookup_lock);

return 0;
Expand Down Expand Up @@ -683,15 +674,12 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry)
return -EACCES;

spin_lock(&sbi->lookup_lock);
spin_lock(&dentry->d_lock);
if (!list_empty(&dentry->d_subdirs)) {
spin_unlock(&dentry->d_lock);
if (!simple_empty(dentry)) {
spin_unlock(&sbi->lookup_lock);
return -ENOTEMPTY;
}
__autofs4_add_expiring(dentry);
__d_drop(dentry);
spin_unlock(&dentry->d_lock);
d_drop(dentry);
spin_unlock(&sbi->lookup_lock);

if (sbi->version < 5)
Expand Down

0 comments on commit 52dceb8

Please sign in to comment.