From patchwork Tue Sep 19 15:35:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13391574 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CE17CE79A9 for ; Tue, 19 Sep 2023 15:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232459AbjISPfY (ORCPT ); Tue, 19 Sep 2023 11:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233001AbjISPfX (ORCPT ); Tue, 19 Sep 2023 11:35:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 705DC91 for ; Tue, 19 Sep 2023 08:35:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2F05C433C8; Tue, 19 Sep 2023 15:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695137717; bh=/Q/Lx12qDUzzN92fJp5Ct79TxTOC67rSpzWe1wxt8+w=; h=Subject:From:To:Cc:Date:From; b=g1anLvlHQWdiUbK9FHwP2JiHngIzGBvWnswR86JHcM+++nUEwa938Y0Qe2meqEiGZ m2hLvSn3AaslZDi4E0Wca0Z1WTv+XtMWU0XnrwelijjlW98/U0hVw+gOLGWAjvDwOW N1OA9TW3Sy/frfowf9Wu3RnqI9I8DP/2XgPMwCC5e0F1FTBXgaHFhaJpeJYTo4TNd9 Ij5IUjhw4vs4MSG0t462zeaKsLrXge+aodFWOVbejzh5/7Bn8Ts6Zhm80R6OiOMeQT liKErrjmUEZpwyifB7qEZrelAQZpJXFzypJvFRPEB8lRCynD2N5ZJ3NkdNQpKwjPmt 2b5bNtDWXylfw== Subject: [PATCH v1] SUNRPC: Remove BUG_ON call sites From: Chuck Lever To: neilb@suse.de, brauner@kernel.org Cc: Chuck Lever , linux-nfs@vger.kernel.org Date: Tue, 19 Sep 2023 11:35:15 -0400 Message-ID: <169513768769.145733.5037542987990908432.stgit@manet.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Chuck Lever 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 Acked-by: Christian Brauner Reviewed-by: NeilBrown --- 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);