NFSv4: Fix delegation state recovery
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 19 Jul 2019 18:08:37 +0000 (14:08 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Sep 2019 06:22:22 +0000 (08:22 +0200)
commit652993a5aae5ffa1d59188058c07e8f0e5d2461f
treea88eccf00c52904a930019881e712d67ac859f8e
parent5026932adb1a5e862787676a0337aa58fbf91251
NFSv4: Fix delegation state recovery

[ Upstream commit 5eb8d18ca0e001c6055da2b7f30d8f6dca23a44f ]

Once we clear the NFS_DELEGATED_STATE flag, we're telling
nfs_delegation_claim_opens() that we're done recovering all open state
for that stateid, so we really need to ensure that we test for all
open modes that are currently cached and recover them before exiting
nfs4_open_delegation_recall().

Fixes: 24311f884189d ("NFSv4: Recovery of recalled read delegations...")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: stable@vger.kernel.org # v4.3+
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/delegation.c
fs/nfs/delegation.h
fs/nfs/nfs4proc.c