Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp635489rdb; Tue, 19 Sep 2023 06:10:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFs153tvi+43FiDFNB1AAOI8ZrPhqkmRpiLJxMXj9eyj4HDnbIxUdOSoYVTUveXGfWA0oAL X-Received: by 2002:a17:902:c94b:b0:1c3:ea60:73e2 with SMTP id i11-20020a170902c94b00b001c3ea6073e2mr12645943pla.27.1695129036348; Tue, 19 Sep 2023 06:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695129036; cv=none; d=google.com; s=arc-20160816; b=Kd8qCUwVXK/xbvOJuYO82NkLAMvqvPajnzBqYAUgfQLv6VjyehmBfWRwc8yvTGs1o8 6KIGexxc7tWkSc7K7WgmQVPiksvSb2EQpfjYLfN7j6QOOrOVUvJwpUdbUm1OPuvhAC8U I7geD00Ylts+sgVqkZF3SlOwOtX3JDm/NuSr91DhJHotcW6Il9VxJpV0RXKuON2PS1+K vyNmH4bGMQYHTbDP31t8FH7Fl6T3ow41DEBbKGfJsIU/a8F24wghu+eZEclBslRwX75k MBz+w3urWgIBRtCMBHhF115abl0nUQPGHnkbpg4d1Cbw/hwx9W9E7wypxfy0Lp5SXs1l G0/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=pm7C6TK9aETYA6nzW4d44355zbYJdvIqveZaN5LZwjQ=; fh=2/nRbjhWQCSnJnnTTPUmup8OnPQ2zL219vxmxLxRyD0=; b=CUXkYj0H5X+Wa4eT+sw3cXdGpg8f2dhroPaZeJNa2URkKv+D6vyoU+mmReUj3AqWH5 C/3rhQzVxXaCAwrpIq8n9ofP/xu8u/fxo5dq4SsKUFp3NL09zNGJyZ856iftsr2G5U1X fXAMIzjUT8FLeTRQyzqDyWCMlbtB1R/mTQ9xd9Qfqak3ytIDcP6zy4ey1WgutR/l6gyV y81NE1bj0/Q4jtVEfp1zsK9frOPs1C8TD6R0+q69YZ4GOxcpQRv/t7oj9VZ2914REbGw EBpz5viek26ADwjOPSRZOjn/Jzqj4AV7vrdC1G4xDO4HRszvi+JkGRZeQGEmSnZgHFRW 4vhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=mt+ZQySG; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f6-20020a170902684600b001bbb175a81asi7740428pln.263.2023.09.19.06.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 06:10:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=mt+ZQySG; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 19EDD81716AF; Mon, 18 Sep 2023 17:02:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230333AbjISACc (ORCPT + 99 others); Mon, 18 Sep 2023 20:02:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbjISAC2 (ORCPT ); Mon, 18 Sep 2023 20:02:28 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF5697 for ; Mon, 18 Sep 2023 17:02:13 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A367D222FB; Tue, 19 Sep 2023 00:02:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1695081732; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pm7C6TK9aETYA6nzW4d44355zbYJdvIqveZaN5LZwjQ=; b=mt+ZQySG6YxB+GTwd4Fga/M1ELSplt4H3u9xdV7Wjk/qjCyzDQfWtzn8xAkdEHnypkIsX4 0pnah9jtn0YAnHNkZQQrWKHC1YhChAqBVq+Zo3zJAkYai1YE3qCNvzbrMGhKORd5SW0RbF QMf+cS+SASimWR/uNXFloUqYHOMFS78= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1695081732; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pm7C6TK9aETYA6nzW4d44355zbYJdvIqveZaN5LZwjQ=; b=2FrzxDa3VWnKNDvckikq/7edsGw4EWu2IUMLOETpP8rLgIfwTDVEuHCjHdroDSYOLHc7a9 U3c0s82a0Y+ySSBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 16E3A13A6C; Tue, 19 Sep 2023 00:02:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1QXeLgLlCGX1NwAAMHmgww (envelope-from ); Tue, 19 Sep 2023 00:02:10 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever" Cc: brauner@kernel.org, "Chuck Lever" , linux-nfs@vger.kernel.org Subject: Re: [PATCH v1] SUNRPC: Remove BUG_ON call sites In-reply-to: <169504668787.134583.4338728458451666583.stgit@manet.1015granger.net> References: <169504668787.134583.4338728458451666583.stgit@manet.1015granger.net> Date: Tue, 19 Sep 2023 10:02:07 +1000 Message-id: <169508172758.19404.11033097632795181738@noble.neil.brown.name> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 18 Sep 2023 17:02:37 -0700 (PDT) On Tue, 19 Sep 2023, Chuck Lever wrote: > 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); 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. But Reviewed-by: NeilBrown if you prefer it the way it is. 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); > > > >