Skip to content

Commit 126966d

Browse files
Trond Myklebustamschuma-ntap
authored andcommitted
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 <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent c6fd351 commit 126966d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/nfs/filelayout/filelayout.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,12 @@ fl_pnfs_update_layout(struct inode *ino,
839839

840840
lseg = pnfs_update_layout(ino, ctx, pos, count, iomode, strict_iomode,
841841
gfp_flags);
842-
if (IS_ERR_OR_NULL(lseg))
842+
if (IS_ERR(lseg)) {
843+
/* Fall back to MDS on recoverable errors */
844+
if (!nfs_error_is_fatal_on_server(PTR_ERR(lseg)))
845+
lseg = NULL;
846+
goto out;
847+
} else if (!lseg)
843848
goto out;
844849

845850
lo = NFS_I(ino)->layout;

0 commit comments

Comments
 (0)