diff options
author | Ming Lei <ming.lei@redhat.com> | 2021-09-20 09:58:23 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-09-23 18:20:32 -0700 |
commit | 4f90e6f3be1420ff85e3bed71a5d3cede9a23ccd (patch) | |
tree | 9a328f1fcc204e3fb517fe75c4c8676ac5deb08a /fs | |
parent | b07fd791e80afa5f6b7af005a5515fda283b3d42 (diff) |
scsi: core: cleanup request queue before releasing gendisk
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().
Fixes: edb0872f44ec ("block: move the bdi from the request_queue to the gendisk")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions