summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2008-08-19 16:23:37 -0700
committerMark Fasheh <mfasheh@suse.com>2008-08-19 16:23:37 -0700
commit6d036283ff83027a511449e23a4e217f2f5fccff (patch)
tree681e53bd511b75543e4a22a5c7000b71b1706326 /fs
parent7b98f64fa3543d3f9483fa81091f3bdea22cb27b (diff)
parent1515743f6f64cb63a668a5483cebb0ba031aa06b (diff)
Merge branch 'configfs' into linux-next
Diffstat (limited to 'fs')
-rw-r--r--fs/configfs/dir.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 7a8db78a91d2..8e93341f3e82 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -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;
@@ -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);