linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Yuwei Guan <Yuwei.Guan@zeekrlife.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] blk-mq: initialize csd/fifo_time before use
Date: Mon, 10 Oct 2022 00:39:43 -0700	[thread overview]
Message-ID: <Y0PMPw3pMFWZ11id@infradead.org> (raw)
In-Reply-To: <20221010071916.1075-1-Yuwei.Guan@zeekrlife.com>

On Mon, Oct 10, 2022 at 03:19:16PM +0800, Yuwei Guan wrote:
> csd/fifo_time need to be initialized before use again,
> otherwise, it will keep the last tag value.
> 
> Signed-off-by: Yuwei Guan <Yuwei.Guan@zeekrlife.com>
> ---
>  block/blk-mq.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 8070b6c10e8d..f55d41f1d150 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -383,6 +383,9 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,
>         rq->end_io = NULL;
>         rq->end_io_data = NULL;
> 
> +       /* initialize csd/fifo_time before use */
> +       memset(&rq->csd, 0x0, sizeof(rq->csd));

This is a rather unusual spelling of 0.  But more importantly what
problem with reuse do you actually see here? The csd is always
initialized before use as it can't otherwise work.  fifo_time
also appears to, but the code is a bit convoluted.


      reply	other threads:[~2022-10-10  7:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10  7:19 [PATCH] blk-mq: initialize csd/fifo_time before use Yuwei Guan
2022-10-10  7:39 ` Christoph Hellwig [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=Y0PMPw3pMFWZ11id@infradead.org \
    --to=hch@infradead.org \
    --cc=Yuwei.Guan@zeekrlife.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).