Commit 17fbcdf9 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfsd-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux

Pull nfsd fix from Chuck Lever:
 "Fix non-page-aligned NFS READs"

* tag 'nfsd-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
  SUNRPC: Fix NFS READs that start at non-page-aligned offsets
parents 6157ce59 bad4c6eb
...@@ -1113,14 +1113,15 @@ static int svc_tcp_sendmsg(struct socket *sock, struct msghdr *msg, ...@@ -1113,14 +1113,15 @@ static int svc_tcp_sendmsg(struct socket *sock, struct msghdr *msg,
unsigned int offset, len, remaining; unsigned int offset, len, remaining;
struct bio_vec *bvec; struct bio_vec *bvec;
bvec = xdr->bvec; bvec = xdr->bvec + (xdr->page_base >> PAGE_SHIFT);
offset = xdr->page_base; offset = offset_in_page(xdr->page_base);
remaining = xdr->page_len; remaining = xdr->page_len;
flags = MSG_MORE | MSG_SENDPAGE_NOTLAST; flags = MSG_MORE | MSG_SENDPAGE_NOTLAST;
while (remaining > 0) { while (remaining > 0) {
if (remaining <= PAGE_SIZE && tail->iov_len == 0) if (remaining <= PAGE_SIZE && tail->iov_len == 0)
flags = 0; flags = 0;
len = min(remaining, bvec->bv_len);
len = min(remaining, bvec->bv_len - offset);
ret = kernel_sendpage(sock, bvec->bv_page, ret = kernel_sendpage(sock, bvec->bv_page,
bvec->bv_offset + offset, bvec->bv_offset + offset,
len, flags); len, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment