aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorAnand Jain <Anand.Jain@oracle.com>2013-08-20 23:44:48 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-01 08:16:35 -0400
commite57138b3e96e45a63124492e736612378096290f (patch)
tree463e2063f9208bc9b243a9b298cdf7c44781ffb0 /fs/btrfs
parent77cef2ec5484564eca6bd12a2b4a1e88fd766fbc (diff)
btrfs: return btrfs error code for dev excl ops err
now threads can return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS as defined in btrfs.h for the dev excl operation error in the FS, which means with this kernel would stop logging (almost an user error) into the /var/log/messages v2: accepts Josef' comment Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ioctl.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index ddb4bc1252ad..1a5b9462dd9a 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1394,9 +1394,8 @@ static noinline int btrfs_ioctl_resize(struct file *file,
1394 1394
1395 if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running, 1395 if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
1396 1)) { 1396 1)) {
1397 pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n");
1398 mnt_drop_write_file(file); 1397 mnt_drop_write_file(file);
1399 return -EINVAL; 1398 return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS;
1400 } 1399 }
1401 1400
1402 mutex_lock(&root->fs_info->volume_mutex); 1401 mutex_lock(&root->fs_info->volume_mutex);
@@ -2379,8 +2378,7 @@ static long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg)
2379 2378
2380 if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running, 2379 if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
2381 1)) { 2380 1)) {
2382 pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); 2381 return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS;
2383 return -EINVAL;
2384 } 2382 }
2385 2383
2386 mutex_lock(&root->fs_info->volume_mutex); 2384 mutex_lock(&root->fs_info->volume_mutex);
@@ -3673,8 +3671,7 @@ static long btrfs_ioctl_dev_replace(struct btrfs_root *root, void __user *arg)
3673 if (atomic_xchg( 3671 if (atomic_xchg(
3674 &root->fs_info->mutually_exclusive_operation_running, 3672 &root->fs_info->mutually_exclusive_operation_running,
3675 1)) { 3673 1)) {
3676 pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); 3674 ret = BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS;
3677 ret = -EINPROGRESS;
3678 } else { 3675 } else {
3679 ret = btrfs_dev_replace_start(root, p); 3676 ret = btrfs_dev_replace_start(root, p);
3680 atomic_set( 3677 atomic_set(
@@ -3918,8 +3915,7 @@ again:
3918 } else { 3915 } else {
3919 /* this is (1) */ 3916 /* this is (1) */
3920 mutex_unlock(&fs_info->balance_mutex); 3917 mutex_unlock(&fs_info->balance_mutex);
3921 pr_info("btrfs: dev add/delete/balance/replace/resize operation in progress\n"); 3918 ret = BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS;
3922 ret = -EINVAL;
3923 goto out; 3919 goto out;
3924 } 3920 }
3925 3921