NFS41: map NFS4ERR_LAYOUTUNAVAILABLE to ENODATA
authorPeng Tao <tao.peng@primarydata.com>
Sat, 5 Dec 2015 09:01:01 +0000 (17:01 +0800)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 28 Dec 2015 19:32:38 +0000 (14:32 -0500)
Instead of mapping it to EIO that is a fatal error and
fails application. We'll go inband after getting
NFS4ERR_LAYOUTUNAVAILABLE.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs4proc.c

index 18d862db15b63a5bed507b6a03e74be64ee16bdb..0065bbdc53c328a63fdd952a11d42e7fe80ac520 100644 (file)
@@ -7795,6 +7795,15 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)
        switch (task->tk_status) {
        case 0:
                goto out;
+
+       /*
+        * NFS4ERR_LAYOUTUNAVAILABLE means we are not supposed to use pnfs
+        * on the file. set tk_status to -ENODATA to tell upper layer to
+        * retry go inband.
+        */
+       case -NFS4ERR_LAYOUTUNAVAILABLE:
+               task->tk_status = -ENODATA;
+               goto out;
        /*
         * NFS4ERR_BADLAYOUT means the MDS cannot return a layout of
         * length lgp->args.minlength != 0 (see RFC5661 section 18.43.3).