Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp732986rdb; Tue, 19 Sep 2023 08:36:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuobswrFd2ldfBlZIt9UjqxdFZAX1lMcfMxmytXMPFZbsBxjYem4BPEJ1FITXr2Hfy74aX X-Received: by 2002:a05:6a00:2da3:b0:68c:a81:4368 with SMTP id fb35-20020a056a002da300b0068c0a814368mr33448pfb.6.1695137811383; Tue, 19 Sep 2023 08:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695137811; cv=none; d=google.com; s=arc-20160816; b=rACJ71qrT4gTOlXO+o8e9MojaepaCzblqZ+7kn+C7Dh5waKMRpQcl3AYu3zHirHVF7 8BHZ5z49RW6W/1/U5rxJHbC2FQ8L9tb1WDjeYpwW3V3mjATH4uucyPftnFnYy3ZH4Obf injpanaFdNE8XbfGiGQWbrry0/VKNK49F3Kt6ZtptkZamQ38QthQlTuHzoIxw4bby+MS 4YGb7wSjUT1rIxxLtieuxZabaabQE68PLJ0du7/U7x4VEr2FXTOPe/wUNa7aNlNFjFDB J7Wpp1TTOl/UzoHar8YNNqD0T7On6SEo/phV0OY6diFyK7BEeS9r4ZIXzYT6qT6c+5C+ XItA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=BDOWnRmEc55iPUv1q1kPBe8QfnM9s1QaVVaSjIwEo3s=; fh=UT9CTgRm9uhK3J6O8Kctkhi3r5n+G5JFhExvvSEFTh4=; b=aDcdQwtBHxMKfXsZGmO/KBPpITlq237sAv7yJUura18cYX7q9Wc4IdVA1JM6Ms+lP1 cwJL35LutZMVOUzrCRmboG4nCka7D57fKhwcMhdKZytvlXvJEomVueNdeiZUquZPvqGP qoZSA7g5ZAf1n8raTrLdVWuvywD0KWoYuCyVYWzhLp0l1BkbDaBPl6sjkbVqWmXDCtP6 wRCfH3aX8bIe5V+iStzufP3X9wmRAbtn/6Luiw/PlS9VcerX8Vw54jsD0GZtaq6S4gqS 24zCaavt54aQTK6lk7JAI0KzzHgZE5Kg4b7f3ve3/4TB8MyECbiNUBNlSiTU6huUllp+ GmTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g1anLvlH; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id a35-20020a631a63000000b0053fb354c191si9712352pgm.861.2023.09.19.08.36.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 08:36:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g1anLvlH; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 488CF82696D4; Tue, 19 Sep 2023 08:35:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232459AbjISPfY (ORCPT + 99 others); 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 19 Sep 2023 08:35:20 -0700 (PDT) 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 --- 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);