Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519744

[PATCH 08/12] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments

From Ming Lei <tom.leiming@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 08/12] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments
Date 2016-11-11 13:10 +0100
Message-ID <sCiOC-48t-35@gated-at.bofh.it> (permalink)
References <sCiOC-48t-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Avoid to access .bi_vcnt directly, because the bio can be
splitted from block layer, and .bi_vcnt should never have
been used here.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 drivers/md/dm-rq.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index b2a9e2d161e4..d9cc8324e597 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -797,8 +797,13 @@ static void dm_old_request_fn(struct request_queue *q)
 		if (req_op(rq) != REQ_OP_FLUSH)
 			pos = blk_rq_pos(rq);
 
+		/*
+		 * bio can be splitted from block layer, so use
+		 * !bio_multiple_segments instead of 'bio->bi_vcnt == 1'
+		 */
 		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);
-- 
2.7.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 08/12] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Ming Lei <tom.leiming@gmail.com> - 2016-11-11 13:10 +0100
  Re: [PATCH 08/12] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Ming Lei <tom.leiming@gmail.com> - 2016-11-15 02:10 +0100
  Re: [PATCH 08/12] dm: dm.c: replace 'bio->bi_vcnt == 1' with  !bio_multiple_segments Mike Snitzer <snitzer@redhat.com> - 2016-11-21 16:00 +0100

csiph-web