All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avinesh Kumar <akumar@suse.de>
To: Nirjhar Roy <nirjhar@linux.ibm.com>
Cc: Ritesh Harjani <ritesh.list@gmail.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1 1/1] syscalls/<delete, init, finit>_module: Rename /proc/dummy to module specific path name
Date: Mon, 09 Sep 2024 12:15:19 +0200	[thread overview]
Message-ID: <4767877.vXUDI8C0e8@localhost> (raw)
In-Reply-To: <5488fdbd9f26f1826fb083cfdbc357ac9ca954a4.1725601646.git.nirjhar@linux.ibm.com>

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

  parent reply	other threads:[~2024-09-09 10:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2024-09-17  8:06   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4767877.vXUDI8C0e8@localhost \
    --to=akumar@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=nirjhar@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.