Skip to content

Commit a6b9d2f

Browse files
Olga KornievskaiaTrond Myklebust
authored andcommitted
pNFS/filelayout: Fix coalescing test for single DS
When there is a single DS no striping constraints need to be placed on the IO. When such constraint is applied then buffered reads don't coalesce to the DS's rsize. Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent b18cba0 commit a6b9d2f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/nfs/filelayout/filelayout.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,12 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
783783
return &fl->generic_hdr;
784784
}
785785

786+
static bool
787+
filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg)
788+
{
789+
return flseg->num_fh > 1;
790+
}
791+
786792
/*
787793
* filelayout_pg_test(). Called by nfs_can_coalesce_requests()
788794
*
@@ -803,6 +809,8 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
803809
size = pnfs_generic_pg_test(pgio, prev, req);
804810
if (!size)
805811
return 0;
812+
else if (!filelayout_lseg_is_striped(FILELAYOUT_LSEG(pgio->pg_lseg)))
813+
return size;
806814

807815
/* see if req and prev are in the same stripe */
808816
if (prev) {

0 commit comments

Comments
 (0)