]> 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)
committerChristoph Hellwig <hch@lst.de>
Mon, 6 Dec 2021 07:52:08 +0000 (08:52 +0100)
commit1900a4da87f902a5ab6d16b0728b7b294528c158
tree0cf050087d3bce5645450164c5c067db35cecebc
parent84c4775f13a756f0e82484fbcf72c6e7ba3d634d
nvme: disable namespace access for unsupported metadata

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>
drivers/nvme/host/core.c