linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk-mq: initialize csd/fifo_time before use
@ 2022-10-10  7:19 Yuwei Guan
  2022-10-10  7:39 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Yuwei Guan @ 2022-10-10  7:19 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, Yuwei.Guan

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));
+
        blk_crypto_rq_set_defaults(rq);
        INIT_LIST_HEAD(&rq->queuelist);
        /* tag was already set */
--
2.34.1

免责声明:本邮件所包含信息发给指定个人或机构,邮件可能包含保密或专属信息。未经接收者许可,不得阅读、转发或传播邮件内容,或根据邮件内容采取任何相关行动。如果错误地收到了此邮件,请与收件人联系并自行删除邮件内容。

Disclaimer:The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error , please contact the sender and delete the material from any computer .

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

* Re: [PATCH] blk-mq: initialize csd/fifo_time before use
  2022-10-10  7:19 [PATCH] blk-mq: initialize csd/fifo_time before use Yuwei Guan
@ 2022-10-10  7:39 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2022-10-10  7:39 UTC (permalink / raw)
  To: Yuwei Guan; +Cc: axboe, linux-block, linux-kernel

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.


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

end of thread, other threads:[~2022-10-10  7:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10  7:19 [PATCH] blk-mq: initialize csd/fifo_time before use Yuwei Guan
2022-10-10  7:39 ` Christoph Hellwig

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).