Skip to content

Commit

Permalink
NFSv4: Map NFS4ERR_SHARE_DENIED into an EACCES error instead of EIO
Browse files Browse the repository at this point in the history
If a file OPEN is denied due to a share lock, the resulting
NFS4ERR_SHARE_DENIED is currently mapped to the default EIO.
This patch adds a more appropriate mapping, and brings Linux
into line with what Solaris 10 does.

See https://bugzilla.kernel.org/show_bug.cgi?id=43286

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 28, 2012
1 parent 359d7d1 commit fb13bfa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ static int nfs4_map_errors(int err)
case -NFS4ERR_BADOWNER:
case -NFS4ERR_BADNAME:
return -EINVAL;
case -NFS4ERR_SHARE_DENIED:
return -EACCES;
default:
dprintk("%s could not handle NFSv4 error %d\n",
__func__, -err);
Expand Down

0 comments on commit fb13bfa

Please sign in to comment.