Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3323743rwa; Tue, 23 Aug 2022 02:51:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uo7tIUfcuhMgoUxLQbRXmXkb+QtmNJVATPkVmsgC1LBigm+eZIHoidd9hi4iUZuQj06qY X-Received: by 2002:a17:907:94d2:b0:73b:f1b0:3b74 with SMTP id dn18-20020a17090794d200b0073bf1b03b74mr14663201ejc.158.1661248261984; Tue, 23 Aug 2022 02:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248261; cv=none; d=google.com; s=arc-20160816; b=GDqevDSnll1rb3yEJhhaJukC84LKI/+9v2cpgc/DUnuKLGxeC7tYcdce6PdDZ0jpAf p36sfKZLYkpDQq6ls3ldC7wrSzsT0wU/IRNNk7kp0k/h2ceBdhhRxZYZlzEAoJ5fXhef hJngkVh865JNQveob5LwnZtgheq14ku45yoRRET6ktyemyw6mIScqn7uS/kGScNNCqYs HwuiIJWDZs5bpRHHjQocRg0EMJM/naarGnxjHimtZ+HrN16I4HfwCNl64AE8RvUGlg8O 1PcSw36HZKHCxPmBkaU7GZlGOXhZySQ7CAxx8HwcJ7I2DIxghTLlan2Ya5db2jdkJw9i UUZw== 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=ylGwKpwYzfe7AUD5+Hyq/TPkqkZ4TZSDD3MTl2fu3zE=; b=U34wHlXQvQTkMjlY0CQ1fovE4dfh86j26uGwpg64G/1XR5921aqWfPYkUiKQqoe5JZ VdVZg9gbeLOw7I8EkQgVaurIgMw0Po3XHFVuEldw3ulgwa5MzmJF4I3Jg6gFqRUvUX2e XaSsGKcVu0tKi6R55HDtb2YaPG7tEqypLxAasQxc6ksgAJl2xMpN3Qih4dTLVGrW2A4u X3Gn1UbuaVGEl4KQpitzS+XiTNrhZ+/hkHqpSDCbT2xl0Mmkq/LkR0ekvTAQlHmRMlCB 9jtYlyDcdtf3Jgn6z1U6G9QyhpmsZvt/LNOSbJHK7kuh1CvHOO5gX1usJXnGImQpPTYt ap4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nd+x3dzp; 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 i21-20020a1709064fd500b00732f76a97aasi10584601ejw.899.2022.08.23.02.50.35; Tue, 23 Aug 2022 02:51: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=nd+x3dzp; 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 S243733AbiHWI3Y (ORCPT + 99 others); Tue, 23 Aug 2022 04:29:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243716AbiHWIZu (ORCPT ); Tue, 23 Aug 2022 04:25:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97E7252831; Tue, 23 Aug 2022 01:13:58 -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 ams.source.kernel.org (Postfix) with ESMTPS id 42024B81C20; Tue, 23 Aug 2022 08:13:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78C1AC43141; Tue, 23 Aug 2022 08:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242435; bh=aWL0Z/O80bkDY1YmKqPRMfINCZANIFsBbAcWpD1QGP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nd+x3dzp4FYtDM5VKHpX43id1Y0NBOGSWSXpd5wK4fq178jk0JUwc+8Zcha5z+tLP dDMRCL5UqhLRinhYSNcAhytYUZ8gA5O46USmROYJQTAR9X79Q1Y3BncU89AnGZMznR MD15C0ZBzfaGubUPRRmIzTnDUqqec1pzhc8HKyb0= 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.9 071/101] NFSv4.1: RECLAIM_COMPLETE must handle EACCES Date: Tue, 23 Aug 2022 10:03:44 +0200 Message-Id: <20220823080037.269266210@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080034.579196046@linuxfoundation.org> References: <20220823080034.579196046@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 @@ -8229,6 +8229,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: