Skip to content

Commit 4b9c2ed

Browse files
chrboeaxboe
authored andcommitted
drbd: swap bvec_set_page len and offset
bvec_set_page has the following signature: static inline void bvec_set_page(struct bio_vec *bv, struct page *page, unsigned int len, unsigned int offset) However, the usage in DRBD swaps the len and offset parameters. This leads to a bvec with length=0 instead of the intended length=4096, which causes sock_sendmsg to return -EIO. This leaves DRBD unable to transmit any pages and thus completely broken. Swapping the parameters fixes the regression. Fixes: eeac740 ("drbd: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage()") Reported-by: Serguei Ivantsov <[email protected]> Link: https://lore.kernel.org/regressions/CAKH+VT3YLmAn0Y8=q37UTDShqxDLsqPcQ4hBMzY7HPn7zNx+RQ@mail.gmail.com/ Cc: [email protected] Signed-off-by: Christoph Böhmwalder <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 5905afc commit 4b9c2ed

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
@@ -1557,7 +1557,7 @@ static int _drbd_send_page(struct drbd_peer_device *peer_device, struct page *pa
15571557
do {
15581558
int sent;
15591559

1560-
bvec_set_page(&bvec, page, offset, len);
1560+
bvec_set_page(&bvec, page, len, offset);
15611561
iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, len);
15621562

15631563
sent = sock_sendmsg(socket, &msg);

0 commit comments

Comments
 (0)