]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pNFS/flexfiles: Avoid spurious layout returns in ff_layout_choose_ds_for_read
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 16 Dec 2020 19:01:07 +0000 (14:01 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:22:36 +0000 (16:22 +0200)
[ Upstream commit 9bfffea3524b49d0268d01f8e7967f06c4d0a942 ]

The callers of ff_layout_choose_ds_for_read() should decide whether or
not they want to return the layout on error. Sometimes, we may just want
to retry from the beginning.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Stable-dep-of: f06bedfa62d5 ("pNFS/flexfiles: don't attempt pnfs on fatal DS errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/flexfilelayout/flexfilelayout.c

index f8962eaec87bc406f8b45a1bd6954753f540a1af..a053dd05057f2fed2f0379a0e137bccee7d8ba99 100644 (file)
@@ -740,16 +740,12 @@ ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg,
        struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg);
        struct nfs4_ff_layout_mirror *mirror;
        struct nfs4_pnfs_ds *ds;
-       bool fail_return = false;
        u32 idx;
 
        /* mirrors are initially sorted by efficiency */
        for (idx = start_idx; idx < fls->mirror_array_cnt; idx++) {
-               if (idx+1 == fls->mirror_array_cnt)
-                       fail_return = !check_device;
-
                mirror = FF_LAYOUT_COMP(lseg, idx);
-               ds = nfs4_ff_layout_prepare_ds(lseg, mirror, fail_return);
+               ds = nfs4_ff_layout_prepare_ds(lseg, mirror, false);
                if (!ds)
                        continue;