Skip to content

Commit

Permalink
NFSv4/pnfs: Don't switch off layoutget-on-open for transient errors
Browse files Browse the repository at this point in the history
Ensure that we only switch off the LAYOUTGET operation in the OPEN
compound when the server is truly broken, and/or it is complaining
that the compound is too large.
Currently, we end up turning off the functionality permanently,
even for transient errors such as EACCES or ENOSPC.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
trondmypd authored and Trond Myklebust committed May 31, 2018
1 parent d49e0d5 commit 8dc9656
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2111,14 +2111,22 @@ void pnfs_parse_lgopen(struct inode *ino, struct nfs4_layoutget *lgp,
dprintk("%s: entered with status %i\n", __func__, lgp->res.status);
if (lgp->res.status) {
switch (lgp->res.status) {
case -NFS4ERR_DELAY:
case -NFS4ERR_GRACE:
case -NFS4ERR_LAYOUTTRYLATER:
break;
default:
/* FIXME - Any error not listed above permanently
* halts lgopen attempts.
*/
break;
/*
* Halt lgopen attempts if the server doesn't recognise
* the "current stateid" value, the layout type, or the
* layoutget operation as being valid.
* Also if it complains about too many ops in the compound
* or of the request/reply being too big.
*/
case -NFS4ERR_BAD_STATEID:
case -NFS4ERR_NOTSUPP:
case -NFS4ERR_REP_TOO_BIG:
case -NFS4ERR_REP_TOO_BIG_TO_CACHE:
case -NFS4ERR_REQ_TOO_BIG:
case -NFS4ERR_TOO_MANY_OPS:
case -NFS4ERR_UNKNOWN_LAYOUTTYPE:
srv->caps &= ~NFS_CAP_LGOPEN;
}
return;
Expand Down

0 comments on commit 8dc9656

Please sign in to comment.