diff options
author | Dmitry Fomichev <dmitry.fomichev@wdc.com> | 2023-03-30 23:49:53 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-04-04 17:01:57 +0200 |
commit | 10805eb5d6d15fd4f61b05cc7aa269e12ab99848 (patch) | |
tree | 29be4742097dbbe1e4e79b2b067165b1a5955ecf /fs/crypto | |
parent | virtio-blk: fix to match virtio spec (diff) | |
download | linux-10805eb5d6d15fd4f61b05cc7aa269e12ab99848.tar.xz linux-10805eb5d6d15fd4f61b05cc7aa269e12ab99848.zip |
virtio-blk: fix ZBD probe in kernels without ZBD support
When the kernel is built without support for zoned block devices,
virtio-blk probe needs to error out any host-managed device scans
to prevent such devices from appearing in the system as non-zoned.
The current virtio-blk code simply bypasses all ZBD checks if
CONFIG_BLK_DEV_ZONED is not defined and this leads to host-managed
block devices being presented as non-zoned in the OS. This is one of
the main problems this patch series is aimed to fix.
In this patch, make VIRTIO_BLK_F_ZONED feature defined even when
CONFIG_BLK_DEV_ZONED is not. This change makes the code compliant with
the voted revision of virtio-blk ZBD spec. Modify the probe code to
look at the situation when VIRTIO_BLK_F_ZONED is negotiated in a kernel
that is built without ZBD support. In this case, the code checks
the zoned model of the device and fails the probe is the device
is host-managed.
The patch also adds the comment to clarify that the call to perform
the zoned device probe is correctly placed after virtio_device ready().
Fixes: 95bfec41bd3d ("virtio-blk: add support for zoned block devices")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Message-Id: <20230330214953.1088216-3-dmitry.fomichev@wdc.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'fs/crypto')
0 files changed, 0 insertions, 0 deletions