Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1c816efa245111c52858fbe55d99474f3c149dd3
Commit:     1c816efa245111c52858fbe55d99474f3c149dd3
Parent:     1b45c46cf75d9c48eb611d5cc41607ac1f046606
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 3 14:41:19 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 23:40:40 2007 -0400

    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: Trond Myklebust <[EMAIL PROTECTED]>
---
 fs/nfs/nfs4state.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index ab0b5ab..ac816b3 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -333,13 +333,10 @@ __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;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to