Commit 2095cf55 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull rdma fix from Jason Gunthorpe:
 "Single fix to correct the iov_iter construction in soft iwarp. This
  avoids blktest crashes with recent changes to the allocators"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  RDMA/siw: Fix the sendmsg byte count in siw_tcp_sendpages
parents e8214ed5 c1864624
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -340,18 +340,17 @@ static int siw_tcp_sendpages(struct socket *s, struct page **page, int offset,
		if (!sendpage_ok(page[i]))
			msg.msg_flags &= ~MSG_SPLICE_PAGES;
		bvec_set_page(&bvec, page[i], bytes, offset);
		iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, size);
		iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, bytes);

try_page_again:
		lock_sock(sk);
		rv = tcp_sendmsg_locked(sk, &msg, size);
		rv = tcp_sendmsg_locked(sk, &msg, bytes);
		release_sock(sk);

		if (rv > 0) {
			size -= rv;
			sent += rv;
			if (rv != bytes) {
				offset += rv;
				bytes -= rv;
				goto try_page_again;
			}