Commit 1c816efa authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Fix a bug in __nfs4_find_state_byowner

The test for state->state == 0 does not tell you that the stateid is in the
process of being freed. It really tells you that the stateid is not yet
initialised...
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 1b45c46c
......@@ -333,14 +333,11 @@ __nfs4_find_state_byowner(struct inode *inode, struct nfs4_state_owner *owner)
struct nfs4_state *state;
list_for_each_entry(state, &nfsi->open_states, inode_states) {
/* Is this in the process of being freed? */
if (state->state == 0)
if (state->owner != owner)
continue;
if (state->owner == owner) {
atomic_inc(&state->count);
if (atomic_inc_not_zero(&state->count))
return state;
}
}
return NULL;
}
......
Markdown is supported
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