Skip to content

Commit

Permalink
[PATCH] nfsd4: return better error on io incompatible with open mode
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
Signed-off-by: Neil Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jul 8, 2005
1 parent 444c2c0 commit b700949
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down
1 change: 1 addition & 0 deletions include/linux/nfsd/nfsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ void nfsd_lockd_shutdown(void);
#define nfserr_reclaim_bad __constant_htonl(NFSERR_RECLAIM_BAD)
#define nfserr_badname __constant_htonl(NFSERR_BADNAME)
#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN)
#define nfserr_locked __constant_htonl(NFSERR_LOCKED)

/* error codes for internal use */
/* if a request fails due to kmalloc failure, it gets dropped.
Expand Down

0 comments on commit b700949

Please sign in to comment.