public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvme-multipath: put module reference when delayed removal work is canceled
@ 2026-04-15 15:53 John Garry
  2026-04-15 16:21 ` Nilay Shroff
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: John Garry @ 2026-04-15 15:53 UTC (permalink / raw)
  To: hch, kbusch; +Cc: nilay, linux-nvme, John Garry

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.

Signed-off-by: John Garry <john.g.garry@oracle.com>

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 0d623476e36f8..fead3b7cd4bea 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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;
 
-- 
2.43.5



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

* Re: [PATCH] nvme-multipath: put module reference when delayed removal work is canceled
  2026-04-15 15:53 [PATCH] nvme-multipath: put module reference when delayed removal work is canceled John Garry
@ 2026-04-15 16:21 ` Nilay Shroff
  2026-04-15 17:53 ` Chaitanya Kulkarni
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Nilay Shroff @ 2026-04-15 16:21 UTC (permalink / raw)
  To: John Garry, hch, kbusch; +Cc: linux-nvme

On 4/15/26 9:23 PM, John Garry wrote:
> 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.
> 
> Signed-off-by: John Garry <john.g.garry@oracle.com>
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 0d623476e36f8..fead3b7cd4bea 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -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;
>   

Looks good to me:
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>


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

* Re: [PATCH] nvme-multipath: put module reference when delayed removal work is canceled
  2026-04-15 15:53 [PATCH] nvme-multipath: put module reference when delayed removal work is canceled John Garry
  2026-04-15 16:21 ` Nilay Shroff
@ 2026-04-15 17:53 ` Chaitanya Kulkarni
  2026-04-16  5:14 ` Christoph Hellwig
  2026-04-16 22:08 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2026-04-15 17:53 UTC (permalink / raw)
  To: linux-nvme@lists.infradead.org

On 4/15/26 08:53, John Garry wrote:
> 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.
>
> Signed-off-by: John Garry<john.g.garry@oracle.com>


Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>




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

* Re: [PATCH] nvme-multipath: put module reference when delayed removal work is canceled
  2026-04-15 15:53 [PATCH] nvme-multipath: put module reference when delayed removal work is canceled John Garry
  2026-04-15 16:21 ` Nilay Shroff
  2026-04-15 17:53 ` Chaitanya Kulkarni
@ 2026-04-16  5:14 ` Christoph Hellwig
  2026-04-16 22:08 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2026-04-16  5:14 UTC (permalink / raw)
  To: John Garry; +Cc: hch, kbusch, nilay, linux-nvme

On Wed, Apr 15, 2026 at 03:53:58PM +0000, John Garry wrote:
> 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.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>



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

* Re: [PATCH] nvme-multipath: put module reference when delayed removal work is canceled
  2026-04-15 15:53 [PATCH] nvme-multipath: put module reference when delayed removal work is canceled John Garry
                   ` (2 preceding siblings ...)
  2026-04-16  5:14 ` Christoph Hellwig
@ 2026-04-16 22:08 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2026-04-16 22:08 UTC (permalink / raw)
  To: John Garry; +Cc: hch, nilay, linux-nvme

On Wed, Apr 15, 2026 at 03:53:58PM +0000, John Garry wrote:
> 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.

Thanks, applied to nvme-7.1.


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

end of thread, other threads:[~2026-04-16 22:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-15 15:53 [PATCH] nvme-multipath: put module reference when delayed removal work is canceled John Garry
2026-04-15 16:21 ` Nilay Shroff
2026-04-15 17:53 ` Chaitanya Kulkarni
2026-04-16  5:14 ` Christoph Hellwig
2026-04-16 22:08 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox