Skip to content

Commit e1fff5d

Browse files
trondmypdamschuma-ntap
authored andcommitted
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>
1 parent 46280d9 commit e1fff5d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/nfs/nfs4proc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,8 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
15411541
write_seqlock(&state->seqlock);
15421542
}
15431543

1544-
if (!nfs4_stateid_match_other(stateid, &state->open_stateid)) {
1544+
if (test_bit(NFS_OPEN_STATE, &state->flags) &&
1545+
!nfs4_stateid_match_other(stateid, &state->open_stateid)) {
15451546
nfs4_stateid_copy(freeme, &state->open_stateid);
15461547
nfs_test_and_clear_all_open_stateid(state);
15471548
}

0 commit comments

Comments
 (0)