Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp150019rdb; Mon, 18 Sep 2023 10:38:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7tD53KfxbQ/OEodKzupi2dvh3CbnAMBFDv0NjKGCiQVYdKgtYAYBcDi7c6edsMiUJ07N1 X-Received: by 2002:a05:6a20:5488:b0:133:8784:15f7 with SMTP id i8-20020a056a20548800b00133878415f7mr351362pzk.14.1695058718485; Mon, 18 Sep 2023 10:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695058718; cv=none; d=google.com; s=arc-20160816; b=gNwZidSN+7fpugfq8qyrz4wOjI4Qgfkmb6cf5WzAa0vKURO1gHxfZkpmYB8n5oWhQi mwFsmnPT1L5jzJqPZyHd3Uhi0smOBak4tzVQSAoKOu0fmgmkSW24s4mOM2x3CWCnp2X9 14i3mhcV9rsnpH0ZZ/rbB6FURvU6aGI/cwq+2Mb1JWR7AZ7o05fZk9N54F8tbaeF14cQ SJHuMgjz7gKCRvF+yZjIT62h5NBCsCVRLQlzhjKsIyH8EqIbOGrgztuH4/hgtHcZUA0B 6DUMHZMWNZNctmYIhlHO4Og5UFJa+9c1kpNpdkZPOuNSxaDl7PlEoW9LdPirLc2QS4PL odHQ== 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=3TO9zKnx8nYRgvxXDzcKBKyR+ixYFHS1rPPFcz88A0U=; fh=UT9CTgRm9uhK3J6O8Kctkhi3r5n+G5JFhExvvSEFTh4=; b=hn3baGbQEDDwQ56sXidVj/rDhQsPqxquFnzjzz2ZwrL10fZ5XrhK6bdKDddj9NroCr ixrnucKaaW97uLV/ZdW+IvXltWvfHlK6T2HJ+CfUZqu6z3IUne7wdF1cZ1xa6GzKYRT9 lKVdafbil2cEoZsoVWdDP922NjpZ/tle+W3bKUGI4gu8ajUHAjzaRhLea6f7XmGl7ZoT nSrofnCM85qb+vUyGBU1AJ3pSu9a9QuRL0yWEz7b4FZ3/w0yPS/50gEnNEpyFIqvAL7/ 8km0mQsY/HRUbe+ed7ikEa3xk3jBG51P4ctb9lje3Bhjo5U1VxtzsOAP0kV3Qesbaw6f CcNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DQsCrwjr; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id m124-20020a632682000000b00565f8b22ca3si7935821pgm.38.2023.09.18.10.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 10:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DQsCrwjr; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 46DFD81EA5D0; Mon, 18 Sep 2023 09:48:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229781AbjIRQsd (ORCPT + 99 others); Mon, 18 Sep 2023 12:48:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbjIRQsV (ORCPT ); Mon, 18 Sep 2023 12:48:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92421172C for ; Mon, 18 Sep 2023 09:47:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E125C32777; Mon, 18 Sep 2023 14:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695046711; bh=w6i1iNGJem8BsbeiQZQFAHcL5/hlMZkwc4S/pQzy7KY=; h=Subject:From:To:Cc:Date:From; b=DQsCrwjrtdNb9YUWfAutunUkY7HMyeSjxyF+l6fKeoIrMC85bGiKe3v9aHYxSKTxK q/iMhd4S1inG3q5KX7CAuOLPcvlaJvBdPXgWAwzzTnOZktgAvZDjBv8GUQG6wEnqS/ wO8rzUbPfENdiIaMlPhfXor1sZORnhdFsaavccU5SQZGj0Q/8jViQN60/LfuBiXnzp av3GHEYfSBGMNXN+4TqAdFMxd04S9oGRMcp0yoxwQYtzo+yGjfi519cYLBdQr0eij4 Iuotk6fBhLmuIB2a7XC6n7Zpd7kQL9/R4p62UOVLgVZTBFGd6Oh4nullN1cMZG0w5G 8VchCDA+X7mfA== 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: Mon, 18 Sep 2023 10:18:30 -0400 Message-ID: <169504668787.134583.4338728458451666583.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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 18 Sep 2023 09:48:40 -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 --- 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);