aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 50ad8d2ae0e8..df08a9fa3a1f 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1113,7 +1113,7 @@ static int raid10_spare_active(mddev_t *mddev)
1113static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) 1113static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
1114{ 1114{
1115 conf_t *conf = mddev->private; 1115 conf_t *conf = mddev->private;
1116 int found = 0; 1116 int err = -EEXIST;
1117 int mirror; 1117 int mirror;
1118 mirror_info_t *p; 1118 mirror_info_t *p;
1119 int first = 0; 1119 int first = 0;
@@ -1123,9 +1123,9 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
1123 /* only hot-add to in-sync arrays, as recovery is 1123 /* only hot-add to in-sync arrays, as recovery is
1124 * very different from resync 1124 * very different from resync
1125 */ 1125 */
1126 return 0; 1126 return -EBUSY;
1127 if (!enough(conf)) 1127 if (!enough(conf))
1128 return 0; 1128 return -EINVAL;
1129 1129
1130 if (rdev->raid_disk) 1130 if (rdev->raid_disk)
1131 first = last = rdev->raid_disk; 1131 first = last = rdev->raid_disk;
@@ -1151,7 +1151,7 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
1151 1151
1152 p->head_position = 0; 1152 p->head_position = 0;
1153 rdev->raid_disk = mirror; 1153 rdev->raid_disk = mirror;
1154 found = 1; 1154 err = 0;
1155 if (rdev->saved_raid_disk != mirror) 1155 if (rdev->saved_raid_disk != mirror)
1156 conf->fullsync = 1; 1156 conf->fullsync = 1;
1157 rcu_assign_pointer(p->rdev, rdev); 1157 rcu_assign_pointer(p->rdev, rdev);
@@ -1159,7 +1159,7 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
1159 } 1159 }
1160 1160
1161 print_conf(conf); 1161 print_conf(conf);
1162 return found; 1162 return err;
1163} 1163}
1164 1164
1165static int raid10_remove_disk(mddev_t *mddev, int number) 1165static int raid10_remove_disk(mddev_t *mddev, int number)