aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorGravatar Trond Myklebust <trond.myklebust@hammerspace.com> 2022-05-14 10:08:13 -0400
committerGravatar Anna Schumaker <Anna.Schumaker@Netapp.com> 2022-05-17 12:53:33 -0400
commit126966ddedb60bb7bf9f3b341e26ca8ef1019efc (patch)
tree79629ac7416ee7420b83660b8c1e1155e5512904 /fs/nfs
parentNFS: Further fixes to the writeback error handling (diff)
downloadlinux-126966ddedb60bb7bf9f3b341e26ca8ef1019efc.tar.gz
linux-126966ddedb60bb7bf9f3b341e26ca8ef1019efc.tar.bz2
linux-126966ddedb60bb7bf9f3b341e26ca8ef1019efc.zip
pNFS/files: Fall back to I/O through the MDS on non-fatal layout errors
Only report the error when the server is returning a fatal error, such as ESTALE, EIO, etc... Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/filelayout/filelayout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index 76deddab0a8f..2b2661582bbe 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -839,7 +839,12 @@ fl_pnfs_update_layout(struct inode *ino,
lseg = pnfs_update_layout(ino, ctx, pos, count, iomode, strict_iomode,
gfp_flags);
- if (IS_ERR_OR_NULL(lseg))
+ if (IS_ERR(lseg)) {
+ /* Fall back to MDS on recoverable errors */
+ if (!nfs_error_is_fatal_on_server(PTR_ERR(lseg)))
+ lseg = NULL;
+ goto out;
+ } else if (!lseg)
goto out;
lo = NFS_I(ino)->layout;