Re: [PATCH] blk-mq: initialize csd/fifo_time before use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
> ---
>  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.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux