2005-03-22 05:42:14

by NeilBrown

[permalink] [raw]
Subject: [PATCH kNFSd 3 of 16] nfsd4: fix share conflict tests


In nfs4_check_open():

Move 'is_open_owner' check to be first. Remove continue so as to call
test_share on OPENs with a previously seen open_owner as per rfc3530.

Signed-off-by: Andy Adamson <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
Signed-off-by: Neil Brown <[email protected]>

### Diffstat output
./fs/nfsd/nfs4state.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)

diff ./fs/nfsd/nfs4state.c~current~ ./fs/nfsd/nfs4state.c
--- ./fs/nfsd/nfs4state.c~current~ 2005-03-22 16:35:20.000000000 +1100
+++ ./fs/nfsd/nfs4state.c 2005-03-22 16:36:34.000000000 +1100
@@ -1535,14 +1535,12 @@ nfs4_check_open(struct nfs4_file *fp, st
int status = nfserr_share_denied;

list_for_each_entry(local, &fp->fi_perfile, st_perfile) {
- /* have we seen this open owner */
- if (local->st_stateowner == sop) {
- *stpp = local;
- continue;
- }
/* ignore lock owners */
if (local->st_stateowner->so_is_open_owner == 0)
continue;
+ /* remember if we have seen this open owner */
+ if (local->st_stateowner == sop)
+ *stpp = local;
/* check for conflicting share reservations */
if (!test_share(local, open))
goto out;


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs