Skip to content

Commit

Permalink
Btrfs: allow running defrag in parallel to administrative tasks
Browse files Browse the repository at this point in the history
Commit 5ac00ad added a testnset mutex and code that disallows
running administrative tasks in parallel. It is prevented that
the device add/delete/balance/replace/resize operations are
started in parallel. By mistake, the defragmentation operation
was included in the check for mutually exclusiveness as well.
This is fixed with this commit.

Signed-off-by: Stefan Behrens <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
  • Loading branch information
Stefan Behrens authored and Josef Bacik committed Mar 4, 2013
1 parent 66b6135 commit 9b53157
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2245,13 +2245,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
if (ret)
return ret;

if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
1)) {
pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n");
mnt_drop_write_file(file);
return -EINVAL;
}

if (btrfs_root_readonly(root)) {
ret = -EROFS;
goto out;
Expand Down Expand Up @@ -2306,7 +2299,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
ret = -EINVAL;
}
out:
atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0);
mnt_drop_write_file(file);
return ret;
}
Expand Down

0 comments on commit 9b53157

Please sign in to comment.