From: Trond Myklebust Date: Tue, 31 May 2022 15:03:06 +0000 (-0400) Subject: pNFS: Don't keep retrying if the server replied NFS4ERR_LAYOUTUNAVAILABLE X-Git-Tag: v4.14.285~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=290e3215f7ee0bb83c03c64efa3e3912df6021f8;p=thirdparty%2Fkernel%2Fstable.git pNFS: Don't keep retrying if the server replied NFS4ERR_LAYOUTUNAVAILABLE [ Upstream commit fe44fb23d6ccde4c914c44ef74ab8d9d9ba02bea ] If the server tells us that a pNFS layout is not available for a specific file, then we should not keep pounding it with further layoutget requests. Fixes: 183d9e7b112a ("pnfs: rework LAYOUTGET retry handling") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 18bbdaefd9405..962585e00c868 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1878,6 +1878,12 @@ lookup_again: /* Fallthrough */ case -EAGAIN: break; + case -ENODATA: + /* The server returned NFS4ERR_LAYOUTUNAVAILABLE */ + pnfs_layout_set_fail_bit( + lo, pnfs_iomode_to_fail_bit(iomode)); + lseg = NULL; + goto out_put_layout_hdr; default: if (!nfs_error_is_fatal(PTR_ERR(lseg))) { pnfs_layout_clear_fail_bit(lo, pnfs_iomode_to_fail_bit(iomode));