public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] 2.5.48-bk, md raid0 fix
@ 2002-11-20  1:28 Thorbjørn Lind
  2002-11-20  7:09 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Thorbjørn Lind @ 2002-11-20  1:28 UTC (permalink / raw)
  To: linux-kernel

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)


^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <101840980@toto.iv>]

end of thread, other threads:[~2002-11-21  0:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-20  1:28 [patch] 2.5.48-bk, md raid0 fix Thorbjørn Lind
2002-11-20  7:09 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox