OSDN Git Service

nbd: only set MSG_MORE when we have more to send
authorJosef Bacik <jbacik@fb.com>
Thu, 19 Jan 2017 21:08:49 +0000 (16:08 -0500)
committerJens Axboe <axboe@fb.com>
Thu, 19 Jan 2017 21:31:50 +0000 (14:31 -0700)
commitd61b7f972dab2a7d187c38254845546dfc8eed85
treec9ee8c99e826639db76b38e5f8ed142e4cb1412f
parent88a7503376f4f3bf303c809d1a389739e1205614
nbd: only set MSG_MORE when we have more to send

A user noticed that write performance was horrible over loopback and we
traced it to an inversion of when we need to set MSG_MORE.  It should be
set when we have more bvec's to send, not when we are on the last bvec.
This patch made the test go from 20 iops to 78k iops.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Fixes: 429a787be679 ("nbd: fix use-after-free of rq/bio in the xmit path")
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nbd.c