From: David Hunter <david.hunter.linux@gmail.com>
To: socketcan@hartkopp.net, mkl@pengutronix.de, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: david.hunter.linux@gmail.com, skhan@linuxfoundation.org,
javier.carrasco.cruz@gmail.com
Subject: [PATCH 1/1] Net: bcm.c: Remove Subtree Instead of Entry
Date: Thu, 8 Aug 2024 16:26:58 -0400 [thread overview]
Message-ID: <20240808202658.5933-1-david.hunter.linux@gmail.com> (raw)
Fix a warning with bcm.c that is caused by removing an entry. If the
entry had a process as a child, a warning is generated:
remove_proc_entry: removing non-empty directory 'net/can-bcm'...
WARNING: CPU: 1 PID: 71 at fs/proc/generic.c:717 remove_proc_entry
Call Trace:
remove_proc_entry
canbcm_pernet_exit
ops_exit_list
Instead of simply removing the entry, remove the entire subdirectory.
The child process will still be removed, but without a warning occurring.
This patch was compiled and the code traced with gdb to see that the
tree was removed. The code was run to see that the warning was removed.
In addition, the code was tested with the kselftest
net subsystem. No regressions were detected.
Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---
net/can/bcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 27d5fcf0eac9..fea48fd793e5 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -1779,7 +1779,7 @@ static void canbcm_pernet_exit(struct net *net)
#if IS_ENABLED(CONFIG_PROC_FS)
/* remove /proc/net/can-bcm directory */
if (net->can.bcmproc_dir)
- remove_proc_entry("can-bcm", net->proc_net);
+ remove_proc_subtree("can-bcm", net->proc_net);
#endif /* CONFIG_PROC_FS */
}
--
2.34.1
next reply other threads:[~2024-08-08 20:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 20:26 David Hunter [this message]
2024-08-09 9:57 ` [PATCH 1/1] Net: bcm.c: Remove Subtree Instead of Entry Oliver Hartkopp
2024-08-09 16:21 ` David Hunter
2024-08-09 20:22 ` Kuniyuki Iwashima
2024-08-09 20:28 ` Kuniyuki Iwashima
2024-08-30 10:56 ` Marc Kleine-Budde
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=20240808202658.5933-1-david.hunter.linux@gmail.com \
--to=david.hunter.linux@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=skhan@linuxfoundation.org \
--cc=socketcan@hartkopp.net \
/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 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).