linux-stable/drivers/nvme/target
Evan Burgess 536ecccbaf nvmet: configfs: use ctrl->instance to track passthru subsystems
To prevent enabling more than one passthrough subsystem per NVMe
controller, passthru.c maintains an xarray indexed by cntlid values.
Passthrough for a given nvmet subsystem cannot be enabled by configfs
if the subsystem's passthru_ctrl->cntlid value is already accounted
for in the xarray.

However, according to the NVMe spec (rev 2.0c, p.145), "The Controller
ID (CNTLID) value returned in the Identify Controller data structure
may be used to uniquely identify a controller within an NVM subsystem,"
meaning that cntlid values are not guaranteed to be globally unique
across multiple subsystems. Instead, the cntlid only uniquely
identifies multiple controllers _within_ a subsystem.

As a result, multiple unique & valid NVMe targets can be blocked from
enabling passthrough at the same time if their controllers share cntlid
values, a behavior allowed by the spec. Fix this by indexing the xarray
with passthru_ctrl->instance values, which are allocated per
controller by IDA and thus should be truly unique.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Evan Burgess <evan.burgess@seagate.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
2023-12-19 09:10:22 -08:00
..
admin-cmd.c nvmet: remove nvmet_req_cns_error_complete 2023-04-13 08:55:05 +02:00
auth.c nvme-auth: use transformed key size to create resp 2023-10-17 13:57:54 -07:00
configfs.c nvmet: allow identical cntlid_min and cntlid_max settings 2023-12-13 14:53:33 -08:00
core.c nvmet: remove cntlid_min and cntlid_max check in nvmet_alloc_ctrl 2023-12-13 14:53:33 -08:00
discovery.c nvme: move from strlcpy with unused retval to strscpy 2022-09-19 11:33:53 +02:00
fabrics-cmd-auth.c nvme-auth: always set valid seq_num in dhchap reply 2023-11-06 08:34:20 -08:00
fabrics-cmd.c nvmet: nul-terminate the NQNs passed in the connect command 2023-11-20 09:25:33 -08:00
fc.c nvmet-fc: Annotate struct nvmet_fc_tgt_queue with __counted_by 2023-10-05 09:29:04 -07:00
fcloop.c nvmet-fcloop: Do not wait on completion when unregister fails 2023-06-12 10:37:00 -07:00
io-cmd-bdev.c nvmet: Convert to bdev_open_by_path() 2023-10-28 13:29:18 +02:00
io-cmd-file.c nvmet: use bvec_set_page to initialize bvecs 2023-02-03 08:20:55 -07:00
Kconfig nvme: target: fix Kconfig select statements 2023-11-22 18:40:14 -07:00
loop.c nvme-loop: always quiesce and cancel commands before destroying admin q 2023-11-06 09:00:15 -08:00
Makefile nvmet: implement basic In-Band Authentication 2022-08-02 17:14:49 -06:00
nvmet.h for-6.7/block-2023-10-30 2023-11-01 12:30:07 -10:00
passthru.c nvmet: configfs: use ctrl->instance to track passthru subsystems 2023-12-19 09:10:22 -08:00
rdma.c RDMA/core: introduce ib_dma_pci_p2p_dma_supported() 2022-07-26 07:28:07 -04:00
tcp.c nvmet-tcp: always initialize tls_handshake_tmo_work 2023-11-20 09:25:33 -08:00
trace.c nvmet: add set feature tracing support 2021-08-16 14:42:23 +02:00
trace.h nvmet: use min of device_path and disk len 2021-02-10 16:38:05 +01:00
zns.c nvmet: rename nvmet_execute_identify_cns_cs_ns 2023-04-13 08:55:04 +02:00