Explorar o código

dm rq: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments

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>
Ming Lei %!s(int64=8) %!d(string=hai) anos
pai
achega
4f9c74c604
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/md/dm-rq.c

+ 1 - 1
drivers/md/dm-rq.c

@@ -825,7 +825,7 @@ static void dm_old_request_fn(struct request_queue *q)
 			pos = blk_rq_pos(rq);
 			pos = blk_rq_pos(rq);
 
 
 		if ((dm_old_request_peeked_before_merge_deadline(md) &&
 		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)) ||
 		     md->last_rq_pos == pos && md->last_rq_rw == rq_data_dir(rq)) ||
 		    (ti->type->busy && ti->type->busy(ti))) {
 		    (ti->type->busy && ti->type->busy(ti))) {
 			blk_delay_queue(q, 10);
 			blk_delay_queue(q, 10);