linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized
@ 2025-07-25 20:50 Mohamed Khalfella
  2025-07-28  7:51 ` Daniel Wagner
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Mohamed Khalfella @ 2025-07-25 20:50 UTC (permalink / raw)
  To: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, Keith Busch
  Cc: Mohamed Khalfella, Hannes Reinecke, Daniel Wagner, Randy Jennings,
	linux-nvme, linux-kernel

During nvme target initialization discovery subsystem is initialized
before "nvmet" debugfs directory is created. This results in discovery
subsystem debugfs directory to be created in debugfs root directory.

nvmet_init() ->
  nvmet_init_discovery() ->
    nvmet_subsys_alloc() ->
      nvmet_debugfs_subsys_setup()

In other words, the codepath above is exeucted before nvmet_debugfs is
created. We get /sys/kernel/debug/nqn.2014-08.org.nvmexpress.discovery
instead of /sys/kernel/debug/nvmet/nqn.2014-08.org.nvmexpress.discovery.
Move nvmet_init_discovery() call after nvmet_init_debugfs() to fix it.

Fixes: 649fd41420a8 ("nvmet: add debugfs support")
Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
---
 drivers/nvme/target/core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 175c5b6d4dd5..b6247e4afc9c 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -1962,24 +1962,24 @@ static int __init nvmet_init(void)
 	if (!nvmet_wq)
 		goto out_free_buffered_work_queue;
 
-	error = nvmet_init_discovery();
+	error = nvmet_init_debugfs();
 	if (error)
 		goto out_free_nvmet_work_queue;
 
-	error = nvmet_init_debugfs();
+	error = nvmet_init_discovery();
 	if (error)
-		goto out_exit_discovery;
+		goto out_exit_debugfs;
 
 	error = nvmet_init_configfs();
 	if (error)
-		goto out_exit_debugfs;
+		goto out_exit_discovery;
 
 	return 0;
 
-out_exit_debugfs:
-	nvmet_exit_debugfs();
 out_exit_discovery:
 	nvmet_exit_discovery();
+out_exit_debugfs:
+	nvmet_exit_debugfs();
 out_free_nvmet_work_queue:
 	destroy_workqueue(nvmet_wq);
 out_free_buffered_work_queue:
-- 
2.49.1



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

* Re: [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized
  2025-07-25 20:50 [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized Mohamed Khalfella
@ 2025-07-28  7:51 ` Daniel Wagner
  2025-07-28 17:51 ` Chaitanya Kulkarni
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2025-07-28  7:51 UTC (permalink / raw)
  To: Mohamed Khalfella
  Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, Keith Busch,
	Hannes Reinecke, Randy Jennings, linux-nvme, linux-kernel

On Fri, Jul 25, 2025 at 01:50:05PM -0700, Mohamed Khalfella wrote:
> During nvme target initialization discovery subsystem is initialized
> before "nvmet" debugfs directory is created. This results in discovery
> subsystem debugfs directory to be created in debugfs root directory.
> 
> nvmet_init() ->
>   nvmet_init_discovery() ->
>     nvmet_subsys_alloc() ->
>       nvmet_debugfs_subsys_setup()
> 
> In other words, the codepath above is exeucted before nvmet_debugfs is
> created. We get /sys/kernel/debug/nqn.2014-08.org.nvmexpress.discovery
> instead of /sys/kernel/debug/nvmet/nqn.2014-08.org.nvmexpress.discovery.
> Move nvmet_init_discovery() call after nvmet_init_debugfs() to fix it.
> 
> Fixes: 649fd41420a8 ("nvmet: add debugfs support")
> Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>

Reviewed-by: Daniel Wagner <dwagner@suse.de>


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

* Re: [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized
  2025-07-25 20:50 [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized Mohamed Khalfella
  2025-07-28  7:51 ` Daniel Wagner
@ 2025-07-28 17:51 ` Chaitanya Kulkarni
  2025-07-29  7:28 ` Hannes Reinecke
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2025-07-28 17:51 UTC (permalink / raw)
  To: Mohamed Khalfella, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Keith Busch
  Cc: Hannes Reinecke, Daniel Wagner, Randy Jennings,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org

On 7/25/25 13:50, Mohamed Khalfella wrote:
> During nvme target initialization discovery subsystem is initialized
> before "nvmet" debugfs directory is created. This results in discovery
> subsystem debugfs directory to be created in debugfs root directory.
>
> nvmet_init() ->
>    nvmet_init_discovery() ->
>      nvmet_subsys_alloc() ->
>        nvmet_debugfs_subsys_setup()
>
> In other words, the codepath above is exeucted before nvmet_debugfs is
> created. We get /sys/kernel/debug/nqn.2014-08.org.nvmexpress.discovery
> instead of /sys/kernel/debug/nvmet/nqn.2014-08.org.nvmexpress.discovery.
> Move nvmet_init_discovery() call after nvmet_init_debugfs() to fix it.
>
> Fixes: 649fd41420a8 ("nvmet: add debugfs support")
> Signed-off-by: Mohamed Khalfella<mkhalfella@purestorage.com>
> ---

