提交 1c816efa 编写于 作者: T 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: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 1b45c46c
...@@ -333,13 +333,10 @@ __nfs4_find_state_byowner(struct inode *inode, struct nfs4_state_owner *owner) ...@@ -333,13 +333,10 @@ __nfs4_find_state_byowner(struct inode *inode, struct nfs4_state_owner *owner)
struct nfs4_state *state; struct nfs4_state *state;
list_for_each_entry(state, &nfsi->open_states, inode_states) { list_for_each_entry(state, &nfsi->open_states, inode_states) {
/* Is this in the process of being freed? */ if (state->owner != owner)
if (state->state == 0)
continue; continue;
if (state->owner == owner) { if (atomic_inc_not_zero(&state->count))
atomic_inc(&state->count);
return state; return state;
}
} }
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册