stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6.6] SUNRPC: Remove BUG_ON call sites
@ 2024-11-02  6:52 Dominique Martinet
  2024-11-02  7:02 ` Dominique Martinet
  0 siblings, 1 reply; 3+ messages in thread
From: Dominique Martinet @ 2024-11-02  6:52 UTC (permalink / raw)
  To: stable; +Cc: gregkh, Chuck Lever, Christian Brauner, NeilBrown, Jeff Layton

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

[ Upstream commit 789ce196a31dd13276076762204bee87df893e53 ]

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.

Acked-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
I've hit this BUG at home when restarting the nfs-server service and
while that didn't bring the whole system down it did kill a thread with
the nfsd_mutex lock held, making exportfs & other related commands all
hang in unkillable state trying to grab the lock.

So this is purely selfish so that this won't happen again next time I
upgrade :-)

I'd like to say I have any idea why the bug hit on that 6.6.42 (the
sv_permsocks one did) and help with the underlying issue, but I honestly
didn't do anything fancy and don't have anything interesting in logs
(except the bug itself, happy to forward it if someone cares); would
have been possible to debug this if I had a crash dump but it's not
setup on this machine and just having this down to WARN if probably
good enough...

Cheers,

 net/sunrpc/svc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 029c49065016..b43dc8409b1f 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -577,11 +577,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);
 
-- 
2.46.1


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

* Re: [PATCH 6.6] SUNRPC: Remove BUG_ON call sites
  2024-11-02  6:52 [PATCH 6.6] SUNRPC: Remove BUG_ON call sites Dominique Martinet
@ 2024-11-02  7:02 ` Dominique Martinet
  2024-11-06  6:13   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Dominique Martinet @ 2024-11-02  7:02 UTC (permalink / raw)
  To: stable; +Cc: gregkh, Chuck Lever, Christian Brauner, NeilBrown, Jeff Layton

Dominique Martinet wrote on Sat, Nov 02, 2024 at 03:52:03PM +0900:
> From: Chuck Lever <chuck.lever@oracle.com>
> 
> [ Upstream commit 789ce196a31dd13276076762204bee87df893e53 ]
> 
> 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.
> 
> Acked-by: Christian Brauner <brauner@kernel.org>
> Reviewed-by: NeilBrown <neilb@suse.de>
> Reviewed-by: Jeff Layton <jlayton@kernel.org>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

grmbl, missing my signed-off, sorry:
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>

hopefully didn't miss anything else..

-- 
Dominique

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

* Re: [PATCH 6.6] SUNRPC: Remove BUG_ON call sites
  2024-11-02  7:02 ` Dominique Martinet
@ 2024-11-06  6:13   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2024-11-06  6:13 UTC (permalink / raw)
  To: Dominique Martinet
  Cc: stable, Chuck Lever, Christian Brauner, NeilBrown, Jeff Layton

On Sat, Nov 02, 2024 at 04:02:27PM +0900, Dominique Martinet wrote:
> Dominique Martinet wrote on Sat, Nov 02, 2024 at 03:52:03PM +0900:
> > From: Chuck Lever <chuck.lever@oracle.com>
> > 
> > [ Upstream commit 789ce196a31dd13276076762204bee87df893e53 ]
> > 
> > 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.
> > 
> > Acked-by: Christian Brauner <brauner@kernel.org>
> > Reviewed-by: NeilBrown <neilb@suse.de>
> > Reviewed-by: Jeff Layton <jlayton@kernel.org>
> > Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> 
> grmbl, missing my signed-off, sorry:
> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
> 
> hopefully didn't miss anything else..

Can you resend with this fixed up so we don't have to manually edit
this?

thanks,

greg k-h

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

end of thread, other threads:[~2024-11-06  6:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-02  6:52 [PATCH 6.6] SUNRPC: Remove BUG_ON call sites Dominique Martinet
2024-11-02  7:02 ` Dominique Martinet
2024-11-06  6:13   ` Greg KH

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).