diff options
author | Zhengyuan Liu <liuzhengyuan@kylinos.cn> | 2016-11-26 05:57:13 +0300 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-11-29 22:56:20 +0300 |
commit | f7b7bee75e06cbdce864f7b313ac05555e7eff6b (patch) | |
tree | 11e926af1490da8eacc17c40b9b771c6ee3efe48 /drivers/md | |
parent | d3014e21e18bfaf5b22144a45c399c8eb21aaba9 (diff) | |
download | linux-f7b7bee75e06cbdce864f7b313ac05555e7eff6b.tar.xz |
raid5-cache: add another check conditon before replaying one stripe
New stripe that was just allocated has no STRIPE_R5C_CACHING state too,
add this check condition could avoid unnecessary replaying for empty stripe.
r5l_recovery_replay_one_stripe would reset stripe for any case, delete it
to make code more clean.
Signed-off-by: Zhengyuan Liu <liuzhengyuan@kylinos.cn>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid5-cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 874749dc7648..1ff3859bbcc3 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -1887,9 +1887,9 @@ r5c_recovery_analyze_meta_block(struct r5l_log *log, } if (payload->header.type == R5LOG_PAYLOAD_DATA) { - if (!test_bit(STRIPE_R5C_CACHING, &sh->state)) { + if (!test_bit(STRIPE_R5C_CACHING, &sh->state) && + test_bit(R5_Wantwrite, &sh->dev[sh->pd_idx].flags)) { r5l_recovery_replay_one_stripe(conf, sh, ctx); - r5l_recovery_reset_stripe(sh); sh->log_start = ctx->pos; list_move_tail(&sh->lru, cached_stripe_list); } |