Skip to content

Commit

Permalink
md: handle writes to broken raid10 arrays gracefully
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arne Redlich authored and Linus Torvalds committed Jul 31, 2007
1 parent 14e7134 commit f6f953a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,13 @@ static int make_request(struct request_queue *q, struct bio * bio)
bio_list_add(&bl, mbio);
}

if (unlikely(!atomic_read(&r10_bio->remaining))) {
/* the array is dead */
md_write_end(mddev);
raid_end_bio_io(r10_bio);
return 0;
}

bitmap_startwrite(mddev->bitmap, bio->bi_sector, r10_bio->sectors, 0);
spin_lock_irqsave(&conf->device_lock, flags);
bio_list_merge(&conf->pending_bio_list, &bl);
Expand Down

0 comments on commit f6f953a

Please sign in to comment.