History

Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md

Pull MD fixes from Shaohua Li: "Two small fixes for MD: - an error handling fix from me - a recover bug fix for raid10 from BingJing" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md: md/raid10: fix that replacement cannot complete recovery after reassemble MD: cleanup resources in failure

Linus Torvalds committed 8 years ago

Commit d0fbad02 parents 8d2b6f6 bda31532 files · +12 −3Browse files

Unified · Split

2 files
  1. drivers/md/md.c +5 −3
  2. drivers/md/raid10.c +7 −0
drivers/md/md.c+5−3
@@ -5547,7 +5547,8 @@ int md_run(struct mddev *mddev) · 5546 unmodified lines
55475547 else
55485548 pr_warn("md: personality for level %s is not loaded!\n",
55495549 mddev->clevel);
5550− return -EINVAL;
5550+ err = -EINVAL;
5551+ goto abort;
55515552 }
55525553 spin_unlock(&pers_lock);
55535554 if (mddev->level != pers->level) {
@@ -5560,7 +5561,8 @@ int md_run(struct mddev *mddev) · 6 unmodified lines
55605561 pers->start_reshape == NULL) {
55615562 /* This personality cannot handle reshaping... */
55625563 module_put(pers->owner);
5563− return -EINVAL;
5564+ err = -EINVAL;
5565+ goto abort;
55645566 }
55655567
55665568 if (pers->sync_request) {
@@ -5629,7 +5631,7 @@ int md_run(struct mddev *mddev) · 62 unmodified lines
56295631 mddev->private = NULL;
56305632 module_put(pers->owner);
56315633 bitmap_destroy(mddev);
5632− return err;
5634+ goto abort;
56335635 }
56345636 if (mddev->queue) {
56355637 bool nonrot = true;
drivers/md/raid10.c+7−0
@@ -3893,6 +3893,13 @@ static int raid10_run(struct mddev *mddev) · 3892 unmodified lines
38933893 disk->rdev->saved_raid_disk < 0)
38943894 conf->fullsync = 1;
38953895 }
3896+
3897+ if (disk->replacement &&
3898+ !test_bit(In_sync, &disk->replacement->flags) &&
3899+ disk->replacement->saved_raid_disk < 0) {
3900+ conf->fullsync = 1;
3901+ }
3902+
38963903 disk->recovery_disabled = mddev->recovery_disabled - 1;
38973904 }
38983905