Skip to content

Commit 3f150f0

Browse files
johnpgarrykeithbusch
authored andcommitted
nvme-multipath: put module reference when delayed removal work is canceled
The delayed disk removal work is canceled when a NS (re)appears. However, we do not put the module reference grabbed in nvme_mpath_remove_disk(), so fix that. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Signed-off-by: John Garry <john.g.garry@oracle.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 2092581 commit 3f150f0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/nvme/host/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4083,7 +4083,8 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
40834083
mutex_unlock(&ctrl->subsys->lock);
40844084

40854085
#ifdef CONFIG_NVME_MULTIPATH
4086-
cancel_delayed_work(&head->remove_work);
4086+
if (cancel_delayed_work(&head->remove_work))
4087+
module_put(THIS_MODULE);
40874088
#endif
40884089
return 0;
40894090

0 commit comments

Comments
 (0)