summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-11-07 21:10:46 +0300
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2017-11-18 00:43:49 +0300
commite1fff5df6e04818c711882d40f06e97891bca36e (patch)
tree57424fdc97b0746a239c3a995969208259d99966 /fs/nfs
parent46280d9d3de67f64c5bd30a7bbdc372d69f38d98 (diff)
downloadlinux-e1fff5df6e04818c711882d40f06e97891bca36e.tar.xz
NFSv4: nfs_set_open_stateid must not trigger state recovery for closed state
In nfs_set_open_stateid_locked, we must ignore stateids from closed state. Reported-by: Andrew W Elble <aweits@rit.edu> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 1090016a238f..2c9c22579610 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1541,7 +1541,8 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
write_seqlock(&state->seqlock);
}
- if (!nfs4_stateid_match_other(stateid, &state->open_stateid)) {
+ if (test_bit(NFS_OPEN_STATE, &state->flags) &&
+ !nfs4_stateid_match_other(stateid, &state->open_stateid)) {
nfs4_stateid_copy(freeme, &state->open_stateid);
nfs_test_and_clear_all_open_stateid(state);
}