Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109180
b: refs/heads/master
c: de6bf18
h: refs/heads/master
v: v3
  • Loading branch information
Louis Rilling authored and Mark Fasheh committed Aug 22, 2008
1 parent 46cea95 commit 29a4b3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 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: 9780eb6cfaf7d2d5ccc061eaf94e7aec6a17791e
refs/heads/master: de6bf18e9ce0df807dab08cff08751cac383429d
17 changes: 7 additions & 10 deletions trunk/fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,16 +1311,18 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
* Ensure that no racing symlink() will make detach_prep() fail while
* the new link is temporarily attached
*/
mutex_lock(&configfs_symlink_mutex);
spin_lock(&configfs_dirent_lock);
do {
struct mutex *wait_mutex;

mutex_lock(&configfs_symlink_mutex);
spin_lock(&configfs_dirent_lock);
ret = configfs_detach_prep(dentry, &wait_mutex);
if (ret) {
if (ret)
configfs_detach_rollback(dentry);
spin_unlock(&configfs_dirent_lock);
mutex_unlock(&configfs_symlink_mutex);
spin_unlock(&configfs_dirent_lock);
mutex_unlock(&configfs_symlink_mutex);

if (ret) {
if (ret != -EAGAIN) {
config_item_put(parent_item);
return ret;
Expand All @@ -1329,13 +1331,8 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
/* Wait until the racing operation terminates */
mutex_lock(wait_mutex);
mutex_unlock(wait_mutex);

mutex_lock(&configfs_symlink_mutex);
spin_lock(&configfs_dirent_lock);
}
} while (ret == -EAGAIN);
spin_unlock(&configfs_dirent_lock);
mutex_unlock(&configfs_symlink_mutex);

/* Get a working ref for the duration of this function */
item = configfs_get_config_item(dentry);
Expand Down

0 comments on commit 29a4b3c

Please sign in to comment.