public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Thorbjørn Lind" <mtl@slowbone.net>
To: linux-kernel@vger.kernel.org
Subject: [patch] 2.5.48-bk, md raid0 fix
Date: Wed, 20 Nov 2002 02:28:47 +0100	[thread overview]
Message-ID: <3DDAE54F.4010808@slowbone.net> (raw)

Fixes the 'BUG at drivers/block/ll_rw_blk.c:19xx' when using raid0 md devices since 2.5.45...

/tul

--- a/drivers/md/raid0.c	2002-11-18 05:29:46.000000000 +0100
+++ b/drivers/md/raid0.c	2002-11-20 01:12:08.000000000 +0100
@@ -173,15 +173,14 @@
  static int raid0_mergeable_bvec(request_queue_t *q, struct bio *bio, struct bio_vec *biovec)
  {
  	mddev_t *mddev = q->queuedata;
-	sector_t block;
-	unsigned int chunk_size;
-	unsigned int bio_sz;
-
-	chunk_size = mddev->chunk_size >> 10;
-	block = bio->bi_sector >> 1;
-	bio_sz = (bio->bi_size + biovec->bv_len) >> 10;
-
-	return (chunk_size - ((block & (chunk_size - 1)) + bio_sz)) << 10;
+	unsigned int max_size;
+
+	max_size = mddev->chunk_size - ((bio->bi_sector % (mddev->chunk_size >> 9)) << 9);
+
+	if(biovec->bv_len <= (max_size - bio->bi_size))
+	    return biovec->bv_len;
+
+	return max_size - bio->bi_size;
  }

  static int raid0_run (mddev_t *mddev)


             reply	other threads:[~2002-11-20  1:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20  1:28 Thorbjørn Lind [this message]
2002-11-20  7:09 ` [patch] 2.5.48-bk, md raid0 fix Andrew Morton
2002-11-20  7:38   ` Thorbjørn Lind
2002-11-21  0:36     ` Neil Brown
     [not found] <101840980@toto.iv>
2002-11-20  4:54 ` Peter Chubb
2002-11-20  6:26   ` Thorbjørn Lind

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=3DDAE54F.4010808@slowbone.net \
    --to=mtl@slowbone.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox