aboutsummaryrefslogtreecommitdiffstats
path: root/fs/configfs/dir.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-10-09 16:31:56 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-09 16:31:56 -0400
commit6a4690c22f5da1eb1c898b61b6a80da52fbd976f (patch)
treea03891a32abe0da191fb765fe669a597e07423c6 /fs/configfs/dir.c
parent90bb28b0644f7324f8bd1feb27b35146e6785ba2 (diff)
parent8ec53663d2698076468b3e1edc4e1b418bd54de3 (diff)
Merge branch 'ptebits' into devel
Conflicts: arch/arm/Kconfig
Diffstat (limited to 'fs/configfs/dir.c')
-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)
1311 * Ensure that no racing symlink() will make detach_prep() fail while 1311 * Ensure that no racing symlink() will make detach_prep() fail while
1312 * the new link is temporarily attached 1312 * the new link is temporarily attached
1313 */ 1313 */
1314 mutex_lock(&configfs_symlink_mutex);
1315 spin_lock(&configfs_dirent_lock);
1316 do { 1314 do {
1317 struct mutex *wait_mutex; 1315 struct mutex *wait_mutex;
1318 1316
1317 mutex_lock(&configfs_symlink_mutex);
1318 spin_lock(&configfs_dirent_lock);
1319 ret = configfs_detach_prep(dentry, &wait_mutex); 1319 ret = configfs_detach_prep(dentry, &wait_mutex);
1320 if (ret) { 1320 if (ret)
1321 configfs_detach_rollback(dentry); 1321 configfs_detach_rollback(dentry);
1322 spin_unlock(&configfs_dirent_lock); 1322 spin_unlock(&configfs_dirent_lock);
1323 mutex_unlock(&configfs_symlink_mutex); 1323 mutex_unlock(&configfs_symlink_mutex);
1324
1325 if (ret) {
1324 if (ret != -EAGAIN) { 1326 if (ret != -EAGAIN) {
1325 config_item_put(parent_item); 1327 config_item_put(parent_item);
1326 return ret; 1328 return ret;
@@ -1329,13 +1331,8 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
1329 /* Wait until the racing operation terminates */ 1331 /* Wait until the racing operation terminates */
1330 mutex_lock(wait_mutex); 1332 mutex_lock(wait_mutex);
1331 mutex_unlock(wait_mutex); 1333 mutex_unlock(wait_mutex);
1332
1333 mutex_lock(&configfs_symlink_mutex);
1334 spin_lock(&configfs_dirent_lock);
1335 } 1334 }
1336 } while (ret == -EAGAIN); 1335 } while (ret == -EAGAIN);
1337 spin_unlock(&configfs_dirent_lock);
1338 mutex_unlock(&configfs_symlink_mutex);
1339 1336
1340 /* Get a working ref for the duration of this function */ 1337 /* Get a working ref for the duration of this function */
1341 item = configfs_get_config_item(dentry); 1338 item = configfs_get_config_item(dentry);