Skip to content

Commit 21d3bbd

Browse files
sagigrimbergaxboe
authored andcommitted
nvmet: don't try to add ns to p2p map unless it actually uses it
Even without CONFIG_P2PDMA this results in a error print: nvmet: no peer-to-peer memory is available that's supported by rxe0 and /dev/nullb0 Fixes: c692509 ("nvmet: Optionally use PCI P2P memory") Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent bb39ba6 commit 21d3bbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/target/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ static void nvmet_p2pmem_ns_add_p2p(struct nvmet_ctrl *ctrl,
420420
struct pci_dev *p2p_dev;
421421
int ret;
422422

423-
if (!ctrl->p2p_client)
423+
if (!ctrl->p2p_client || !ns->use_p2pmem)
424424
return;
425425

426426
if (ns->p2p_dev) {

0 commit comments

Comments
 (0)