Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3402116rwa; Tue, 23 Aug 2022 04:18:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR41ThvrR9vLgDnt0y0CMWIsD4Ty0jDSdDG/DAOpkCkVjCmNc9FQ7sPCWlqEsswL827n7LWo X-Received: by 2002:a17:906:f88f:b0:731:463d:4b15 with SMTP id lg15-20020a170906f88f00b00731463d4b15mr16196130ejb.299.1661253481887; Tue, 23 Aug 2022 04:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253481; cv=none; d=google.com; s=arc-20160816; b=c07gL75TYyQl0fsyvnrR6NsSH1gkxlYj5AlG/wRG+sRUOWDEvT1r4U4SZh9SjQonl8 QXORAn1ryyZfZjiHrZ0r3dmMHR4ZT+ora0Ga24TP5cQCR4HQ5q4HDR10CnR53YrXuAR2 yx3M31LTTCGuqx48HjUmqdaagLtUDYKf+AlJj2LMvIXeuJBl08NcOYsUZDaih2SORM5+ fgqv81Zx5GN0kznOm6ZrE2jQ29lSlUhBtdLdpbJ6I9BI+pdNvfdjgv8reNx+508AKPQG WFFwhKzJR0qCkIsjPZUSAD4jQYy4ppeBV0CMIfK/a88u8vshfLReE6fXENPbl/m7RqdD rm/w== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QtDjLjwN7k+Q/iB2B6UotUaxOD/5cgBaVBtY4PekJJ4=; b=JL1sJBFuRdttiptoc3EcWyo1lk5O4klMMm92EeSm8W0IK4QQTWSUXAs6HKfCHBUXWb VDoP0t7h6DD6wLL0iqRZ1Jv7ox846PPGWcneuSmWOVgq3Jv6aMIlmz1qnY3/5ofRTs9z FPYKe8c4e7lbfth+MviS3GtxpEpMd9SPqSrMfF5mkqR4YNz750DdFJDUNc5V2lP6LVVC rIh/OLZVTCdpIuK/o16S47+8C00XQXtSxhmLHWkOVknEDyTKIcac/1jDLI/UBS2Mld/T vt8soNNxR+9a8U9TQAFIE6KiQdsc2F8xka6FQyPhlv5WEtnXb30n52072rL6K/ma1kqz mi6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZOIAnN82; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v19-20020a50d593000000b00441ec11be8esi1694285edi.111.2022.08.23.04.17.35; Tue, 23 Aug 2022 04:18:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=ZOIAnN82; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356810AbiHWKy7 (ORCPT + 99 others); Tue, 23 Aug 2022 06:54:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355685AbiHWKr5 (ORCPT ); Tue, 23 Aug 2022 06:47:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9269F86C18; Tue, 23 Aug 2022 02:12:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2E31E60F85; Tue, 23 Aug 2022 09:12:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F9A7C433D6; Tue, 23 Aug 2022 09:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245919; bh=Q4K1n/gCWk4R0nhTBAqldyQaNxCFu9Nsl2oB7WC7y1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZOIAnN82wYLjoMcd4aUCezzxB1EvcMSgv9qAkTJ5dj3WoBi5Wf9vrPOcF9dw24BO+ TCT7orQYMetlCN/BwoxbyCT0ooL1pyTxLno/lLUsoYW75UHPLfzYqcFCwUfcLZT8WT DOkhBrSbTiRwPys9eFywYt03EGGad7CR2ET3Xvro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Xianwei , Yi Wang , Trond Myklebust Subject: [PATCH 4.19 231/287] NFSv4.1: RECLAIM_COMPLETE must handle EACCES Date: Tue, 23 Aug 2022 10:26:40 +0200 Message-Id: <20220823080108.814584086@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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-kernel@vger.kernel.org From: Zhang Xianwei commit e35a5e782f67ed76a65ad0f23a484444a95f000f upstream. A client should be able to handle getting an EACCES error while doing a mount operation to reclaim state due to NFS4CLNT_RECLAIM_REBOOT being set. If the server returns RPC_AUTH_BADCRED because authentication failed when we execute "exportfs -au", then RECLAIM_COMPLETE will go a wrong way. After mount succeeds, all OPEN call will fail due to an NFS4ERR_GRACE error being returned. This patch is to fix it by resending a RPC request. Signed-off-by: Zhang Xianwei Signed-off-by: Yi Wang Fixes: aa5190d0ed7d ("NFSv4: Kill nfs4_async_handle_error() abuses by NFSv4.1") Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs4proc.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -8701,6 +8701,9 @@ static int nfs41_reclaim_complete_handle rpc_delay(task, NFS4_POLL_RETRY_MAX); /* fall through */ case -NFS4ERR_RETRY_UNCACHED_REP: + case -EACCES: + dprintk("%s: failed to reclaim complete error %d for server %s, retrying\n", + __func__, task->tk_status, clp->cl_hostname); return -EAGAIN; case -NFS4ERR_BADSESSION: case -NFS4ERR_DEADSESSION: