]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
md: fix deadlock in md/raid1 and md/raid10 when handling a read error
authorNeilBrown <neilb@suse.de>
Tue, 4 Mar 2008 22:29:29 +0000 (14:29 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 5 Mar 2008 00:35:17 +0000 (16:35 -0800)
commita35e63efa1fb18c6f20f38e3ddf3f8ffbcf0f6e7
tree8dddd54c45ebaad84a6178765d29d9536df944d1
parent466634488e80968f12e73dd1fe6af5c37a1fbfe2
md: fix deadlock in md/raid1 and md/raid10 when handling a read error

When handling a read error, we freeze the array to stop any other IO while
attempting to over-write with correct data.

This is done in the raid1d(raid10d) thread and must wait for all submitted IO
to complete (except for requests that failed and are sitting in the retry
queue - these are counted in ->nr_queue and will stay there during a freeze).

However write requests need attention from raid1d as bitmap updates might be
required.  This can cause a deadlock as raid1 is waiting for requests to
finish that themselves need attention from raid1d.

So we create a new function 'flush_pending_writes' to give that attention, and
call it in freeze_array to be sure that we aren't waiting on raid1d.

Thanks to "K.Tanaka" <k-tanaka@ce.jp.nec.com> for finding and reporting this
problem.

Cc: "K.Tanaka" <k-tanaka@ce.jp.nec.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/md/raid1.c
drivers/md/raid10.c