All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Small rework of nvme_init/uninit_ctrl
@ 2017-10-18 11:07 Sagi Grimberg
  2017-10-18 11:07 ` [PATCH 1/5] nvme-core: Make nvme_init/uninit_ctrl setup/teardown symmetric Sagi Grimberg
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Sagi Grimberg @ 2017-10-18 11:07 UTC (permalink / raw)


The fact that nvme_free_ctrl cleans up after nvme_init_ctrl istead
of nvme_uninit_ctrl is causing us to rely on non-trivial ctrl
refcounting inside the fabrics ->create_ctrl handlers.

Instead, have nvme_uninit_ctrl cleanup nvme_init_ctrl and fixup
rdma and loop ->create_ctrl error sequence to be sane.

This will also help when we will consolidate more code to our
common nvme-core.

nvme-pci does not seem to rely on the former behavior and thus does
not need to be fixed afaict. It seems that nvme-fc always prefers to
use the ctrl refcount scheme to cleanup the controller (also from
->create_ctrl) but it always calls nvme_uninit_ctrl before the
final put so looks like it should work as well.

Tested rdma, loop and pci but didn't test fc.

Roy Shterman (5):
  nvme-core: Make nvme_init/uninit_ctrl setup/teardown symmetric
  nvme-rdma: rework create_ctrl error flow
  nvme-rdma: remove redundant check if the ctrl is in the ctrl when
    freeing it
  nvme-loop: rework create_ctrl error flow
  nvme-loop: remove redundant check if the ctrl is in the ctrl when
    freeing it

 drivers/nvme/host/core.c   | 11 +++++------
 drivers/nvme/host/rdma.c   | 28 +++++++++++-----------------
 drivers/nvme/target/loop.c | 30 ++++++++++++------------------
 3 files changed, 28 insertions(+), 41 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-10-23 15:25 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-18 11:07 [PATCH 0/5] Small rework of nvme_init/uninit_ctrl Sagi Grimberg
2017-10-18 11:07 ` [PATCH 1/5] nvme-core: Make nvme_init/uninit_ctrl setup/teardown symmetric Sagi Grimberg
2017-10-18 15:08   ` Keith Busch
2017-10-18 15:29     ` Sagi Grimberg
2017-10-18 16:21       ` Keith Busch
2017-10-18 20:17       ` Keith Busch
2017-10-19 15:19         ` Sagi Grimberg
2017-10-19 15:29   ` Christoph Hellwig
2017-10-19 15:31     ` Sagi Grimberg
2017-10-22 11:11       ` Sagi Grimberg
2017-10-23 14:31         ` Christoph Hellwig
2017-10-18 11:07 ` [PATCH 2/5] nvme-rdma: rework create_ctrl error flow Sagi Grimberg
2017-10-23 14:32   ` Christoph Hellwig
2017-10-23 15:25     ` Sagi Grimberg
2017-10-18 11:07 ` [PATCH 3/5] nvme-rdma: remove redundant check if the ctrl is in the ctrl when freeing it Sagi Grimberg
2017-10-18 11:07 ` [PATCH 4/5] nvme-loop: rework create_ctrl error flow Sagi Grimberg
2017-10-18 11:07 ` [PATCH 5/5] nvme-loop: remove redundant check if the ctrl is in the ctrl when freeing it Sagi Grimberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.