Looks good.

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

-ck



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

* Re: [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized
  2025-07-25 20:50 [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized Mohamed Khalfella
  2025-07-28  7:51 ` Daniel Wagner
  2025-07-28 17:51 ` Chaitanya Kulkarni
@ 2025-07-29  7:28 ` Hannes Reinecke
       [not found] ` <CGME20250729102527epcas5p165b73185cadb10d38b3213fcbf931159@epcas5p1.samsung.com>
  2025-07-30 15:53 ` Christoph Hellwig
  4 siblings, 0 replies; 6+ messages in thread
From: Hannes Reinecke @ 2025-07-29  7:28 UTC (permalink / raw)
  To: Mohamed Khalfella, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Keith Busch
  Cc: Hannes Reinecke, Daniel Wagner, Randy Jennings, linux-nvme,
	linux-kernel

On 7/25/25 22:50, Mohamed Khalfella wrote:
> During nvme target initialization discovery subsystem is initialized
> before "nvmet" debugfs directory is created. This results in discovery
> subsystem debugfs directory to be created in debugfs root directory.
> 
> nvmet_init() ->
>    nvmet_init_discovery() ->
>      nvmet_subsys_alloc() ->
>        nvmet_debugfs_subsys_setup()
> 
> In other words, the codepath above is exeucted before nvmet_debugfs is
> created. We get /sys/kernel/debug/nqn.2014-08.org.nvmexpress.discovery
> instead of /sys/kernel/debug/nvmet/nqn.2014-08.org.nvmexpress.discovery.
> Move nvmet_init_discovery() call after nvmet_init_debugfs() to fix it.
> 
> Fixes: 649fd41420a8 ("nvmet: add debugfs support")
> Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
> ---
>   drivers/nvme/target/core.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@kernel.org>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich


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

* Re: [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized
       [not found] ` <CGME20250729102527epcas5p165b73185cadb10d38b3213fcbf931159@epcas5p1.samsung.com>
@ 2025-07-29 10:25   ` Nitesh Shetty
  0 siblings, 0 replies; 6+ messages in thread
From: Nitesh Shetty @ 2025-07-29 10:25 UTC (permalink / raw)
  To: Mohamed Khalfella
  Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, Keith Busch,
	Hannes Reinecke, Daniel Wagner, Randy Jennings, linux-nvme,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

On 25/07/25 01:50PM, Mohamed Khalfella wrote:
>During nvme target initialization discovery subsystem is initialized
>before "nvmet" debugfs directory is created. This results in discovery
>subsystem debugfs directory to be created in debugfs root directory.
>
>nvmet_init() ->
>  nvmet_init_discovery() ->
>    nvmet_subsys_alloc() ->
>      nvmet_debugfs_subsys_setup()
>
>In other words, the codepath above is exeucted before nvmet_debugfs is
>created. We get /sys/kernel/debug/nqn.2014-08.org.nvmexpress.discovery
>instead of /sys/kernel/debug/nvmet/nqn.2014-08.org.nvmexpress.discovery.
>Move nvmet_init_discovery() call after nvmet_init_debugfs() to fix it.
>
>Fixes: 649fd41420a8 ("nvmet: add debugfs support")
>Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
>---

Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized
  2025-07-25 20:50 [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized Mohamed Khalfella
                   ` (3 preceding siblings ...)
       [not found] ` <CGME20250729102527epcas5p165b73185cadb10d38b3213fcbf931159@epcas5p1.samsung.com>
@ 2025-07-30 15:53 ` Christoph Hellwig
  4 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2025-07-30 15:53 UTC (permalink / raw)
  To: Mohamed Khalfella
  Cc: Christoph Hellwig, Sagi Grimberg, Chaitanya Kulkarni, Keith Busch,
	Hannes Reinecke, Daniel Wagner, Randy Jennings, linux-nvme,
	linux-kernel

Thanks, applied to nvme-6.17.



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

end of thread, other threads:[~2025-07-30 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25 20:50 [PATCH] nvmet: Initialize discovery subsys after debugfs is initialized Mohamed Khalfella
2025-07-28  7:51 ` Daniel Wagner
2025-07-28 17:51 ` Chaitanya Kulkarni
2025-07-29  7:28 ` Hannes Reinecke
     [not found] ` <CGME20250729102527epcas5p165b73185cadb10d38b3213fcbf931159@epcas5p1.samsung.com>
2025-07-29 10:25   ` Nitesh Shetty
2025-07-30 15:53 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).