aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/pci.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2016-02-10 10:03:29 -0800
committerJens Axboe <axboe@fb.com>2016-02-10 14:22:32 -0700
commite439bb12e75c2807029853493fa787c6d70c763a (patch)
tree8d3573e86cdc7116a40f21242f481ce6e80dbc63 /drivers/nvme/host/pci.c
parentnvme: Log the ctrl device name instead of the underlying pci device name (diff)
downloadlinux-dev-e439bb12e75c2807029853493fa787c6d70c763a.tar.xz
linux-dev-e439bb12e75c2807029853493fa787c6d70c763a.zip
nvme/host: reference the fabric module for each bdev open callout
We don't want to be able to unload the fabric driver when we have openened referenced to our namespaces. Thus, for each nvme_open we take a reference on the fabric driver and put it in nvme_release. This behavior is consistent with the scsi model. This resolves the panic when unloading a fabric module with mpath holders. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ian Bakshan <ianb@mellanox.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Ming Lin <ming.l@ssi.samsung.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/pci.c')
-rw-r--r--drivers/nvme/host/pci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index f2f55b504cf2..cb303ac91b9d 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2036,6 +2036,7 @@ static int nvme_pci_reset_ctrl(struct nvme_ctrl *ctrl)
}
static const struct nvme_ctrl_ops nvme_pci_ctrl_ops = {
+ .module = THIS_MODULE,
.reg_read32 = nvme_pci_reg_read32,
.reg_write32 = nvme_pci_reg_write32,
.reg_read64 = nvme_pci_reg_read64,