diff options
-rw-r--r-- | drivers/md/raid10.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index a9ecec4e9a13..23de2144ee13 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -2654,16 +2654,17 @@ static void handle_write_completed(struct r10conf *conf, struct r10bio *r10_bio) | |||
2654 | rdev_dec_pending(rdev, conf->mddev); | 2654 | rdev_dec_pending(rdev, conf->mddev); |
2655 | } | 2655 | } |
2656 | } | 2656 | } |
2657 | if (test_bit(R10BIO_WriteError, | ||
2658 | &r10_bio->state)) | ||
2659 | close_write(r10_bio); | ||
2660 | if (fail) { | 2657 | if (fail) { |
2661 | spin_lock_irq(&conf->device_lock); | 2658 | spin_lock_irq(&conf->device_lock); |
2662 | list_add(&r10_bio->retry_list, &conf->bio_end_io_list); | 2659 | list_add(&r10_bio->retry_list, &conf->bio_end_io_list); |
2663 | spin_unlock_irq(&conf->device_lock); | 2660 | spin_unlock_irq(&conf->device_lock); |
2664 | md_wakeup_thread(conf->mddev->thread); | 2661 | md_wakeup_thread(conf->mddev->thread); |
2665 | } else | 2662 | } else { |
2663 | if (test_bit(R10BIO_WriteError, | ||
2664 | &r10_bio->state)) | ||
2665 | close_write(r10_bio); | ||
2666 | raid_end_bio_io(r10_bio); | 2666 | raid_end_bio_io(r10_bio); |
2667 | } | ||
2667 | } | 2668 | } |
2668 | } | 2669 | } |
2669 | 2670 | ||
@@ -2691,6 +2692,12 @@ static void raid10d(struct md_thread *thread) | |||
2691 | r10_bio = list_first_entry(&tmp, struct r10bio, | 2692 | r10_bio = list_first_entry(&tmp, struct r10bio, |
2692 | retry_list); | 2693 | retry_list); |
2693 | list_del(&r10_bio->retry_list); | 2694 | list_del(&r10_bio->retry_list); |
2695 | if (mddev->degraded) | ||
2696 | set_bit(R10BIO_Degraded, &r10_bio->state); | ||
2697 | |||
2698 | if (test_bit(R10BIO_WriteError, | ||
2699 | &r10_bio->state)) | ||
2700 | close_write(r10_bio); | ||
2694 | raid_end_bio_io(r10_bio); | 2701 | raid_end_bio_io(r10_bio); |
2695 | } | 2702 | } |
2696 | } | 2703 | } |