提交 79f2fc4f 编写于 作者: D Dan Aloni 提交者: Yang Yingliang

svcrdma: fix bounce buffers for unaligned offsets and multiple pages

stable inclusion
from linux-4.19.154
commit 95e7b4ee3d35c8d2bca4ad3c3365abdea0bbb71d

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

[ Upstream commit c327a310 ]

This was discovered using O_DIRECT at the client side, with small
unaligned file offsets or IOs that span multiple file pages.

Fixes: e248aa7b ("svcrdma: Remove max_sge check at connect time")
Signed-off-by: NDan Aloni <dan@kernelim.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NAichun Li <liaichun@huawei.com>
Reviewed-by: Nwangxiaopeng <wangxiaopeng7@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 021e6209
......@@ -639,10 +639,11 @@ static int svc_rdma_pull_up_reply_msg(struct svcxprt_rdma *rdma,
while (remaining) {
len = min_t(u32, PAGE_SIZE - pageoff, remaining);
memcpy(dst, page_address(*ppages), len);
memcpy(dst, page_address(*ppages) + pageoff, len);
remaining -= len;
dst += len;
pageoff = 0;
ppages++;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册