public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v1 1/1] syscalls/<delete, init, finit>_module: Rename /proc/dummy to module specific path name
       [not found] <cover.1725601646.git.nirjhar@linux.ibm.com>
@ 2024-09-09  4:42 ` Nirjhar Roy
  2024-09-09  8:15   ` Li Wang
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nirjhar Roy @ 2024-09-09  4:42 UTC (permalink / raw)
  To: ltp; +Cc: Ritesh Harjani

Tests in syscalls/delete_module/, syscalls/init_module and syscalls/finit_module use kernel
modules all of which create a /proc/dummy node. When these tests run in parralel, there appears
to be a situation where these tests simulatenously tries to create /proc/dummy node. This generates
a kernel warning "proc_dir_entry '/proc/dummy' already registered".
This patch renames the /proc/dummy node to module specific name in order to avoid the conflict.

Signed-off-by: Nirjhar Roy <nirjhar@linux.ibm.com>
---
 testcases/kernel/syscalls/delete_module/dummy_del_mod.c     | 6 ++++--
 testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c | 6 ++++--
 testcases/kernel/syscalls/finit_module/finit_module.c       | 6 ++++--
 testcases/kernel/syscalls/init_module/init_module.c         | 6 ++++--
 4 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/testcases/kernel/syscalls/delete_module/dummy_del_mod.c b/testcases/kernel/syscalls/delete_module/dummy_del_mod.c
index 0ca7bea37..4257bb504 100644
--- a/testcases/kernel/syscalls/delete_module/dummy_del_mod.c
+++ b/testcases/kernel/syscalls/delete_module/dummy_del_mod.c
@@ -14,6 +14,8 @@
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
 
+#define DIRNAME "dummy_delmod"
+
 /* Dummy function called by dependent module */
 int dummy_func_test(void)
 {
@@ -25,13 +27,13 @@ static int __init dummy_init(void)
 {
 	struct proc_dir_entry *proc_dummy;
 
-	proc_dummy = proc_mkdir("dummy", 0);
+	proc_dummy = proc_mkdir(DIRNAME, 0);
 	return 0;
 }
 
 static void __exit dummy_exit(void)
 {
-	remove_proc_entry("dummy", 0);
+	remove_proc_entry(DIRNAME, 0);
 }
 
 module_init(dummy_init);
diff --git a/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c b/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c
index 85b327911..8c891cf49 100644
--- a/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c
+++ b/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c
@@ -16,20 +16,22 @@
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
 
+#define DIRNAME "dummy_dep"
+
 extern int dummy_func_test(void);
 
 static int __init dummy_init(void)
 {
 	struct proc_dir_entry *proc_dummy;
 
-	proc_dummy = proc_mkdir("dummy_dep", 0);
+	proc_dummy = proc_mkdir(DIRNAME, 0);
 	dummy_func_test();
 	return 0;
 }
 
 static void __exit dummy_exit(void)
 {
-	remove_proc_entry("dummy_dep", 0);
+	remove_proc_entry(DIRNAME, 0);
 }
 
 module_init(dummy_init);
diff --git a/testcases/kernel/syscalls/finit_module/finit_module.c b/testcases/kernel/syscalls/finit_module/finit_module.c
index 78d03b899..a7b1e43c5 100644
--- a/testcases/kernel/syscalls/finit_module/finit_module.c
+++ b/testcases/kernel/syscalls/finit_module/finit_module.c
@@ -13,6 +13,8 @@
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
 
+#define DIRNAME "dummy_finit"
+
 static char status[20];
 module_param_string(status, status, 20, 0444);
 
@@ -23,14 +25,14 @@ static int dummy_init(void)
 	if (!strcmp(status, "invalid"))
 		return -EINVAL;
 
-	proc_dummy = proc_mkdir("dummy", 0);
+	proc_dummy = proc_mkdir(DIRNAME, 0);
 	return 0;
 }
 module_init(dummy_init);
 
 static void dummy_exit(void)
 {
-	remove_proc_entry("dummy", 0);
+	remove_proc_entry(DIRNAME, 0);
 }
 module_exit(dummy_exit);
 
diff --git a/testcases/kernel/syscalls/init_module/init_module.c b/testcases/kernel/syscalls/init_module/init_module.c
index 78d03b899..f14cd80b6 100644
--- a/testcases/kernel/syscalls/init_module/init_module.c
+++ b/testcases/kernel/syscalls/init_module/init_module.c
@@ -13,6 +13,8 @@
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
 
+#define DIRNAME "dummy_init"
+
 static char status[20];
 module_param_string(status, status, 20, 0444);
 
