All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <htejun@gmail.com>
Subject: [PATCH 001 of 5] Don't update bi_hw_*_size if we aren't going to merge.
Date: Thu, 16 Aug 2007 15:13:32 +1000	[thread overview]
Message-ID: <1070816051332.31325@suse.de> (raw)
In-Reply-To: 20070816150445.30843.patches@notabene


ll_merge_requests_fn can update bi_hw_*_size in one case where we end
up not merging.  This is wrong.

Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./block/ll_rw_blk.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff .prev/block/ll_rw_blk.c ./block/ll_rw_blk.c
--- .prev/block/ll_rw_blk.c	2007-08-16 14:57:39.000000000 +1000
+++ ./block/ll_rw_blk.c	2007-08-16 15:02:29.000000000 +1000
@@ -1518,11 +1518,13 @@ static int ll_merge_requests_fn(struct r
 		/*
 		 * propagate the combined length to the end of the requests
 		 */
+		total_hw_segments--;
+		if (total_hw_segments > q->max_hw_segments)
+			return 0;
 		if (req->nr_hw_segments == 1)
 			req->bio->bi_hw_front_size = len;
 		if (next->nr_hw_segments == 1)
 			next->biotail->bi_hw_back_size = len;
-		total_hw_segments--;
 	}
 
 	if (total_hw_segments > q->max_hw_segments)

  reply	other threads:[~2007-08-16  5:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-16  5:13 [PATCH 000 of 5] Introductory patches for bio refactor NeilBrown
2007-08-16  5:13 ` NeilBrown [this message]
2007-08-16  7:01   ` [PATCH 001 of 5] Don't update bi_hw_*_size if we aren't going to merge Jens Axboe
2007-08-16  5:13 ` [PATCH 002 of 5] Replace bio_data with blk_rq_data NeilBrown
2007-08-16  7:02   ` Jens Axboe
2007-08-16  7:15     ` Neil Brown
2007-08-16  7:21       ` Jens Axboe
2007-08-16 11:15         ` Neil Brown
2007-08-16 11:19           ` Jens Axboe
2007-08-16 11:22           ` Jens Axboe
2007-08-16  5:13 ` [PATCH 003 of 5] Replace bio_cur_sectors with blk_rq_cur_sectors NeilBrown
2007-08-16  5:13 ` [PATCH 004 of 5] Introduce rq_for_each_segment replacing rq_for_each_bio NeilBrown
2007-08-16  5:13 ` [PATCH 005 of 5] Merge blk_recount_segments into blk_recalc_rq_segments NeilBrown
2007-08-16  6:37 ` [PATCH 000 of 5] Introductory patches for bio refactor Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1070816051332.31325@suse.de \
    --to=neilb@suse.de \
    --cc=htejun@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.