diff options
| author | Sagi Grimberg <sagi@grimberg.me> | 2026-05-13 09:58:24 +0300 |
|---|---|---|
| committer | Anna Schumaker <anna.schumaker@hammerspace.com> | 2026-06-08 10:21:55 -0400 |
| commit | 91668417d4e925c98cae4a55b1b9860380ddbf16 (patch) | |
| tree | 3fe1f220cc78b9ac22e6530194f57044e6054f9c /fs/nfs/filelayout/filelayout.c | |
| parent | ea7338471620030582e6a8d3f0fda767fdaee768 (diff) | |
| download | linux-next-91668417d4e925c98cae4a55b1b9860380ddbf16.tar.gz linux-next-91668417d4e925c98cae4a55b1b9860380ddbf16.zip | |
pNFS/filelayout: fix cheking if a layout is striped
A layout can still be striped with num_fh = 1 as it is perfectly possible
that both MDS and DSs can handle the same filehandle. Hence check according
to stripe_count > 1, which is the correct check to begin with.
We should not be called with flseg->dsaddr = NULL, but if for some reason
we do, return our best guess with is flseg->num_fh > 1.
Fixes: a6b9d2fa0024 ("pNFS/filelayout: Fix coalescing test for single DS")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Diffstat (limited to 'fs/nfs/filelayout/filelayout.c')
| -rw-r--r-- | fs/nfs/filelayout/filelayout.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index f0f53f5dc871..72e20b56fbc7 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -778,6 +778,8 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid, static bool filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg) { + if (flseg->dsaddr) + return flseg->dsaddr->stripe_count > 1; return flseg->num_fh > 1; } |
