[PATCH v4 3/3] drbd: code cleanup by using sendpage_ok() to check page for kernel_sendpage()

2020-08-15 Thread colyli
From: Coly Li In _drbd_send_page() a page is checked by following code before sending it by kernel_sendpage(), (page_count(page) < 1) || PageSlab(page) If the check is true, this page won't be send by kernel_sendpage() and handled by sock_no_sendpage(). This kind of check is exactly what

[PATCH v4 1/3] net: introduce helper sendpage_ok() in include/linux/net.h

2020-08-15 Thread colyli
From: Coly Li The original problem was from nvme-over-tcp code, who mistakenly uses kernel_sendpage() to send pages allocated by __get_free_pages() without __GFP_COMP flag. Such pages don't have refcount (page_count is 0) on tail pages, sending them by kernel_sendpage() may trigger a kernel panic

[PATCH v2 2/3] nvme-tcp: check page by sendpage_ok() before calling kernel_sendpage()

2020-08-15 Thread colyli
From: Coly Li Currently nvme_tcp_try_send_data() doesn't use kernel_sendpage() to send slab pages. But for pages allocated by __get_free_pages() without __GFP_COMP, which also have refcount as 0, they are still sent by kernel_sendpage() to remote end, this is problematic. The new introduced help