Skip to content

Commit 7960af3

Browse files
ofirgallaxboe
authored andcommitted
drbd: use sendpages_ok() instead of sendpage_ok()
Currently _drbd_send_page() use sendpage_ok() in order to enable MSG_SPLICE_PAGES, it check the first page of the iterator, the iterator may represent contiguous pages. MSG_SPLICE_PAGES enables skb_splice_from_iter() which checks all the pages it sends with sendpage_ok(). When _drbd_send_page() sends an iterator that the first page is sendable, but one of the other pages isn't skb_splice_from_iter() warns and aborts the data transfer. Using the new helper sendpages_ok() in order to enable MSG_SPLICE_PAGES solves the issue. Acked-by: Christoph Böhmwalder <[email protected]> Signed-off-by: Ofir Gal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 6af7331 commit 7960af3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/drbd/drbd_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ static int _drbd_send_page(struct drbd_peer_device *peer_device, struct page *pa
15501550
* put_page(); and would cause either a VM_BUG directly, or
15511551
* __page_cache_release a page that would actually still be referenced
15521552
* by someone, leading to some obscure delayed Oops somewhere else. */
1553-
if (!drbd_disable_sendpage && sendpage_ok(page))
1553+
if (!drbd_disable_sendpage && sendpages_ok(page, len, offset))
15541554
msg.msg_flags |= MSG_NOSIGNAL | MSG_SPLICE_PAGES;
15551555

15561556
drbd_update_congested(peer_device->connection);

0 commit comments

Comments
 (0)