]> git.baikalelectronics.ru Git - kernel.git/commit
NFSv4: Recovery of recalled read delegations is broken
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 20 Sep 2015 14:50:17 +0000 (10:50 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 21 Sep 2015 02:34:16 +0000 (22:34 -0400)
commit738d499cf8f8860d042846b3cd337afeaaf929d0
tree298a5debe9cfe0397ce289f10e6bf533fe5f8df4
parente7fe82047535ea2a8048314532fcfbdaf1dfdd7d
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: Kinglong Mee <kinglongmee@gmail.com>
Fixes: 6863d5affc11 ("NFSv4: When returning a delegation, don't...")
Tested-by: Kinglong Mee <kinglongmee@gmail.com>
Cc: NeilBrown <neilb@suse.com>
Cc: stable@vger.kernel.org # v4.2+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/delegation.c
fs/nfs/delegation.h
fs/nfs/nfs4proc.c