md/raid1: fix counting of write targets.
authorNeilBrown <neilb@suse.de>
Tue, 18 May 2010 05:27:13 +0000 (15:27 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 18 May 2010 05:27:13 +0000 (15:27 +1000)
commit964147d5c86d63be79b442c30f3783d49860c078
tree5c1eab8814cab3511c85037dec5220c5c24f91af
parenta64c876fd357906a1f7193723866562ad290654c
md/raid1: fix counting of write targets.

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.

Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c