From: Chuck Lever III <chuck.lever@oracle.com>
To: Neil Brown <neilb@suse.de>
Cc: Chuck Lever <cel@kernel.org>,
Christian Brauner <brauner@kernel.org>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v1] SUNRPC: Remove BUG_ON call sites
Date: Tue, 19 Sep 2023 14:56:24 +0000 [thread overview]
Message-ID: <4B0E5D89-B784-4864-9BA8-F7F6C0F02912@oracle.com> (raw)
In-Reply-To: <169508172758.19404.11033097632795181738@noble.neil.brown.name>
> On Sep 18, 2023, at 8:02 PM, NeilBrown <neilb@suse.de> wrote:
>
> On Tue, 19 Sep 2023, Chuck Lever wrote:
>> 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);
>
> I would go with WARN_ON_ONCE() but I agree with the principle.
> Maybe
> WARN_ONCE(!list_empty(&serv->sv_permsocks),
> "SVC: permsocks remain for %s\n",
> serv->sv_program->pg_name);
> This gives the stack trace which might be helpful.
I couldn't think of any additional value that a stack
trace would provide over which upper layer protocol
was calling, which is provided by pg_name.
> But
>
> Reviewed-by: NeilBrown <neilb@suse.de>
>
> if you prefer it the way it is.
WARN_ONCE is a more conservative change, so let's
do that.
> NeilBrown
>
>> + if (unlikely(!list_empty(&serv->sv_tempsocks)))
>> + pr_warn("SVC: tempsocks remain for %s\n",
>> + serv->sv_program->pg_name);
>>
>> cache_clean_deferred(serv);
--
Chuck Lever
next prev parent reply other threads:[~2023-09-19 14:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=4B0E5D89-B784-4864-9BA8-F7F6C0F02912@oracle.com \
--to=chuck.lever@oracle.com \
--cc=brauner@kernel.org \
--cc=cel@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
/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