Skip to content

Commit a536b49

Browse files
Max GurtovoyChristoph Hellwig
authored andcommitted
nvmet: fix error flow during ns enable
In case we fail to enable p2pmem on the current namespace, disable the backing store device before exiting. Cc: Stephen Bates <sbates@raithlin.com> Signed-off-by: Max Gurtovoy <maxg@mellanox.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 02db995 commit a536b49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nvme/target/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ int nvmet_ns_enable(struct nvmet_ns *ns)
509509

510510
ret = nvmet_p2pmem_ns_enable(ns);
511511
if (ret)
512-
goto out_unlock;
512+
goto out_dev_disable;
513513

514514
list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry)
515515
nvmet_p2pmem_ns_add_p2p(ctrl, ns);
@@ -550,7 +550,7 @@ int nvmet_ns_enable(struct nvmet_ns *ns)
550550
out_dev_put:
551551
list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry)
552552
pci_dev_put(radix_tree_delete(&ctrl->p2p_ns_map, ns->nsid));
553-
553+
out_dev_disable:
554554
nvmet_ns_dev_disable(ns);
555555
goto out_unlock;
556556
}

0 commit comments

Comments
 (0)