[PATCH] nfsd4: return better error on io incompatible with open mode
from RFC 3530: "Share reservations are established by OPEN operations and by their nature are mandatory in that when the OPEN denies READ or WRITE operations, that denial results in such operations being rejected with error NFS4ERR_LOCKED." (Note that share_denied is really only a legal error for OPEN.) Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
444c2c07c2
commit
b700949b78
@@ -1295,7 +1295,7 @@ nfs4_share_conflict(struct svc_fh *current_fh, unsigned int deny_type)
|
||||
fp = find_file(ino);
|
||||
if (!fp)
|
||||
return nfs_ok;
|
||||
ret = nfserr_share_denied;
|
||||
ret = nfserr_locked;
|
||||
/* Search for conflicting share reservations */
|
||||
list_for_each_entry(stp, &fp->fi_stateids, st_perfile) {
|
||||
if (test_bit(deny_type, &stp->st_deny_bmap) ||
|
||||
|
Reference in New Issue
Block a user