diff options
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 13e0e074dbb8..06b89df92218 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2435,13 +2435,13 @@ static struct list_head lockstateid_hashtbl[STATEID_HASH_SIZE]; | |||
2435 | static struct nfs4_stateid * | 2435 | static struct nfs4_stateid * |
2436 | find_stateid(stateid_t *stid, int flags) | 2436 | find_stateid(stateid_t *stid, int flags) |
2437 | { | 2437 | { |
2438 | struct nfs4_stateid *local = NULL; | 2438 | struct nfs4_stateid *local; |
2439 | u32 st_id = stid->si_stateownerid; | 2439 | u32 st_id = stid->si_stateownerid; |
2440 | u32 f_id = stid->si_fileid; | 2440 | u32 f_id = stid->si_fileid; |
2441 | unsigned int hashval; | 2441 | unsigned int hashval; |
2442 | 2442 | ||
2443 | dprintk("NFSD: find_stateid flags 0x%x\n",flags); | 2443 | dprintk("NFSD: find_stateid flags 0x%x\n",flags); |
2444 | if ((flags & LOCK_STATE) || (flags & RD_STATE) || (flags & WR_STATE)) { | 2444 | if (flags & (LOCK_STATE | RD_STATE | WR_STATE)) { |
2445 | hashval = stateid_hashval(st_id, f_id); | 2445 | hashval = stateid_hashval(st_id, f_id); |
2446 | list_for_each_entry(local, &lockstateid_hashtbl[hashval], st_hash) { | 2446 | list_for_each_entry(local, &lockstateid_hashtbl[hashval], st_hash) { |
2447 | if ((local->st_stateid.si_stateownerid == st_id) && | 2447 | if ((local->st_stateid.si_stateownerid == st_id) && |
@@ -2449,7 +2449,8 @@ find_stateid(stateid_t *stid, int flags) | |||
2449 | return local; | 2449 | return local; |
2450 | } | 2450 | } |
2451 | } | 2451 | } |
2452 | if ((flags & OPEN_STATE) || (flags & RD_STATE) || (flags & WR_STATE)) { | 2452 | |
2453 | if (flags & (OPEN_STATE | RD_STATE | WR_STATE)) { | ||
2453 | hashval = stateid_hashval(st_id, f_id); | 2454 | hashval = stateid_hashval(st_id, f_id); |
2454 | list_for_each_entry(local, &stateid_hashtbl[hashval], st_hash) { | 2455 | list_for_each_entry(local, &stateid_hashtbl[hashval], st_hash) { |
2455 | if ((local->st_stateid.si_stateownerid == st_id) && | 2456 | if ((local->st_stateid.si_stateownerid == st_id) && |