mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
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: a6b9d2fa00 ("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>
This commit is contained in:
committed by
Anna Schumaker
parent
ea73384716
commit
91668417d4
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user