nvmet: don't try to add ns to p2p map unless it actually uses it
Subsystems (2)
Sagi Grimberg
maintainerPATCH 1/1 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 c6925093d0b2 ("nvmet: Optionally use PCI P2P memory")
Signed-off-by Sagi Grimberg <sagi at grimberg.me>
--- drivers/nvme/target/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/core.c +1 -1
@@ -422,7 +422,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) {
Signature · 1 line
2.17.1
PATCH 1/1 nvmet: don't try to add ns to p2p map unless it actually uses it
Quoted 5 lines · Sagi Grimberg
Even without
CONFIG_P2PDMAthis results in a error print:
nvmet: no peer-to-peer memory is available that's supported by rxe0 and/dev/nullb0Fixes c6925093d0b2 ("nvmet: Optionally use PCI P2P memory")Signed-off-by Sagi Grimberg <sagi at grimberg.me>
Nice Catch. Thanks.
Reviewed-by Logan Gunthorpe <logang at deltatee.com>
Quoted 18 lines
--- drivers/nvme/target/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/nvme/target/core.c +1
-1@@ -422,7 +422,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) {
PATCH 1/1 nvmet: don't try to add ns to p2p map unless it actually uses it
In reply to Sagi GrimbergThanks,
applied to nvme-4.20.