]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: disable namespace access for unsupported metadata
authorKeith Busch <kbusch@kernel.org>
Tue, 30 Nov 2021 16:14:54 +0000 (08:14 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:00 +0000 (14:24 +0200)
commitf5163325c284a6d51f168e6fc5291c3c669db25e
tree75879f875f58d8e40089fbe68e178ae610d8c99e
parent5bf959b8cf2e98cf5c6ff1377d602147bafc6e0c
nvme: disable namespace access for unsupported metadata

[ Upstream commit df5cc1bb973848753bc40941b27cc3688a809c19 ]

The only fabrics target that supports metadata handling through the
separate integrity buffer is RDMA. It is currently usable only if the
size is 8B per block and formatted for protection information. If an
rdma target were to export a namespace with a different format (ex:
4k+64B), the driver will not be able to submit valid read/write commands
for that namespace.

Suppress setting the metadata feature in the namespace so that the
gendisk capacity will be set to 0. This will prevent read/write access
through the block stack, but will continue to allow ioctl passthrough
commands.

Cc: Max Gurtovoy <mgurtovoy@nvidia.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c