]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dm rq: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments
authorMing Lei <tom.leiming@gmail.com>
Fri, 11 Nov 2016 12:05:36 +0000 (20:05 +0800)
committerMike Snitzer <snitzer@redhat.com>
Mon, 21 Nov 2016 14:51:57 +0000 (09:51 -0500)
Avoid accessing .bi_vcnt directly, because the bio can be split from
block layer and .bi_vcnt should never have been used here.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-rq.c

index 31a89c8832c0ed48e7887930542cc4c8f39ecc10..54b081588b55c44bb11e9a5b8de828cebd1eea33 100644 (file)
@@ -825,7 +825,7 @@ static void dm_old_request_fn(struct request_queue *q)
                        pos = blk_rq_pos(rq);
 
                if ((dm_old_request_peeked_before_merge_deadline(md) &&
-                    md_in_flight(md) && rq->bio && rq->bio->bi_vcnt == 1 &&
+                    md_in_flight(md) && rq->bio && !bio_multiple_segments(rq->bio) &&
                     md->last_rq_pos == pos && md->last_rq_rw == rq_data_dir(rq)) ||
                    (ti->type->busy && ti->type->busy(ti))) {
                        blk_delay_queue(q, 10);