]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFSv4: Map NFS4ERR_SHARE_DENIED into an EACCES error instead of EIO
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 28 May 2012 15:36:28 +0000 (11:36 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 10 Jun 2012 13:41:42 +0000 (14:41 +0100)
commit fb13bfa7e1bcfdcfdece47c24b62f1a1cad957e9 upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfs/nfs4proc.c

index 03d9b9045c253a1fceb3c1b7f5cd5562563b2072..a3cae5d645ba27cd05107bf36d9429e5e377d0a0 100644 (file)
@@ -96,6 +96,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);