Commit 3f150f0f authored by John Garry's avatar John Garry Committed by Keith Busch
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarNilay Shroff <nilay@linux.ibm.com>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: default avatarJohn Garry <john.g.garry@oracle.com>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 20925812
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4083,7 +4083,8 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
	mutex_unlock(&ctrl->subsys->lock);

#ifdef CONFIG_NVME_MULTIPATH
	cancel_delayed_work(&head->remove_work);
	if (cancel_delayed_work(&head->remove_work))
		module_put(THIS_MODULE);
#endif
	return 0;