]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSv4/flexfiles: Fix layout merge mirror check.
authorJonathan Curley <jcurley@purestorage.com>
Mon, 8 Sep 2025 17:35:16 +0000 (17:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:32:02 +0000 (16:32 +0200)
[ Upstream commit dd2fa82473453661d12723c46c9f43d9876a7efd ]

Typo in ff_lseg_match_mirrors makes the diff ineffective. This results
in merge happening all the time. Merge happening all the time is
problematic because it marks lsegs invalid. Marking lsegs invalid
causes all outstanding IO to get restarted with EAGAIN and connections
to get closed.

Closing connections constantly triggers race conditions in the RDMA
implementation...

Fixes: 660d1eb22301c ("pNFS/flexfile: Don't merge layout segments if the mirrors don't match")
Signed-off-by: Jonathan Curley <jcurley@purestorage.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/flexfilelayout/flexfilelayout.c

index b05dd4d3ed6537e7df7af77d32f835a5bb9bd65b..42c73c647a27fe2ec93018d8b216aa6478c3ce37 100644 (file)
@@ -276,7 +276,7 @@ ff_lseg_match_mirrors(struct pnfs_layout_segment *l1,
                struct pnfs_layout_segment *l2)
 {
        const struct nfs4_ff_layout_segment *fl1 = FF_LAYOUT_LSEG(l1);
-       const struct nfs4_ff_layout_segment *fl2 = FF_LAYOUT_LSEG(l1);
+       const struct nfs4_ff_layout_segment *fl2 = FF_LAYOUT_LSEG(l2);
        u32 i;
 
        if (fl1->mirror_array_cnt != fl2->mirror_array_cnt)