From: Shaohua Li <shli@kernel.org>
To: Zhengyuan Liu <liuzhengyuan@kylinos.cn>
Cc: shli@fb.com, songliubraving@fb.com, neilb@suse.com,
linux-raid@vger.kernel.org, liuyun01@kylinos.cn
Subject: Re: [PATCH 1/2] raid5-cache: add another check conditon before replaying one stripe
Date: Tue, 29 Nov 2016 11:53:28 -0800 [thread overview]
Message-ID: <20161129195328.yanqnkoxfzmrvohp@kernel.org> (raw)
In-Reply-To: <1480129034-14700-1-git-send-email-liuzhengyuan@kylinos.cn>
On Sat, Nov 26, 2016 at 10:57:13AM +0800, Zhengyuan Liu wrote:
> 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.
applied, thanks!
> 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
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2016-11-29 19:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Shaohua Li [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161129195328.yanqnkoxfzmrvohp@kernel.org \
--to=shli@kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=liuyun01@kylinos.cn \
--cc=liuzhengyuan@kylinos.cn \
--cc=neilb@suse.com \
--cc=shli@fb.com \
--cc=songliubraving@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox