Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37c15219 authored by Mikhail Skorzhinskii's avatar Mikhail Skorzhinskii Committed by Christoph Hellwig
Browse files

nvme-tcp: don't use sendpage for SLAB pages



According to commit a10674bf ("tcp: detecting the misuse of
.sendpage for Slab objects") and previous discussion, tcp_sendpage
should not be used for pages that is managed by SLAB, as SLAB is not
taking page reference counters into consideration.

Signed-off-by: default avatarMikhail Skorzhinskii <mskorzhinskiy@solarflare.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 958f2a0f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -860,7 +860,14 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_request *req)
		else
			flags |= MSG_MORE;

		ret = kernel_sendpage(queue->sock, page, offset, len, flags);
		/* can't zcopy slab pages */
		if (unlikely(PageSlab(page))) {
			ret = sock_no_sendpage(queue->sock, page, offset, len,
					flags);
		} else {
			ret = kernel_sendpage(queue->sock, page, offset, len,
					flags);
		}
		if (ret <= 0)
			return ret;