@@ -23,14 +25,14 @@ static int dummy_init(void)
 	if (!strcmp(status, "invalid"))
 		return -EINVAL;
 
-	proc_dummy = proc_mkdir("dummy", 0);
+	proc_dummy = proc_mkdir(DIRNAME, 0);
 	return 0;
 }
 module_init(dummy_init);
 
 static void dummy_exit(void)
 {
-	remove_proc_entry("dummy", 0);
+	remove_proc_entry(DIRNAME, 0);
 }
 module_exit(dummy_exit);
 
-- 
2.43.5


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/1] syscalls/<delete, init, finit>_module: Rename /proc/dummy to module specific path name
  2024-09-09  4:42 ` [LTP] [PATCH v1 1/1] syscalls/<delete, init, finit>_module: Rename /proc/dummy to module specific path name Nirjhar Roy
@ 2024-09-09  8:15   ` Li Wang
  2024-09-09 10:15   ` Avinesh Kumar
  2024-09-17  8:06   ` Cyril Hrubis
  2 siblings, 0 replies; 4+ messages in thread
From: Li Wang @ 2024-09-09  8:15 UTC (permalink / raw)
  To: Nirjhar Roy; +Cc: Ritesh Harjani, ltp

On Mon, Sep 9, 2024 at 3:51 PM Nirjhar Roy <nirjhar@linux.ibm.com> wrote:

> Tests in syscalls/delete_module/, syscalls/init_module and
> syscalls/finit_module use kernel
> modules all of which create a /proc/dummy node. When these tests run in
> parralel, there appears
> to be a situation where these tests simulatenously tries to create
> /proc/dummy node. This generates
> a kernel warning "proc_dir_entry '/proc/dummy' already registered".
> This patch renames the /proc/dummy node to module specific name in order
> to avoid the conflict.
>
> Signed-off-by: Nirjhar Roy <nirjhar@linux.ibm.com>
>

Reviewed-by: Li Wang <liwang@redhat.com>


-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/1] syscalls/<delete, init, finit>_module: Rename /proc/dummy to module specific path name
  2024-09-09  4:42 ` [LTP] [PATCH v1 1/1] syscalls/<delete, init, finit>_module: Rename /proc/dummy to module specific path name Nirjhar Roy
  2024-09-09  8:15   ` Li Wang
@ 2024-09-09 10:15   ` Avinesh Kumar
  2024-09-17  8:06   ` Cyril Hrubis
  2 siblings, 0 replies; 4+ messages in thread
From: Avinesh Kumar @ 2024-09-09 10:15 UTC (permalink / raw)
  To: Nirjhar Roy; +Cc: Ritesh Harjani, ltp

Hi,

Reviewed-by: Avinesh Kumar <akumar@suse.de>


