]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md/raid1: perform bad-block tests for WriteMostly devices too.
authorNeilBrown <neilb@suse.de>
Sun, 8 Jan 2012 14:41:51 +0000 (01:41 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Jan 2012 00:13:20 +0000 (16:13 -0800)
commit45c5b2b95f829018321325129d824a6154d5f955
treee4448b152da9d1e3a27fcb8ea8f2193f7d029b31
parentee1f334f2f580ff09f7c1f83be46aa2bbb4d5f6a
md/raid1: perform bad-block tests for WriteMostly devices too.

commit 307729c8bc5b5a41361af8af95906eee7552acb1 upstream.

We normally try to avoid reading from write-mostly devices, but when
we do we really have to check for bad blocks and be sure not to
try reading them.

With the current code, best_good_sectors might not get set and that
causes zero-length read requests to be send down which is very
confusing.

This bug was introduced in commit d2eb35acfdccbe2 and so the patch
is suitable for 3.1.x and 3.2.x

Reported-and-tested-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reported-and-tested-by: Art -kwaak- van Breemen <ard@telegraafnet.nl>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/raid1.c