diff options
-rw-r--r-- | drivers/md/raid5.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index baea94f0670a..0fb988556eea 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3490,40 +3490,6 @@ static void handle_stripe(struct stripe_head *sh) | |||
3490 | handle_failed_sync(conf, sh, &s); | 3490 | handle_failed_sync(conf, sh, &s); |
3491 | } | 3491 | } |
3492 | 3492 | ||
3493 | /* | ||
3494 | * might be able to return some write requests if the parity blocks | ||
3495 | * are safe, or on a failed drive | ||
3496 | */ | ||
3497 | pdev = &sh->dev[sh->pd_idx]; | ||
3498 | s.p_failed = (s.failed >= 1 && s.failed_num[0] == sh->pd_idx) | ||
3499 | || (s.failed >= 2 && s.failed_num[1] == sh->pd_idx); | ||
3500 | qdev = &sh->dev[sh->qd_idx]; | ||
3501 | s.q_failed = (s.failed >= 1 && s.failed_num[0] == sh->qd_idx) | ||
3502 | || (s.failed >= 2 && s.failed_num[1] == sh->qd_idx) | ||
3503 | || conf->level < 6; | ||
3504 | |||
3505 | if (s.written && | ||
3506 | (s.p_failed || ((test_bit(R5_Insync, &pdev->flags) | ||
3507 | && !test_bit(R5_LOCKED, &pdev->flags) | ||
3508 | && (test_bit(R5_UPTODATE, &pdev->flags) || | ||
3509 | test_bit(R5_Discard, &pdev->flags))))) && | ||
3510 | (s.q_failed || ((test_bit(R5_Insync, &qdev->flags) | ||
3511 | && !test_bit(R5_LOCKED, &qdev->flags) | ||
3512 | && (test_bit(R5_UPTODATE, &qdev->flags) || | ||
3513 | test_bit(R5_Discard, &qdev->flags)))))) | ||
3514 | handle_stripe_clean_event(conf, sh, disks, &s.return_bi); | ||
3515 | |||
3516 | /* Now we might consider reading some blocks, either to check/generate | ||
3517 | * parity, or to satisfy requests | ||
3518 | * or to load a block that is being partially written. | ||
3519 | */ | ||
3520 | if (s.to_read || s.non_overwrite | ||
3521 | || (conf->level == 6 && s.to_write && s.failed) | ||
3522 | || (s.syncing && (s.uptodate + s.compute < disks)) | ||
3523 | || s.replacing | ||
3524 | || s.expanding) | ||
3525 | handle_stripe_fill(sh, &s, disks); | ||
3526 | |||
3527 | /* Now we check to see if any write operations have recently | 3493 | /* Now we check to see if any write operations have recently |
3528 | * completed | 3494 | * completed |
3529 | */ | 3495 | */ |
@@ -3561,6 +3527,40 @@ static void handle_stripe(struct stripe_head *sh) | |||
3561 | s.dec_preread_active = 1; | 3527 | s.dec_preread_active = 1; |
3562 | } | 3528 | } |
3563 | 3529 | ||
3530 | /* | ||
3531 | * might be able to return some write requests if the parity blocks | ||
3532 | * are safe, or on a failed drive | ||
3533 | */ | ||
3534 | pdev = &sh->dev[sh->pd_idx]; | ||
3535 | s.p_failed = (s.failed >= 1 && s.failed_num[0] == sh->pd_idx) | ||
3536 | || (s.failed >= 2 && s.failed_num[1] == sh->pd_idx); | ||
3537 | qdev = &sh->dev[sh->qd_idx]; | ||
3538 | s.q_failed = (s.failed >= 1 && s.failed_num[0] == sh->qd_idx) | ||
3539 | || (s.failed >= 2 && s.failed_num[1] == sh->qd_idx) | ||
3540 | || conf->level < 6; | ||
3541 | |||
3542 | if (s.written && | ||
3543 | (s.p_failed || ((test_bit(R5_Insync, &pdev->flags) | ||
3544 | && !test_bit(R5_LOCKED, &pdev->flags) | ||
3545 | && (test_bit(R5_UPTODATE, &pdev->flags) || | ||
3546 | test_bit(R5_Discard, &pdev->flags))))) && | ||
3547 | (s.q_failed || ((test_bit(R5_Insync, &qdev->flags) | ||
3548 | && !test_bit(R5_LOCKED, &qdev->flags) | ||
3549 | && (test_bit(R5_UPTODATE, &qdev->flags) || | ||
3550 | test_bit(R5_Discard, &qdev->flags)))))) | ||
3551 | handle_stripe_clean_event(conf, sh, disks, &s.return_bi); | ||
3552 | |||
3553 | /* Now we might consider reading some blocks, either to check/generate | ||
3554 | * parity, or to satisfy requests | ||
3555 | * or to load a block that is being partially written. | ||
3556 | */ | ||
3557 | if (s.to_read || s.non_overwrite | ||
3558 | || (conf->level == 6 && s.to_write && s.failed) | ||
3559 | || (s.syncing && (s.uptodate + s.compute < disks)) | ||
3560 | || s.replacing | ||
3561 | || s.expanding) | ||
3562 | handle_stripe_fill(sh, &s, disks); | ||
3563 | |||
3564 | /* Now to consider new write requests and what else, if anything | 3564 | /* Now to consider new write requests and what else, if anything |
3565 | * should be read. We do not handle new writes when: | 3565 | * should be read. We do not handle new writes when: |
3566 | * 1/ A 'write' operation (copy+xor) is already in flight. | 3566 | * 1/ A 'write' operation (copy+xor) is already in flight. |