Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/2] raid5-cache: add another check conditon before replaying one stripe
@ 2016-11-26  2:57 Zhengyuan Liu
  2016-11-26  2:57 ` [PATCH 2/2] raid5-cache: don't set STRIPE_R5C_PARTIAL_STRIPE flag while load stripe into cache Zhengyuan Liu
  2016-11-29 19:53 ` [PATCH 1/2] raid5-cache: add another check conditon before replaying one stripe Shaohua Li
  0 siblings, 2 replies; 5+ messages in thread
From: Zhengyuan Liu @ 2016-11-26  2:57 UTC (permalink / raw)
  To: shli, songliubraving; +Cc: neilb, linux-raid, liuyun01

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>
---
 drivers/md/raid5-cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index 5f817bd..9911164 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);
 			}
-- 
2.7.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-29 19:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-26  2:57 [PATCH 1/2] raid5-cache: add another check conditon before replaying one stripe Zhengyuan Liu
2016-11-26  2:57 ` [PATCH 2/2] raid5-cache: don't set STRIPE_R5C_PARTIAL_STRIPE flag while load stripe into cache Zhengyuan Liu
2016-11-27 23:49   ` Song Liu
2016-11-29 19:55   ` Shaohua Li
2016-11-29 19:53 ` [PATCH 1/2] raid5-cache: add another check conditon before replaying one stripe Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox