blk: Fix bio_io_vec index when checking bvec gaps
authorKeith Busch <keith.busch@intel.com>
Tue, 1 Sep 2015 16:46:44 +0000 (10:46 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 1 Sep 2015 17:04:58 +0000 (11:04 -0600)
Corrects a coding error from earlier patch.

Reported by: Sagi Grimberg <sagig@dev.mellanox.co.il>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Fixes: 03100aada96f ("block: Replace SG_GAPS with new queue limits mask")
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-merge.c

index 0e0d9fd..b262527 100644 (file)
@@ -488,7 +488,7 @@ static int req_gap_to_prev(struct request *req, struct bio *next)
        struct bio *prev = req->biotail;
 
        return bvec_gap_to_prev(req->q, &prev->bi_io_vec[prev->bi_vcnt - 1],
-                       next->bi_io_vec[1].bv_offset);
+                       next->bi_io_vec[0].bv_offset);
 }
 
 static int ll_merge_requests_fn(struct request_queue *q, struct request *req,