Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1488866rwd; Thu, 15 Jun 2023 11:09:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5XhF27R9U3qmxxs/Iislxwhg76uzHTQLPXOTLoCVeB5/Wx9I66t+TGw85OhJWU4dI90RiK X-Received: by 2002:a17:903:230f:b0:1b3:dc9f:2a71 with SMTP id d15-20020a170903230f00b001b3dc9f2a71mr9700517plh.41.1686852584264; Thu, 15 Jun 2023 11:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686852584; cv=none; d=google.com; s=arc-20160816; b=JtSdvtC//tT7en61gtvmUQ1tVMJaS/t9Q/1wYEC7sgzrFZ7B7Yn8csEoh5SdPe6C15 nT5N5MgxtUaesehWP6kLC2co8fh5CuAuCuHZ/9kFShP8ABlCe57CP/AvH0DHV0Jw4Nz5 nPEBiN/j+ANsXdyhmMQe+xUMZCeKDk0i/E72Nq14HysZcSwcRtr7J82r32dpjs0J/OzV 89AwBmsLRLBDSZfCZaI8GrB5TGRqHZotV/+Twv2klFxnZnTpIjJ921tX5+A101tHyYEc vtY6q7zku/UDsl+bmbrFEC/0qGUcjdUL+ygI5keJJ17MP629xcaWFh7eEcHj+pL4XDjG br7A== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cXP/fyAMAMLW5CMbOwVgpz0k/D1MmC8DxRciC+Dubrw=; b=hCtwSWw5T7ZFvS0BC6CKdj1cBWkSaCuuDbrVzqAdufj7pl79WgxZRSvshfGUCqXnmp GMORnowrSsI1IlPsJnuqPWGuC73l46QUsKre5uCGyVTFTJ5CohnYuIao9JhuyKSBFpEH 3WSqNXD7llXX7gDOt1hTCe+y77VpAU6w20QMo+uvX9zdPMGiNzMA06o9CfnaxnPuJNAc VguQvcFC/+d/YrVkXS4dv+gL7y9n0xC9aF9NJ0EOiIkYxDAt0riLCyjA/gHOhgUlnVfa /0ikx28eEKfCxsix8mXFUSCMr2c1kHaXA+avoHwylb+xatrRnlXBqn5IqNaBZz0rljDU yblQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KypsLRRH; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l14-20020a170903244e00b001b1a2bf4f68si8573406pls.78.2023.06.15.11.09.30; Thu, 15 Jun 2023 11:09:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KypsLRRH; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236693AbjFOSJR (ORCPT + 99 others); Thu, 15 Jun 2023 14:09:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236671AbjFOSJF (ORCPT ); Thu, 15 Jun 2023 14:09:05 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37D4A296A for ; Thu, 15 Jun 2023 11:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686852460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cXP/fyAMAMLW5CMbOwVgpz0k/D1MmC8DxRciC+Dubrw=; b=KypsLRRHidFjkoYQu4wkrifBNAD35Gjmd5qd9vG6eAmVgzKrkIFBa0B+R9ydLV69CbSdym IGtjBgollXSHiUlwQOpAPtg2lYSsl2wdcnc+9NHuagb+oktyfude8/J4R/lbYtYp/whM9z MPwvSxG7xi8M+TcytxKB1/TuDsw15Lk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-317-yIe_T-9wP9WVYyARzc1inA-1; Thu, 15 Jun 2023 14:07:38 -0400 X-MC-Unique: yIe_T-9wP9WVYyARzc1inA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B7EC83C0D84D for ; Thu, 15 Jun 2023 18:07:37 +0000 (UTC) Received: from bcodding.csb.redhat.com (unknown [10.22.50.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A41B2166B25 for ; Thu, 15 Jun 2023 18:07:37 +0000 (UTC) From: Benjamin Coddington To: linux-nfs@vger.kernel.org Subject: [PATCH v4 11/11] NFSv4: Clean up some shutdown loops Date: Thu, 15 Jun 2023 14:07:32 -0400 Message-Id: <16ff132c2f61e4eac1935d0a01f84ba2361fb15c.1686851158.git.bcodding@redhat.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org If a SEQUENCE call receives -EIO for a shutdown client, it will retry the RPC call. Instead of doing that for a shutdown client, just bail out. Likewise, if the state manager decides to perform recovery for a shutdown client, it will continuously retry. As above, just bail out. Signed-off-by: Benjamin Coddington --- fs/nfs/nfs4proc.c | 2 +- fs/nfs/nfs4state.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 40d749f29ed3..a36e35d885c3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -9357,7 +9357,7 @@ static void nfs41_sequence_call_done(struct rpc_task *task, void *data) return; trace_nfs4_sequence(clp, task->tk_status); - if (task->tk_status < 0) { + if (task->tk_status < 0 && !task->tk_client->cl_shutdown) { dprintk("%s ERROR %d\n", __func__, task->tk_status); if (refcount_read(&clp->cl_count) == 1) return; diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 2a0ca5c7f082..ead60d7ed4e9 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1210,6 +1210,9 @@ void nfs4_schedule_state_manager(struct nfs_client *clp) while (cl != cl->cl_parent) cl = cl->cl_parent; + if (clp->cl_rpcclient->cl_shutdown) + return; + set_bit(NFS4CLNT_RUN_MANAGER, &clp->cl_state); if (test_and_set_bit(NFS4CLNT_MANAGER_AVAILABLE, &clp->cl_state) != 0) { wake_up_var(&clp->cl_state); -- 2.40.1