Btrfs: Add locking around volume management (device add/remove/balance)
[deliverable/linux.git] / fs / btrfs / ioctl.c
index 6002eb64daf938e7fcf1a84959cf485526fef69e..83f17a5cbd6a23e67e34c6b1d1da7a7f4a1595e2 100644 (file)
@@ -164,7 +164,6 @@ fail:
                ret = err;
 fail_commit:
        btrfs_btree_balance_dirty(root, nr);
-       btrfs_throttle(root);
        return ret;
 }
 
@@ -206,7 +205,6 @@ static int create_snapshot(struct btrfs_root *root, char *name, int namelen)
 
 fail_unlock:
        btrfs_btree_balance_dirty(root, nr);
-       btrfs_throttle(root);
        return ret;
 }
 
@@ -309,8 +307,7 @@ static int btrfs_ioctl_resize(struct btrfs_root *root, void __user *arg)
                goto out;
        }
 
-       mutex_lock(&root->fs_info->alloc_mutex);
-       mutex_lock(&root->fs_info->chunk_mutex);
+       mutex_lock(&root->fs_info->volume_mutex);
        sizestr = vol_args->name;
        devstr = strchr(sizestr, ':');
        if (devstr) {
@@ -380,8 +377,7 @@ static int btrfs_ioctl_resize(struct btrfs_root *root, void __user *arg)
        }
 
 out_unlock:
-       mutex_lock(&root->fs_info->alloc_mutex);
-       mutex_lock(&root->fs_info->chunk_mutex);
+       mutex_unlock(&root->fs_info->volume_mutex);
 out:
        kfree(vol_args);
        return ret;
This page took 0.025608 seconds and 5 git commands to generate.