diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2013-03-04 12:28:38 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-03-04 16:33:24 -0500 |
commit | 9b53157aac7366cea413ee29b629f83225829e87 (patch) | |
tree | 1862fab3bad6c96d34b341bc0d10952e86b393f1 /fs/btrfs | |
parent | 66b6135b7cf741f6f44ba938b27583ea3b83bd12 (diff) |
Btrfs: allow running defrag in parallel to administrative tasks
Commit 5ac00add 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 <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ioctl.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3fdfabcc1aaa..898c5729e7e5 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -2245,13 +2245,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp) | |||
2245 | if (ret) | 2245 | if (ret) |
2246 | return ret; | 2246 | return ret; |
2247 | 2247 | ||
2248 | if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running, | ||
2249 | 1)) { | ||
2250 | pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); | ||
2251 | mnt_drop_write_file(file); | ||
2252 | return -EINVAL; | ||
2253 | } | ||
2254 | |||
2255 | if (btrfs_root_readonly(root)) { | 2248 | if (btrfs_root_readonly(root)) { |
2256 | ret = -EROFS; | 2249 | ret = -EROFS; |
2257 | goto out; | 2250 | goto out; |
@@ -2306,7 +2299,6 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp) | |||
2306 | ret = -EINVAL; | 2299 | ret = -EINVAL; |
2307 | } | 2300 | } |
2308 | out: | 2301 | out: |
2309 | atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0); | ||
2310 | mnt_drop_write_file(file); | 2302 | mnt_drop_write_file(file); |
2311 | return ret; | 2303 | return ret; |
2312 | } | 2304 | } |