From: Tejun Heo <tj@kernel.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Yu Kuai <yukuai3@huawei.com>
Subject: Re: [PATCH] block: don't call rq_qos_ops->done_bio if the bio isn't tracked
Date: Fri, 24 Sep 2021 06:57:55 -1000 [thread overview]
Message-ID: <YU4DkxBcYeIRO+NL@slm.duckdns.org> (raw)
In-Reply-To: <20210924110704.1541818-1-ming.lei@redhat.com>
On Fri, Sep 24, 2021 at 07:07:04PM +0800, Ming Lei wrote:
> rq_qos framework is only applied on request based driver, so:
>
> 1) rq_qos_done_bio() needn't to be called for bio based driver
>
> 2) rq_qos_done_bio() needn't to be called for bio which isn't tracked,
> such as bios ended from error handling code.
>
> Especially in bio_endio():
>
> 1) request queue is referred via bio->bi_bdev->bd_disk->queue, which
> may be gone since request queue refcount may not be held in above two
> cases
>
> 2) q->rq_qos may be freed in blk_cleanup_queue() when calling into
> __rq_qos_done_bio()
>
> Fix the potential kernel panic by not calling rq_qos_ops->done_bio if
> the bio isn't tracked. This way is safe because both ioc_rqos_done_bio()
> and blkcg_iolatency_done_bio() are nop if the bio isn't tracked.
>
> Reported-by: Yu Kuai <yukuai3@huawei.com>
> Cc: tj@kernel.org
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
next prev parent reply other threads:[~2021-09-24 16:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 11:07 [PATCH] block: don't call rq_qos_ops->done_bio if the bio isn't tracked Ming Lei
2021-09-24 15:56 ` Christoph Hellwig
2021-09-24 16:57 ` Tejun Heo [this message]
2021-09-24 17:04 ` Jens Axboe
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=YU4DkxBcYeIRO+NL@slm.duckdns.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=yukuai3@huawei.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