diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-02 21:47:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-02 21:47:10 -0400 |
commit | c6b96d195a0fd132d6e8c783216d1d3f686e5ba8 (patch) | |
tree | cf4594f2ae0407e4a501a20ba05c5629161b47ee /drivers | |
parent | 79ff1ad2eec1c106962241f6346958b9641e34f3 (diff) | |
parent | 9bbbca3a0ee09293108b67835c6bdf6196d7bcb3 (diff) |
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)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/md.c | 6 | ||||
-rw-r--r-- | drivers/md/raid10.c | 2 | ||||
-rw-r--r-- | drivers/md/raid5.c | 7 |
3 files changed, 12 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 7cf512a34ccf..2580ac1b9b0f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -3897,8 +3897,10 @@ static void autorun_devices(int part) | |||
3897 | 3897 | ||
3898 | md_probe(dev, NULL, NULL); | 3898 | md_probe(dev, NULL, NULL); |
3899 | mddev = mddev_find(dev); | 3899 | mddev = mddev_find(dev); |
3900 | if (!mddev) { | 3900 | if (!mddev || !mddev->gendisk) { |
3901 | printk(KERN_ERR | 3901 | if (mddev) |
3902 | mddev_put(mddev); | ||
3903 | printk(KERN_ERR | ||
3902 | "md: cannot allocate memory for md drive.\n"); | 3904 | "md: cannot allocate memory for md drive.\n"); |
3903 | break; | 3905 | break; |
3904 | } | 3906 | } |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 1de17da34a95..a71277b640ab 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -2137,6 +2137,8 @@ static int run(mddev_t *mddev) | |||
2137 | !test_bit(In_sync, &disk->rdev->flags)) { | 2137 | !test_bit(In_sync, &disk->rdev->flags)) { |
2138 | disk->head_position = 0; | 2138 | disk->head_position = 0; |
2139 | mddev->degraded++; | 2139 | mddev->degraded++; |
2140 | if (disk->rdev) | ||
2141 | conf->fullsync = 1; | ||
2140 | } | 2142 | } |
2141 | } | 2143 | } |
2142 | 2144 | ||
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index c37e256b1176..54c8ee28fcc4 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -2898,6 +2898,8 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2898 | 2898 | ||
2899 | for (i = conf->raid_disks; i--; ) { | 2899 | for (i = conf->raid_disks; i--; ) { |
2900 | set_bit(R5_Wantwrite, &sh->dev[i].flags); | 2900 | set_bit(R5_Wantwrite, &sh->dev[i].flags); |
2901 | set_bit(R5_LOCKED, &dev->flags); | ||
2902 | s.locked++; | ||
2901 | if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending)) | 2903 | if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending)) |
2902 | sh->ops.count++; | 2904 | sh->ops.count++; |
2903 | } | 2905 | } |
@@ -2911,6 +2913,7 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2911 | conf->raid_disks); | 2913 | conf->raid_disks); |
2912 | s.locked += handle_write_operations5(sh, 1, 1); | 2914 | s.locked += handle_write_operations5(sh, 1, 1); |
2913 | } else if (s.expanded && | 2915 | } else if (s.expanded && |
2916 | s.locked == 0 && | ||
2914 | !test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) { | 2917 | !test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) { |
2915 | clear_bit(STRIPE_EXPAND_READY, &sh->state); | 2918 | clear_bit(STRIPE_EXPAND_READY, &sh->state); |
2916 | atomic_dec(&conf->reshape_stripes); | 2919 | atomic_dec(&conf->reshape_stripes); |
@@ -4305,7 +4308,9 @@ static int run(mddev_t *mddev) | |||
4305 | " disk %d\n", bdevname(rdev->bdev,b), | 4308 | " disk %d\n", bdevname(rdev->bdev,b), |
4306 | raid_disk); | 4309 | raid_disk); |
4307 | working_disks++; | 4310 | working_disks++; |
4308 | } | 4311 | } else |
4312 | /* Cannot rely on bitmap to complete recovery */ | ||
4313 | conf->fullsync = 1; | ||
4309 | } | 4314 | } |
4310 | 4315 | ||
4311 | /* | 4316 | /* |