Skip to content

Commit

Permalink
NFS41: map NFS4ERR_LAYOUTUNAVAILABLE to ENODATA
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peng Tao authored and Trond Myklebust committed Dec 28, 2015
1 parent d6c843b commit 7c1e6e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 7c1e6e5

Please sign in to comment.