From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org, Yu Kuai <yukuai3@huawei.com>, tj@kernel.org
Subject: Re: [PATCH] block: don't call rq_qos_ops->done_bio if the bio isn't tracked
Date: Fri, 24 Sep 2021 11:04:53 -0600 [thread overview]
Message-ID: <5c4fb487-0230-6fa4-085d-9da745ec536b@kernel.dk> (raw)
In-Reply-To: <20210924110704.1541818-1-ming.lei@redhat.com>
On 9/24/21 5:07 AM, 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.
Applied, thanks.
--
Jens Axboe
prev parent reply other threads:[~2021-09-24 17:04 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
2021-09-24 17:04 ` Jens Axboe [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=5c4fb487-0230-6fa4-085d-9da745ec536b@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=tj@kernel.org \
--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