]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: need_this_block: tidy/fix last condition.
authorNeilBrown <neilb@suse.de>
Mon, 2 Feb 2015 03:03:28 +0000 (14:03 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 3 Feb 2015 21:35:51 +0000 (08:35 +1100)
commit450512fc2f2c1f7f58508e798edb605ef8b4cb42
treeaedfd219092b1c2a4f08a4e743b058d8e87e350c
parent32921d4d65a0c280c1c4ebeab2a762b8d979317e
md/raid5: need_this_block: tidy/fix last condition.

That last condition is unclear and over cautious.

There are two related issues here.

If a partial write is destined for a missing device, then
either RMW or RCW can work.  We must read all the available
block.  Only then can the missing blocks be calculated, and
then the parity update performed.

If RMW is not an option, then there is a complication even
without partial writes.  If we would need to read a missing
device to perform the reconstruction, then we must first read every
block so the missing device data can be computed.
This is the case for RAID6 (Which currently does not support
RMW) and for times when we don't trust the parity (after a crash)
and so are in the process of resyncing it.

So make these two cases more clear and separate, and perform
the relevant tests more  thoroughly.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c