aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-07-26 21:00:36 -0400
committerNeilBrown <neilb@suse.de>2011-07-26 21:00:36 -0400
commit5d35e09cae47bbae2739f432658860680de21866 (patch)
tree619a548f43403883f394062f3397de2ca6eb6c4a /drivers
parentc5a3100062cf277d3edd4e6f4a1f1e403524b464 (diff)
md/raid5: rearrange a test in fetch_block6.
Next patch will unite fetch_block5 and fetch_block6. First I want to make the differences a little more clear. For RAID6 if we are writing at all and there is a failed device, then we need to load or compute every block so we can do a reconstruct-write. This case isn't needed for RAID5 - we will do a read-modify-write in that case. So make that test a separate test in fetch_block6 rather than merged with two other tests. Make a similar change in fetch_block5 so the one bit that is not needed for RAID6 is clearly separate. Signed-off-by: NeilBrown <neilb@suse.de> Reviewed-by: Namhyung Kim <namhyung@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/raid5.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 74a575bbd25c..a3d7cd96cfb7 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2326,9 +2326,8 @@ static int fetch_block5(struct stripe_head *sh, struct stripe_head_state *s,
2326 (dev->toread || 2326 (dev->toread ||
2327 (dev->towrite && !test_bit(R5_OVERWRITE, &dev->flags)) || 2327 (dev->towrite && !test_bit(R5_OVERWRITE, &dev->flags)) ||
2328 s->syncing || s->expanding || 2328 s->syncing || s->expanding ||
2329 (s->failed && 2329 (s->failed && failed_dev->toread) ||
2330 (failed_dev->toread || 2330 (s->failed && failed_dev->towrite &&
2331 (failed_dev->towrite &&
2332 !test_bit(R5_OVERWRITE, &failed_dev->flags)))))) { 2331 !test_bit(R5_OVERWRITE, &failed_dev->flags)))))) {
2333 /* We would like to get this block, possibly by computing it, 2332 /* We would like to get this block, possibly by computing it,
2334 * otherwise read it if the backing disk is insync 2333 * otherwise read it if the backing disk is insync
@@ -2399,10 +2398,9 @@ static int fetch_block6(struct stripe_head *sh, struct stripe_head_state *s,
2399 (dev->toread || 2398 (dev->toread ||
2400 (dev->towrite && !test_bit(R5_OVERWRITE, &dev->flags)) || 2399 (dev->towrite && !test_bit(R5_OVERWRITE, &dev->flags)) ||
2401 s->syncing || s->expanding || 2400 s->syncing || s->expanding ||
2402 (s->failed >= 1 && 2401 (s->failed >= 1 && fdev[0]->toread) ||
2403 (fdev[0]->toread || s->to_write)) || 2402 (s->failed >= 2 && fdev[1]->toread) ||
2404 (s->failed >= 2 && 2403 (s->failed && s->to_write)) {
2405 (fdev[1]->toread || s->to_write)))) {
2406 /* we would like to get this block, possibly by computing it, 2404 /* we would like to get this block, possibly by computing it,
2407 * otherwise read it if the backing disk is insync 2405 * otherwise read it if the backing disk is insync
2408 */ 2406 */