aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-02-01 21:02:07 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2018-05-31 15:03:11 -0400
commit8dc96566c0c34b8c2632bc6071dad208d69dd5b0 (patch)
tree9e6cd721592ecec81794485733d9f9de15877d4d /fs/nfs/pnfs.c
parentNFSv4/pnfs: Ensure pnfs_parse_lgopen() won't try to parse uninitialised data (diff)
downloadlinux-dev-8dc96566c0c34b8c2632bc6071dad208d69dd5b0.tar.xz
linux-dev-8dc96566c0c34b8c2632bc6071dad208d69dd5b0.zip
NFSv4/pnfs: Don't switch off layoutget-on-open for transient errors
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>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 4d3f04d55a65..d5dc97f72b30 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -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;