mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] md: handle writes to broken raid10 arrays gracefully
@ 2007-07-27 14:44 Arne Redlich
  0 siblings, 0 replies; only message in thread
From: Arne Redlich @ 2007-07-27 14:44 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid, lkml

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>

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index ea1b3e3..957932e 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)
 		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);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-27 15:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-27 14:44 [PATCH] md: handle writes to broken raid10 arrays gracefully Arne Redlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®