提交 7aa915d5 编写于 作者: O Olga Kornievskaia 提交者: sanglipeng

pNFS/filelayout: Fix coalescing test for single DS

stable inclusion
from stable-v5.10.165
commit c7c36bb6eafd3f349d2371a1c6f2a3a72400acbc
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7T7G4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c7c36bb6eafd3f349d2371a1c6f2a3a72400acbc

--------------------------------

[ Upstream commit a6b9d2fa ]

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: NOlga Kornievskaia <kolga@netapp.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 d96a1c91
...@@ -783,6 +783,12 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid, ...@@ -783,6 +783,12 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
return &fl->generic_hdr; return &fl->generic_hdr;
} }
static bool
filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg)
{
return flseg->num_fh > 1;
}
/* /*
* filelayout_pg_test(). Called by nfs_can_coalesce_requests() * filelayout_pg_test(). Called by nfs_can_coalesce_requests()
* *
...@@ -803,6 +809,8 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, ...@@ -803,6 +809,8 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
size = pnfs_generic_pg_test(pgio, prev, req); size = pnfs_generic_pg_test(pgio, prev, req);
if (!size) if (!size)
return 0; return 0;
else if (!filelayout_lseg_is_striped(FILELAYOUT_LSEG(pgio->pg_lseg)))
return size;
/* see if req and prev are in the same stripe */ /* see if req and prev are in the same stripe */
if (prev) { if (prev) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册