diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-08 01:47:47 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 01:47:47 -0400 |
commit | 93022136fff9e6130aa128a5ed8a599e93ac813c (patch) | |
tree | 185390fb75a3d7423cc508610b76637c957205b9 /drivers/md | |
parent | c49c412a47b5102516d3313d4eba38cb1e968721 (diff) | |
parent | b7279469d66b55119784b8b9529c99c1955fe747 (diff) |
Merge commit 'v2.6.26-rc9' into x86/cpu
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-crypt.c | 1 | ||||
-rw-r--r-- | drivers/md/md.c | 8 | ||||
-rw-r--r-- | drivers/md/raid10.c | 2 | ||||
-rw-r--r-- | drivers/md/raid5.c | 17 |
4 files changed, 23 insertions, 5 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 835def11419d..ab6a61db63ce 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -432,6 +432,7 @@ static int crypt_convert(struct crypt_config *cc, | |||
432 | case 0: | 432 | case 0: |
433 | atomic_dec(&ctx->pending); | 433 | atomic_dec(&ctx->pending); |
434 | ctx->sector++; | 434 | ctx->sector++; |
435 | cond_resched(); | ||
435 | continue; | 436 | continue; |
436 | 437 | ||
437 | /* error */ | 438 | /* error */ |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 51c19f86ff99..2580ac1b9b0f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -276,6 +276,7 @@ static mddev_t * mddev_find(dev_t unit) | |||
276 | atomic_set(&new->active, 1); | 276 | atomic_set(&new->active, 1); |
277 | spin_lock_init(&new->write_lock); | 277 | spin_lock_init(&new->write_lock); |
278 | init_waitqueue_head(&new->sb_wait); | 278 | init_waitqueue_head(&new->sb_wait); |
279 | init_waitqueue_head(&new->recovery_wait); | ||
279 | new->reshape_position = MaxSector; | 280 | new->reshape_position = MaxSector; |
280 | new->resync_max = MaxSector; | 281 | new->resync_max = MaxSector; |
281 | new->level = LEVEL_NONE; | 282 | new->level = LEVEL_NONE; |
@@ -3896,8 +3897,10 @@ static void autorun_devices(int part) | |||
3896 | 3897 | ||
3897 | md_probe(dev, NULL, NULL); | 3898 | md_probe(dev, NULL, NULL); |
3898 | mddev = mddev_find(dev); | 3899 | mddev = mddev_find(dev); |
3899 | if (!mddev) { | 3900 | if (!mddev || !mddev->gendisk) { |
3900 | printk(KERN_ERR | 3901 | if (mddev) |
3902 | mddev_put(mddev); | ||
3903 | printk(KERN_ERR | ||
3901 | "md: cannot allocate memory for md drive.\n"); | 3904 | "md: cannot allocate memory for md drive.\n"); |
3902 | break; | 3905 | break; |
3903 | } | 3906 | } |
@@ -5665,7 +5668,6 @@ void md_do_sync(mddev_t *mddev) | |||
5665 | window/2,(unsigned long long) max_sectors/2); | 5668 | window/2,(unsigned long long) max_sectors/2); |
5666 | 5669 | ||
5667 | atomic_set(&mddev->recovery_active, 0); | 5670 | atomic_set(&mddev->recovery_active, 0); |
5668 | init_waitqueue_head(&mddev->recovery_wait); | ||
5669 | last_check = 0; | 5671 | last_check = 0; |
5670 | 5672 | ||
5671 | if (j>2) { | 5673 | if (j>2) { |
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 425958a76b84..54c8ee28fcc4 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -2002,6 +2002,7 @@ static int __handle_issuing_new_read_requests5(struct stripe_head *sh, | |||
2002 | * have quiesced. | 2002 | * have quiesced. |
2003 | */ | 2003 | */ |
2004 | if ((s->uptodate == disks - 1) && | 2004 | if ((s->uptodate == disks - 1) && |
2005 | (s->failed && disk_idx == s->failed_num) && | ||
2005 | !test_bit(STRIPE_OP_CHECK, &sh->ops.pending)) { | 2006 | !test_bit(STRIPE_OP_CHECK, &sh->ops.pending)) { |
2006 | set_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending); | 2007 | set_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending); |
2007 | set_bit(R5_Wantcompute, &dev->flags); | 2008 | set_bit(R5_Wantcompute, &dev->flags); |
@@ -2087,7 +2088,9 @@ static void handle_issuing_new_read_requests6(struct stripe_head *sh, | |||
2087 | /* we would like to get this block, possibly | 2088 | /* we would like to get this block, possibly |
2088 | * by computing it, but we might not be able to | 2089 | * by computing it, but we might not be able to |
2089 | */ | 2090 | */ |
2090 | if (s->uptodate == disks-1) { | 2091 | if ((s->uptodate == disks - 1) && |
2092 | (s->failed && (i == r6s->failed_num[0] || | ||
2093 | i == r6s->failed_num[1]))) { | ||
2091 | pr_debug("Computing stripe %llu block %d\n", | 2094 | pr_debug("Computing stripe %llu block %d\n", |
2092 | (unsigned long long)sh->sector, i); | 2095 | (unsigned long long)sh->sector, i); |
2093 | compute_block_1(sh, i, 0); | 2096 | compute_block_1(sh, i, 0); |
@@ -2645,6 +2648,7 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2645 | struct r5dev *dev; | 2648 | struct r5dev *dev; |
2646 | unsigned long pending = 0; | 2649 | unsigned long pending = 0; |
2647 | mdk_rdev_t *blocked_rdev = NULL; | 2650 | mdk_rdev_t *blocked_rdev = NULL; |
2651 | int prexor; | ||
2648 | 2652 | ||
2649 | memset(&s, 0, sizeof(s)); | 2653 | memset(&s, 0, sizeof(s)); |
2650 | pr_debug("handling stripe %llu, state=%#lx cnt=%d, pd_idx=%d " | 2654 | pr_debug("handling stripe %llu, state=%#lx cnt=%d, pd_idx=%d " |
@@ -2774,9 +2778,11 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2774 | /* leave prexor set until postxor is done, allows us to distinguish | 2778 | /* leave prexor set until postxor is done, allows us to distinguish |
2775 | * a rmw from a rcw during biodrain | 2779 | * a rmw from a rcw during biodrain |
2776 | */ | 2780 | */ |
2781 | prexor = 0; | ||
2777 | if (test_bit(STRIPE_OP_PREXOR, &sh->ops.complete) && | 2782 | if (test_bit(STRIPE_OP_PREXOR, &sh->ops.complete) && |
2778 | test_bit(STRIPE_OP_POSTXOR, &sh->ops.complete)) { | 2783 | test_bit(STRIPE_OP_POSTXOR, &sh->ops.complete)) { |
2779 | 2784 | ||
2785 | prexor = 1; | ||
2780 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.complete); | 2786 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.complete); |
2781 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.ack); | 2787 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.ack); |
2782 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.pending); | 2788 | clear_bit(STRIPE_OP_PREXOR, &sh->ops.pending); |
@@ -2810,6 +2816,8 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2810 | if (!test_and_set_bit( | 2816 | if (!test_and_set_bit( |
2811 | STRIPE_OP_IO, &sh->ops.pending)) | 2817 | STRIPE_OP_IO, &sh->ops.pending)) |
2812 | sh->ops.count++; | 2818 | sh->ops.count++; |
2819 | if (prexor) | ||
2820 | continue; | ||
2813 | if (!test_bit(R5_Insync, &dev->flags) || | 2821 | if (!test_bit(R5_Insync, &dev->flags) || |
2814 | (i == sh->pd_idx && s.failed == 0)) | 2822 | (i == sh->pd_idx && s.failed == 0)) |
2815 | set_bit(STRIPE_INSYNC, &sh->state); | 2823 | set_bit(STRIPE_INSYNC, &sh->state); |
@@ -2890,6 +2898,8 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2890 | 2898 | ||
2891 | for (i = conf->raid_disks; i--; ) { | 2899 | for (i = conf->raid_disks; i--; ) { |
2892 | 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++; | ||
2893 | if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending)) | 2903 | if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending)) |
2894 | sh->ops.count++; | 2904 | sh->ops.count++; |
2895 | } | 2905 | } |
@@ -2903,6 +2913,7 @@ static void handle_stripe5(struct stripe_head *sh) | |||
2903 | conf->raid_disks); | 2913 | conf->raid_disks); |
2904 | s.locked += handle_write_operations5(sh, 1, 1); | 2914 | s.locked += handle_write_operations5(sh, 1, 1); |
2905 | } else if (s.expanded && | 2915 | } else if (s.expanded && |
2916 | s.locked == 0 && | ||
2906 | !test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) { | 2917 | !test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) { |
2907 | clear_bit(STRIPE_EXPAND_READY, &sh->state); | 2918 | clear_bit(STRIPE_EXPAND_READY, &sh->state); |
2908 | atomic_dec(&conf->reshape_stripes); | 2919 | atomic_dec(&conf->reshape_stripes); |
@@ -4297,7 +4308,9 @@ static int run(mddev_t *mddev) | |||
4297 | " disk %d\n", bdevname(rdev->bdev,b), | 4308 | " disk %d\n", bdevname(rdev->bdev,b), |
4298 | raid_disk); | 4309 | raid_disk); |
4299 | working_disks++; | 4310 | working_disks++; |
4300 | } | 4311 | } else |
4312 | /* Cannot rely on bitmap to complete recovery */ | ||
4313 | conf->fullsync = 1; | ||
4301 | } | 4314 | } |
4302 | 4315 | ||
4303 | /* | 4316 | /* |