From: Jens Axboe Date: Mon, 23 Aug 2021 19:46:55 +0000 (-0600) Subject: Merge branch 'for-5.15/block' into for-next X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4040a44a97d30426c75cb3921bf99ecbb532f52f;p=users%2Fhch%2Fblock.git Merge branch 'for-5.15/block' into for-next * for-5.15/block: (115 commits) null_blk: add error handling support for add_disk() virtio_blk: add error handling support for add_disk() block: add error handling for device_add_disk / add_disk block: return errors from disk_alloc_events block: return errors from blk_integrity_add block: call blk_register_queue earlier in device_add_disk block: call blk_integrity_add earlier in device_add_disk block: create the bdi link earlier in device_add_disk block: call bdev_add later in device_add_disk block: fold register_disk into device_add_disk block: add a sanity check for a live disk in del_gendisk block: add an explicit ->disk backpointer to the request_queue block: hold a request_queue reference for the lifetime of struct gendisk block: pass a request_queue to __blk_alloc_disk block: remove the minors argument to __alloc_disk_node block: remove alloc_disk and alloc_disk_node block: cleanup the lockdep handling in *alloc_disk sg: do not allocate a gendisk st: do not allocate a gendisk nvme: use blk_mq_alloc_disk ... Signed-off-by: Jens Axboe --- 4040a44a97d30426c75cb3921bf99ecbb532f52f diff --cc drivers/block/virtio_blk.c index afb37aac09e8,63dc121a4c43..57c6ae7debd9 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@@ -839,14 -820,6 +836,14 @@@ static int virtblk_probe(struct virtio_ else blk_size = queue_logical_block_size(q); + if (unlikely(blk_size < SECTOR_SIZE || blk_size > PAGE_SIZE)) { + dev_err(&vdev->dev, + "block size is changed unexpectedly, now is %u\n", + blk_size); + err = -EINVAL; - goto err_cleanup_disk; ++ goto out_cleanup_disk; + } + /* Use topology information if available */ err = virtio_cread_feature(vdev, VIRTIO_BLK_F_TOPOLOGY, struct virtio_blk_config, physical_block_exp,