Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3473754rwa; Tue, 23 Aug 2022 05:28:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR734omPGHtIMuxBPY5gAILi/rROCQZWowA239EqSVrMicA5FikWROOBmV7hJiOVmh7BaZ+7 X-Received: by 2002:a17:90b:1a85:b0:1fb:1f0b:dd43 with SMTP id ng5-20020a17090b1a8500b001fb1f0bdd43mr3106145pjb.213.1661257698441; Tue, 23 Aug 2022 05:28:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257698; cv=none; d=google.com; s=arc-20160816; b=ncwieSMVo/p3qP1kY8AzObfY+01fAxKQ8Q1JAox0tJDtACsziddFHwfQNkHCQGh8hC zEc867uHBXCOTlpHfkWkrctmikR1Ma4nvD26LtWBEMgAVmEx1fvKM2Hj2Pigfved5/ez RHHQyXSJ243yVMq55xQv1tyfVqc68QYIb3egB7Rn1Wf5DC//Vq+Ilr8BlY3UpL9AQi8z 6UzreuAZP88BAWfyP1S460FHDL5H1K11qw1vh47nIGePt/p9wnxYVrIVOf7Y879JUbTJ 8141R2FrhWYV/GC6+KnAxt2csPpHh+niWVcs25vdFNETT2bzTs6sC4lN9LtNa6xn9rC/ H7yw== 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=CpSKm0G55eMv9iDFRZ4pppi4sul77EhbyZwb5DN01Ig=; b=ASf/tqg60u5dtM9jNCJDApidyM03ir1q1b3JCcj3wZx3Aa9kM8P57JfZSbr/xCzPlX eQBrp+0QoScwwciVYQJRhx2PL8/lhirz6i8dfd1wupZAjVE6NrBWUF+5eDaa5dUEdQTO eOSDzUhrmwMUc3e8f7S+fUqmAv8UI1D+9bpJ2Ws7Eo/zJJbtXZTTK8j5SB2dv2+YXYK8 DdQh2GiDSh3YGb/mcGH8l0q7zZktLIT3eQ7E+zMovZeZoynLVJ7gL8a4PxJgbluxPOSY F5arrbNqFKNCOdndX9akBcbDVG8FZJmXTySHd0r91aM26yBgrnnY9DuLWJhyyABs0byZ aH+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y91aMxgn; 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 s16-20020aa78d50000000b0052ab37ed70asi2776661pfe.57.2022.08.23.05.28.07; Tue, 23 Aug 2022 05:28:18 -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=Y91aMxgn; 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 S1353435AbiHWKNf (ORCPT + 99 others); Tue, 23 Aug 2022 06:13:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352739AbiHWKGN (ORCPT ); Tue, 23 Aug 2022 06:06:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761CD7D1E0; Tue, 23 Aug 2022 01:52:42 -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 022DDB81C1C; Tue, 23 Aug 2022 08:52:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53EAEC433C1; Tue, 23 Aug 2022 08:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244759; bh=3kW5zkmIQhfzV/FZ21DIxuwrovQVfGfLbePBlM5UX/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y91aMxgnjtKzO995JZfL7goBKWQOlG8elAK6yYuZXOuIIp59JVHqcuryv90+6YlWj kyQVayRVXLgLM7nFjBl395iHNlT4c6CGZfor2MOqmgH38WgSIXu4VaHSKRJcLq80jy vsRZ1xN2CECiaXeziSORaLCPXXjE5LDHlfTkLI9s= 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.14 186/229] NFSv4.1: RECLAIM_COMPLETE must handle EACCES Date: Tue, 23 Aug 2022 10:25:47 +0200 Message-Id: <20220823080100.258722355@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 @@ -8371,6 +8371,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: