Skip to content

Commit

Permalink
NFSv4: nfs_set_open_stateid must not trigger state recovery for close…
Browse files Browse the repository at this point in the history
…d 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>
  • Loading branch information
Trond Myklebust authored and Anna Schumaker committed Nov 17, 2017
1 parent 46280d9 commit e1fff5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e1fff5d

Please sign in to comment.