OSDN Git Service

drbd: swap bvec_set_page len and offset
authorChristoph Böhmwalder <christoph.boehmwalder@linbit.com>
Wed, 6 Sep 2023 13:30:34 +0000 (15:30 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 6 Sep 2023 13:33:03 +0000 (07:33 -0600)
commit4b9c2edaf7282d60e069551b4b28abc2932cd3e3
treec7d7c9f7ae6d82b44a030ca7a3f82654898675ad
parent5905afc2c7bb713d52c7c7585565feecbb686b44
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: eeac7405c735 ("drbd: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage()")
Reported-by: Serguei Ivantsov <manowar@gsc-game.com>
Link: https://lore.kernel.org/regressions/CAKH+VT3YLmAn0Y8=q37UTDShqxDLsqPcQ4hBMzY7HPn7zNx+RQ@mail.gmail.com/
Cc: stable@vger.kernel.org
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20230906133034.948817-1-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_main.c