Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2539582rwr; Fri, 21 Apr 2023 10:10:51 -0700 (PDT) X-Google-Smtp-Source: AKy350YETkXA1jgg0qAsZlEgyUceO0GBXxR3FvLbVndJOiEkEFA4YCc+vVk3HxQhDj5tpOIR74MY X-Received: by 2002:a92:c68f:0:b0:317:9af1:5b8f with SMTP id o15-20020a92c68f000000b003179af15b8fmr4524574ilg.21.1682097051230; Fri, 21 Apr 2023 10:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682097051; cv=none; d=google.com; s=arc-20160816; b=DMQF9Zez5Y9Jg5PmJAE3/hUKqbcT4aZReDhPnpXSJE6dV0JEFXgqvi1eoabGQTl/B6 2/KFGE4ny35r85fofNZOHVTCAkSIxyNMo7qERYOsToSXM1tzJvFTpY4C/uTEC9hi5lGw UsF+XFN2xNOLRLfYmJrQpOUZ5sbGbgJSs/F2rXXTnuPknyr2mw3cGsIvdjhCEgkbcfii Yec7ahF0QdELQzbmKlb5SpSjrStYCM6EB6UDDuI7sjQFbdZHgZmKk4bt2niIQqu3fbKY o+8p8WfF+8Ye5avC/Xxaz8tP8B+9gBxxaDiBI7+mbUGHG34E8nvE7z1eXVLMxIkfo4bY I1dA== 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=ethrqsNDJbce/pd6mDiBUVo/gEjhteyCZz5HB+vKCh4=; b=gZ4hzyp6oE9f7zgeG+h7Mtk6Cb5iubAUQ7xn01f+fB+YOzhTVYoSKZDL0woaIOGsoP euu0+H6U2HM45H/zS3mLrLOZ9XOptj/dELBJ8bkvkx1nBi0kSXASteujSADmC6+iL1/4 BuAVgm7paM8hlDah/n9c3SGm47nl8rTgmCTYmFUH4fet2sJTR0W369jdc6dvUxL1dFcV OlODKw7PCF38arzB+An2P4M+mnVJKjDr34FuHNtvpwQNFbsOenO2+PgxWtcB1l+nXCha 1Wsh5sSH53SsKOh7ni9Z02SwCyRyQBH6Kq9+q4e4OlknOu1U6On9GaUzEUf1RE77ou99 gwHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WyrcAvnQ; 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 r13-20020a92d44d000000b00326309db713si4239214ilm.84.2023.04.21.10.10.37; Fri, 21 Apr 2023 10:10:51 -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=WyrcAvnQ; 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 S233331AbjDURJ3 (ORCPT + 99 others); Fri, 21 Apr 2023 13:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233277AbjDURJ2 (ORCPT ); Fri, 21 Apr 2023 13:09:28 -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 371E116B07 for ; Fri, 21 Apr 2023 10:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682096901; 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=ethrqsNDJbce/pd6mDiBUVo/gEjhteyCZz5HB+vKCh4=; b=WyrcAvnQZoaF8pySN9oTVjHn0mt1jGst21bYSi12/QaCE+VYFvJAXRIy51smEwa1ru3o+B zY6hZP7AjkWi9PHOEPdpbZtmHRTiKnnF6veSazyzTOTXjd5pRNbIAykuzZDwUo+oIk023B grHH886VUQRuInQVk7Rt1GoHpbih3kc= 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-191-wiOtJi6YM1OFOu5GtY5Yyg-1; Fri, 21 Apr 2023 13:08:19 -0400 X-MC-Unique: wiOtJi6YM1OFOu5GtY5Yyg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 765913C0F689 for ; Fri, 21 Apr 2023 17:08:19 +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 1FEE2492C14 for ; Fri, 21 Apr 2023 17:08:18 +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:08:12 -0400 Message-Id: <84e78ef0afd919a5fbebbbc2b670f447c264b436.1682096307.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.9 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 f8afd75e520d..039a3b4ae565 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1206,6 +1206,9 @@ void nfs4_schedule_state_manager(struct nfs_client *clp) struct task_struct *task; char buf[INET6_ADDRSTRLEN + sizeof("-manager") + 1]; + 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