Skip to content

Commit

Permalink
nvmet: don't try to add ns to p2p map unless it actually uses it
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Logan Gunthorpe <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
sagigrimberg authored and axboe committed Nov 9, 2018
1 parent bb39ba6 commit 21d3bbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/target/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ static void nvmet_p2pmem_ns_add_p2p(struct nvmet_ctrl *ctrl,
struct pci_dev *p2p_dev;
int ret;

if (!ctrl->p2p_client)
if (!ctrl->p2p_client || !ns->use_p2pmem)
return;

if (ns->p2p_dev) {
Expand Down

0 comments on commit 21d3bbd

Please sign in to comment.