NFSv4.1: RECLAIM_COMPLETE must handle EACCES
authorZhang Xianwei <zhang.xianwei8@zte.com.cn>
Wed, 27 Jul 2022 10:01:07 +0000 (18:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:11:32 +0000 (11:11 +0200)
commit7e5787469419519d8c06034240d818f385c09ea0
treec3c7143ede998124248382462ec3bca3fa3172e1
parent7c9699654ab786b0f21dd889c6eee936ca543007
NFSv4.1: RECLAIM_COMPLETE must handle EACCES

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 <zhang.xianwei8@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Fixes: aa5190d0ed7d ("NFSv4: Kill nfs4_async_handle_error() abuses by NFSv4.1")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c