From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Sven Schnelle <svens@linux.ibm.com>
Subject: Re: [PATCH] scsi: core: cleanup request queue before releasing gendisk
Date: Wed, 15 Sep 2021 15:40:08 +0200 [thread overview]
Message-ID: <20210915134008.GA13933@lst.de> (raw)
In-Reply-To: <20210915092547.990285-1-ming.lei@redhat.com>
On Wed, Sep 15, 2021 at 05:25:47PM +0800, Ming Lei wrote:
> gendisk instance has to be released after request queue is cleaned up
> because bdi is referred from gendisk since commit edb0872f44ec ("block:
> move the bdi from the request_queue to the gendisk").
>
> For sd and sr, gendisk can be removed in the release handler(sd_remove/
> sr_remove) of sdev->sdev_gendev, which is triggered in device_del(sdev->sdev_gendev)
> in __scsi_remove_device(), when the request queue isn't cleaned up yet.
>
> So kernel oops could be triggered when referring bdi via gendisk.
>
> Fix the issue by moving blk_cleanup_queue() into sd_remove() and
> sr_remove().
This looks like a bit of a bandaid to me. I think the proper fix
is to move the parts of blk_cleanup_queue that need a disk or bdi
to del_gendisk.
next prev parent reply other threads:[~2021-09-15 13:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-15 9:25 [PATCH] scsi: core: cleanup request queue before releasing gendisk Ming Lei
2021-09-15 13:40 ` Christoph Hellwig [this message]
2021-09-16 1:36 ` Ming Lei
2021-09-16 10:14 ` Christoph Hellwig
2021-09-16 12:38 ` Ming Lei
2021-09-16 14:20 ` Christoph Hellwig
2021-09-17 3:39 ` Ming Lei
2021-09-17 6:53 ` Christoph Hellwig
2021-09-17 7:41 ` Ming Lei
2021-09-17 7:56 ` Christoph Hellwig
2021-09-17 8:32 ` Ming Lei
2021-09-17 12:37 ` Christoph Hellwig
2021-09-17 13:41 ` Ming Lei
2021-09-15 13:40 ` Christoph Hellwig
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=20210915134008.GA13933@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=svens@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.