diff options
author | Arne Redlich <agr@powerkom-dd.de> | 2007-07-31 03:37:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-31 18:39:38 -0400 |
commit | f6f953aa99d456aff44ffdb1c77061d1a010eae2 (patch) | |
tree | 9a708f373c8d1d8c94c1494e25add4a08b6ce782 /drivers/md | |
parent | 14e713446aaca97dbe590fe845f7dcbd74ddbee2 (diff) |
md: handle writes to broken raid10 arrays gracefully
When writing to a broken array, raid10 currently happily emits empty bio
lists. IOW, the master bio will never be completed, sending writers to
UNINTERRUPTIBLE_SLEEP forever.
Signed-off-by: Arne Redlich <agr@powerkom-dd.de>
Acked-by: Neil Brown <neilb@suse.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid10.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 0c97bf4f686e..4e53792aa520 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -917,6 +917,13 @@ static int make_request(struct request_queue *q, struct bio * bio) | |||
917 | bio_list_add(&bl, mbio); | 917 | bio_list_add(&bl, mbio); |
918 | } | 918 | } |
919 | 919 | ||
920 | if (unlikely(!atomic_read(&r10_bio->remaining))) { | ||
921 | /* the array is dead */ | ||
922 | md_write_end(mddev); | ||
923 | raid_end_bio_io(r10_bio); | ||
924 | return 0; | ||
925 | } | ||
926 | |||
920 | bitmap_startwrite(mddev->bitmap, bio->bi_sector, r10_bio->sectors, 0); | 927 | bitmap_startwrite(mddev->bitmap, bio->bi_sector, r10_bio->sectors, 0); |
921 | spin_lock_irqsave(&conf->device_lock, flags); | 928 | spin_lock_irqsave(&conf->device_lock, flags); |
922 | bio_list_merge(&conf->pending_bio_list, &bl); | 929 | bio_list_merge(&conf->pending_bio_list, &bl); |