Skip to content
Commit 24311f88 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFSv4: Recovery of recalled read delegations is broken



When a read delegation is being recalled, and we're reclaiming the
cached opens, we need to make sure that we only reclaim read-only
modes.
A previous attempt to do this, relied on retrieving the delegation
type from the nfs4_opendata structure. Unfortunately, as Kinglong
pointed out, this field can only be set when performing reboot recovery.

Furthermore, if we call nfs4_open_recover(), then we end up clobbering
the state->flags for all modes that we're not recovering...

The fix is to have the delegation recall code pass this information
to the recovery call, and then refactor the recovery code so that
nfs4_open_delegation_recall() does not need to call nfs4_open_recover().

Reported-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Fixes: 39f897fd

 ("NFSv4: When returning a delegation, don't...")
Tested-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Cc: NeilBrown <neilb@suse.com>
Cc: stable@vger.kernel.org # v4.2+
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 8714d46d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment