On Wed, Jul 21, 2021 at 05:35:16PM +0200, Christoph Hellwig wrote: > blkdev_get_no_open acquires a reference to the block_device through > the block device inode and then tries to acquire a device model > reference to the gendisk. But at this point the disk migh already > be freed (although the race is free). Fix this by only freeing the > gendisk from the whole device bdevs ->free_inode callback as well. > > Fixes: 22ae8ce8b892 ("block: simplify bdev/disk lookup in blkdev_get") > Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx> -- Ming