Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2577434rwr; Fri, 21 Apr 2023 10:43:38 -0700 (PDT) X-Google-Smtp-Source: AKy350Yt8vRdS8E/cIa1DeNYaYVH+79iv/4xzw5Y3roOdQwJoJI+u+RxAvmDrWYTNn9FWD3DW0c2 X-Received: by 2002:a17:90b:38c5:b0:247:c85:21f5 with SMTP id nn5-20020a17090b38c500b002470c8521f5mr11621494pjb.19.1682099018401; Fri, 21 Apr 2023 10:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682099018; cv=none; d=google.com; s=arc-20160816; b=oEzxdGbTpp/ri1W5XxRmMNZyO6y7nOl5QeJBQxoB12yejKsN+GbIAxeq7z+XsLyOvg wtpP/FdR7rrK+z5CEpqHId4N5RKiUUgdhIHzqkFTZIP3qsijez8IV0LAvhIGyXnINPyI JhRpLTnjTn9hvOmPkUk+4rjZRhcoYC7GtxYmyHTuGwMhycv/VmhL1MPTOxTWYuQ1f9V1 /7W2x6Ks5MlCSxgsrWGbY6xGorJRzoYCwSKVhtqXj0Ujb3KdutLxWkoW5HgOkJ+OXYv5 kwPOkdxtElCTS27293nKa0NKenEETAOUDWlfjx+5xmq4fSYYYIRRgEt5MSaDaKpz7s/+ 8TCA== 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=PKscJJGRbiQgUaCsPBqkxMCbP1BW8v7pKgvxNq9aXVg=; b=QWymfiAQTlSV0ShzQOctiksdHv6wUtL4kTwg25UxIspFiw8ICgrlmLdm1ZMjimR85e lxTZP6JALhOssceKyY4P81VGdP/BP6C/tnabr0d8ytWF4utIExQVsESklpXZaoxs0QDH SrJEcjbQzaFBCIw1lDCn62/2k9wbtHxaR551PJYVSyiEbIIYalHrsiLSG+JCRYGNYzCn FVbkGbQ5W/+9iFn6FYlXkEvkNaQX7nNPni91EIFcNzdNCx6KtHvhLSdysQxUZf2lfZZD ZqIzm1k6LPgGrf4Exn1gtgCaMgvuz4J9WcB0+rLAYmB/g9HD0cLI7KA4Yhe6PE3xFUXM QTwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DZrgjyAe; 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 o2-20020a634102000000b00524a262e0dbsi5003506pga.738.2023.04.21.10.43.23; Fri, 21 Apr 2023 10:43:38 -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=DZrgjyAe; 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 S232323AbjDURUM (ORCPT + 99 others); Fri, 21 Apr 2023 13:20:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbjDURUL (ORCPT ); Fri, 21 Apr 2023 13:20:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1BC9125BF for ; Fri, 21 Apr 2023 10:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682097527; 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=PKscJJGRbiQgUaCsPBqkxMCbP1BW8v7pKgvxNq9aXVg=; b=DZrgjyAeRVBOPOTerjinzKy1KKhPQsUV2+gaZ3y0sTkXyCuTwkAqHCC6+NsjLWki9plFg6 8WClq3914t7Qg6rbxuFnleGTOYqGGfMoNwOGFat6RmRRH7zwiVpAhXVZuyIezjXGmzpd9n Dykg/2CFkXmpjAWuaMZjHLbvd5cAN+U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-96-TzC5bNR4Of6h705TebM3WQ-1; Fri, 21 Apr 2023 13:18:46 -0400 X-MC-Unique: TzC5bNR4Of6h705TebM3WQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DF149811E7B for ; Fri, 21 Apr 2023 17:18:45 +0000 (UTC) Received: from bcodding.csb.redhat.com (ovpn-0-3.rdu2.redhat.com [10.22.0.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 999D740C201F for ; Fri, 21 Apr 2023 17:18:45 +0000 (UTC) From: Benjamin Coddington To: linux-nfs@vger.kernel.org Subject: [PATCH 9/9] NFSv4: Clean up some shutdown loops Date: Fri, 21 Apr 2023 13:18:39 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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, RCVD_IN_MSPIKE_H2,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.39.2