Commit c6b96d19 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-2.6.26' of git://neil.brown.name/md

* 'for-2.6.26' of git://neil.brown.name/md:
  Fix error paths if md_probe fails.
  Don't acknowlege that stripe-expand is complete until it really is.
  Ensure interrupted recovery completed properly (v1 metadata plus bitmap)
parents 79ff1ad2 9bbbca3a
...@@ -3897,7 +3897,9 @@ static void autorun_devices(int part) ...@@ -3897,7 +3897,9 @@ static void autorun_devices(int part)
md_probe(dev, NULL, NULL); md_probe(dev, NULL, NULL);
mddev = mddev_find(dev); mddev = mddev_find(dev);
if (!mddev) { if (!mddev || !mddev->gendisk) {
if (mddev)
mddev_put(mddev);
printk(KERN_ERR printk(KERN_ERR
"md: cannot allocate memory for md drive.\n"); "md: cannot allocate memory for md drive.\n");
break; break;
......
...@@ -2137,6 +2137,8 @@ static int run(mddev_t *mddev) ...@@ -2137,6 +2137,8 @@ static int run(mddev_t *mddev)
!test_bit(In_sync, &disk->rdev->flags)) { !test_bit(In_sync, &disk->rdev->flags)) {
disk->head_position = 0; disk->head_position = 0;
mddev->degraded++; mddev->degraded++;
if (disk->rdev)
conf->fullsync = 1;
} }
} }
......
...@@ -2898,6 +2898,8 @@ static void handle_stripe5(struct stripe_head *sh) ...@@ -2898,6 +2898,8 @@ static void handle_stripe5(struct stripe_head *sh)
for (i = conf->raid_disks; i--; ) { for (i = conf->raid_disks; i--; ) {
set_bit(R5_Wantwrite, &sh->dev[i].flags); set_bit(R5_Wantwrite, &sh->dev[i].flags);
set_bit(R5_LOCKED, &dev->flags);
s.locked++;
if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending)) if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending))
sh->ops.count++; sh->ops.count++;
} }
...@@ -2911,6 +2913,7 @@ static void handle_stripe5(struct stripe_head *sh) ...@@ -2911,6 +2913,7 @@ static void handle_stripe5(struct stripe_head *sh)
conf->raid_disks); conf->raid_disks);
s.locked += handle_write_operations5(sh, 1, 1); s.locked += handle_write_operations5(sh, 1, 1);
} else if (s.expanded && } else if (s.expanded &&
s.locked == 0 &&
!test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) { !test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) {
clear_bit(STRIPE_EXPAND_READY, &sh->state); clear_bit(STRIPE_EXPAND_READY, &sh->state);
atomic_dec(&conf->reshape_stripes); atomic_dec(&conf->reshape_stripes);
...@@ -4305,7 +4308,9 @@ static int run(mddev_t *mddev) ...@@ -4305,7 +4308,9 @@ static int run(mddev_t *mddev)
" disk %d\n", bdevname(rdev->bdev,b), " disk %d\n", bdevname(rdev->bdev,b),
raid_disk); raid_disk);
working_disks++; working_disks++;
} } else
/* Cannot rely on bitmap to complete recovery */
conf->fullsync = 1;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment