[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YPZ81HsYnyxBpQwu@T590>
Date: Tue, 20 Jul 2021 15:35:48 +0800
From: Ming Lei <ming.lei@...hat.com>
To: John Garry <john.garry@...wei.com>
Cc: axboe@...nel.dk, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
kashyap.desai@...adcom.com, hare@...e.de
Subject: Re: [PATCH 1/9] blk-mq: Change rqs check in blk_mq_free_rqs()
On Wed, Jul 14, 2021 at 11:06:27PM +0800, John Garry wrote:
> The original code in commit 24d2f90309b23 ("blk-mq: split out tag
> initialization, support shared tags") would check tags->rqs is non-NULL and
> then dereference tags->rqs[].
>
> Then in commit 2af8cbe30531 ("blk-mq: split tag ->rqs[] into two"), we
> started to dereference tags->static_rqs[], but continued to check non-NULL
> tags->rqs.
>
> Check tags->static_rqs as non-NULL instead, which is more logical.
>
> Signed-off-by: John Garry <john.garry@...wei.com>
> ---
> block/blk-mq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 2c4ac51e54eb..ae28f470893c 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -2348,7 +2348,7 @@ void blk_mq_free_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags,
> {
> struct page *page;
>
> - if (tags->rqs && set->ops->exit_request) {
> + if (tags->static_rqs && set->ops->exit_request) {
Yeah, it is reasonable to check ->static_rqs since both ->init_request()
and ->exit_request() operate on request from ->static_rqs[]:
Reviewed-by: Ming Lei <ming.lei@...hat.com>
--
Ming
Powered by blists - more mailing lists