On Monday, September 9, 2024 6:42:34 AM GMT+2 Nirjhar Roy wrote:
> Tests in syscalls/delete_module/, syscalls/init_module and syscalls/finit_module use kernel
> modules all of which create a /proc/dummy node. When these tests run in parralel, there appears
> to be a situation where these tests simulatenously tries to create /proc/dummy node. This generates
> a kernel warning "proc_dir_entry '/proc/dummy' already registered".
> This patch renames the /proc/dummy node to module specific name in order to avoid the conflict.
> 
> Signed-off-by: Nirjhar Roy <nirjhar@linux.ibm.com>
> ---
>  testcases/kernel/syscalls/delete_module/dummy_del_mod.c     | 6 ++++--
>  testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c | 6 ++++--
>  testcases/kernel/syscalls/finit_module/finit_module.c       | 6 ++++--
>  testcases/kernel/syscalls/init_module/init_module.c         | 6 ++++--
>  4 files changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/delete_module/dummy_del_mod.c b/testcases/kernel/syscalls/delete_module/dummy_del_mod.c
> index 0ca7bea37..4257bb504 100644
> --- a/testcases/kernel/syscalls/delete_module/dummy_del_mod.c
> +++ b/testcases/kernel/syscalls/delete_module/dummy_del_mod.c
> @@ -14,6 +14,8 @@
>  #include <linux/proc_fs.h>
>  #include <linux/kernel.h>
>  
> +#define DIRNAME "dummy_delmod"
> +
>  /* Dummy function called by dependent module */
>  int dummy_func_test(void)
>  {
> @@ -25,13 +27,13 @@ static int __init dummy_init(void)
>  {
>  	struct proc_dir_entry *proc_dummy;
>  
> -	proc_dummy = proc_mkdir("dummy", 0);
> +	proc_dummy = proc_mkdir(DIRNAME, 0);
>  	return 0;
>  }
>  
>  static void __exit dummy_exit(void)
>  {
> -	remove_proc_entry("dummy", 0);
> +	remove_proc_entry(DIRNAME, 0);
>  }
>  
>  module_init(dummy_init);
> diff --git a/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c b/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c
> index 85b327911..8c891cf49 100644
> --- a/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c
> +++ b/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c
> @@ -16,20 +16,22 @@
>  #include <linux/proc_fs.h>
>  #include <linux/kernel.h>
>  
> +#define DIRNAME "dummy_dep"
> +
>  extern int dummy_func_test(void);
>  
>  static int __init dummy_init(void)
>  {
>  	struct proc_dir_entry *proc_dummy;
>  
> -	proc_dummy = proc_mkdir("dummy_dep", 0);
> +	proc_dummy = proc_mkdir(DIRNAME, 0);
>  	dummy_func_test();
>  	return 0;
>  }
>  
>  static void __exit dummy_exit(void)
>  {
> -	remove_proc_entry("dummy_dep", 0);
> +	remove_proc_entry(DIRNAME, 0);
>  }
>  
>  module_init(dummy_init);
> diff --git a/testcases/kernel/syscalls/finit_module/finit_module.c b/testcases/kernel/syscalls/finit_module/finit_module.c
> index 78d03b899..a7b1e43c5 100644
> --- a/testcases/kernel/syscalls/finit_module/finit_module.c
> +++ b/testcases/kernel/syscalls/finit_module/finit_module.c
> @@ -13,6 +13,8 @@
>  #include <linux/proc_fs.h>
>  #include <linux/kernel.h>
>  
> +#define DIRNAME "dummy_finit"
> +
>  static char status[20];
>  module_param_string(status, status, 20, 0444);
>  
> @@ -23,14 +25,14 @@ static int dummy_init(void)
>  	if (!strcmp(status, "invalid"))
>  		return -EINVAL;
>  
> -	proc_dummy = proc_mkdir("dummy", 0);
> +	proc_dummy = proc_mkdir(DIRNAME, 0);
>  	return 0;
>  }
>  module_init(dummy_init);
>  
>  static void dummy_exit(void)
>  {
> -	remove_proc_entry("dummy", 0);
> +	remove_proc_entry(DIRNAME, 0);
>  }
>  module_exit(dummy_exit);
>  
> diff --git a/testcases/kernel/syscalls/init_module/init_module.c b/testcases/kernel/syscalls/init_module/init_module.c
> index 78d03b899..f14cd80b6 100644
> --- a/testcases/kernel/syscalls/init_module/init_module.c
> +++ b/testcases/kernel/syscalls/init_module/init_module.c
> @@ -13,6 +13,8 @@
>  #include <linux/proc_fs.h>
>  #include <linux/kernel.h>
>  
> +#define DIRNAME "dummy_init"
> +
>  static char status[20];
>  module_param_string(status, status, 20, 0444);
>  
> @@ -23,14 +25,14 @@ static int dummy_init(void)
>  	if (!strcmp(status, "invalid"))
>  		return -EINVAL;
>  
> -	proc_dummy = proc_mkdir("dummy", 0);
> +	proc_dummy = proc_mkdir(DIRNAME, 0);
>  	return 0;
>  }
>  module_init(dummy_init);
>  
>  static void dummy_exit(void)
>  {
> -	remove_proc_entry("dummy", 0);
> +	remove_proc_entry(DIRNAME, 0);
>  }
>  module_exit(dummy_exit);
>  
> 

Regards,
Avinesh




-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/1] syscalls/<delete, init, finit>_module: Rename /proc/dummy to module specific path name
  2024-09-09  4:42 ` [LTP] [PATCH v1 1/1] syscalls/<delete, init, finit>_module: Rename /proc/dummy to module specific path name Nirjhar Roy
  2024-09-09  8:15   ` Li Wang
  2024-09-09 10:15   ` Avinesh Kumar
@ 2024-09-17  8:06   ` Cyril Hrubis
  2 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2024-09-17  8:06 UTC (permalink / raw)
  To: Nirjhar Roy; +Cc: Ritesh Harjani, ltp

Hi!
Applied, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2024-09-17  8:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1725601646.git.nirjhar@linux.ibm.com>
2024-09-09  4:42 ` [LTP] [PATCH v1 1/1] syscalls/<delete, init, finit>_module: Rename /proc/dummy to module specific path name Nirjhar Roy
2024-09-09  8:15   ` Li Wang
2024-09-09 10:15   ` Avinesh Kumar
2024-09-17  8:06   ` Cyril Hrubis

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