md/raid1: fix counting of write targets.
commit7ab3fe4e7c100910f4d000814efcb1d85affdc01
authorNeilBrown <neilb@suse.de>
Tue, 18 May 2010 05:27:13 +0000 (18 15:27 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:22:21 +0000 (5 11:22 -0700)
treec65be0315d1bd0702a5afdddd4ca6b835331d49b
parentff021ea1d801d155ce2ee1f9c867f1ced59ef4ab
md/raid1: fix counting of write targets.

commit 964147d5c86d63be79b442c30f3783d49860c078 upstream.

There is a very small race window when writing to a
RAID1 such that if a device is marked faulty at exactly the wrong
time, the write-in-progress will not be sent to the device,
but the bitmap (if present) will be updated to say that
the write was sent.

Then if the device turned out to still be usable as was re-added
to the array, the bitmap-based-resync would skip resyncing that
block, possibly leading to corruption.  This would only be a problem
if no further writes were issued to that area of the device (i.e.
that bitmap chunk).

Suitable for any pending -stable kernel.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/raid1.c