提交 f6f953aa 编写于 作者: A Arne Redlich 提交者: Linus Torvalds

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: NArne Redlich <agr@powerkom-dd.de>
Acked-by: NNeil Brown <neilb@suse.de>
Cc: <stable@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 14e71344
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册