mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] proc: fix incorrect pde_is_permanent check
@ 2021-03-18 12:26 Colin King
  2021-03-18 14:00 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-03-18 12:26 UTC (permalink / raw)
  To: Christian Brauner, Andrew Morton, Greg Kroah-Hartman, linux-fsdevel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the pde_is_permanent check is being run on root multiple times
rather than on the next proc directory entry. This looks like a copy-paste
error.  Fix this by replacing root with next.

Addresses-Coverity: ("Copy-paste error")
Fixes: d919b33dafb3 ("proc: faster open/read/close with "permanent" files")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/proc/generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index bc86aa87cc41..5600da30e289 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -756,7 +756,7 @@ int remove_proc_subtree(const char *name, struct proc_dir_entry *parent)
 	while (1) {
 		next = pde_subdir_first(de);
 		if (next) {
-			if (unlikely(pde_is_permanent(root))) {
+			if (unlikely(pde_is_permanent(next))) {
 				write_unlock(&proc_subdir_lock);
 				WARN(1, "removing permanent /proc entry '%s/%s'",
 					next->parent->name, next->name);
-- 
2.30.2


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

* Re: [PATCH] proc: fix incorrect pde_is_permanent check
  2021-03-18 12:26 [PATCH] proc: fix incorrect pde_is_permanent check Colin King
@ 2021-03-18 14:00 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2021-03-18 14:00 UTC (permalink / raw)
  To: Colin King
  Cc: Andrew Morton, Greg Kroah-Hartman, linux-fsdevel,
	kernel-janitors, linux-kernel

On Thu, Mar 18, 2021 at 12:26:33PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the pde_is_permanent check is being run on root multiple times
> rather than on the next proc directory entry. This looks like a copy-paste
> error.  Fix this by replacing root with next.
> 
> Addresses-Coverity: ("Copy-paste error")
> Fixes: d919b33dafb3 ("proc: faster open/read/close with "permanent" files")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---

Thanks! Seems very much like it.
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

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

end of thread, other threads:[~2021-03-18 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 12:26 [PATCH] proc: fix incorrect pde_is_permanent check Colin King
2021-03-18 14:00 ` Christian Brauner

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

all inboxes | Powered by JetHome®