Linux NFS development
 help / color / mirror / Atom feed
* [PATCH v1] SUNRPC: Remove BUG_ON call sites
@ 2023-09-18 14:18 Chuck Lever
  2023-09-18 14:26 ` Christian Brauner
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Chuck Lever @ 2023-09-18 14:18 UTC (permalink / raw)
  To: neilb, brauner; +Cc: Chuck Lever, linux-nfs

From: Chuck Lever <chuck.lever@oracle.com>

There is no need to take down the whole system for these assertions.

I'd rather not attempt a heroic save here, as some bug has occurred
that has left the transport data structures in an unknown state.
Just warn and then leak the left-over resources.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/svc.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Let's start here. Comments?


diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 587811a002c9..11a1d5e7f5c7 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -575,11 +575,14 @@ svc_destroy(struct kref *ref)
 	timer_shutdown_sync(&serv->sv_temptimer);
 
 	/*
-	 * The last user is gone and thus all sockets have to be destroyed to
-	 * the point. Check this.
+	 * Remaining transports at this point are not expected.
 	 */
-	BUG_ON(!list_empty(&serv->sv_permsocks));
-	BUG_ON(!list_empty(&serv->sv_tempsocks));
+	if (unlikely(!list_empty(&serv->sv_permsocks)))
+		pr_warn("SVC: permsocks remain for %s\n",
+			serv->sv_program->pg_name);
+	if (unlikely(!list_empty(&serv->sv_tempsocks)))
+		pr_warn("SVC: tempsocks remain for %s\n",
+			serv->sv_program->pg_name);
 
 	cache_clean_deferred(serv);
 



^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH v1] SUNRPC: Remove BUG_ON call sites
@ 2023-09-19 15:35 Chuck Lever
  2023-09-19 22:11 ` NeilBrown
  0 siblings, 1 reply; 14+ messages in thread
From: Chuck Lever @ 2023-09-19 15:35 UTC (permalink / raw)
  To: neilb, brauner; +Cc: Chuck Lever, linux-nfs

From: Chuck Lever <chuck.lever@oracle.com>

There is no need to take down the whole system for these assertions.

I'd rather not attempt a heroic save here, as some bug has occurred
that has left the transport data structures in an unknown state.
Just warn and then leak the left-over resources.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Christian Brauner <brauner@kernel.org>
---
 net/sunrpc/svc.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Changes since v1:
- Use WARN_ONCE() instead of pr_warn()

diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 587811a002c9..3237f7dfde1e 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -575,11 +575,12 @@ svc_destroy(struct kref *ref)
 	timer_shutdown_sync(&serv->sv_temptimer);
 
 	/*
-	 * The last user is gone and thus all sockets have to be destroyed to
-	 * the point. Check this.
+	 * Remaining transports at this point are not expected.
 	 */
-	BUG_ON(!list_empty(&serv->sv_permsocks));
-	BUG_ON(!list_empty(&serv->sv_tempsocks));
+	WARN_ONCE(!list_empty(&serv->sv_permsocks),
+		  "SVC: permsocks remain for %s\n", serv->sv_program->pg_name);
+	WARN_ONCE(!list_empty(&serv->sv_tempsocks),
+		  "SVC: tempsocks remain for %s\n", serv->sv_program->pg_name);
 
 	cache_clean_deferred(serv);
 



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

end of thread, other threads:[~2024-08-24  2:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 14:18 [PATCH v1] SUNRPC: Remove BUG_ON call sites Chuck Lever
2023-09-18 14:26 ` Christian Brauner
2023-09-19  0:02 ` NeilBrown
2023-09-19 14:56   ` Chuck Lever III
2023-09-22 19:19 ` Jeff Layton
  -- strict thread matches above, loose matches on Subject: below --
2023-09-19 15:35 Chuck Lever
2023-09-19 22:11 ` NeilBrown
2024-06-27 12:53   ` Donald Buczek
2024-08-23  3:35     ` Li Lingfeng
2024-08-23 19:15       ` Chuck Lever
2024-08-23 19:59         ` Chuck Lever
2024-08-24  2:38           ` Li Lingfeng
2024-08-24  1:03         ` Li Lingfeng
2024-08-24  2:29         ` Li Lingfeng

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