[patch] 2.5.48-bk, md raid0 fix

From: Peter Chubb (peter@chubb.wattle.id.au)
Date: Tue Nov 19 2002 - 23:54:08 EST


>>>>> "Thorbjørn" == Thorbjørn Lind <mtl@slowbone.net> writes:

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

Your patch won't work if CONFIG_LBD is on. I haven't seen this bug
reported since the raid0_mergeable_bvec() function went in.

Are you not using power-of-two sized chunks? If not, use the
sector_div() macro to do the remainder, not a direct remainder
operation (which will fail to link if CONFIG_LBD on IA32)

You could try ... (untested)
--- /tmp/geta22599 2002-11-20 15:48:17.000000000 +1100
+++ raid0.c 2002-11-20 15:46:11.000000000 +1100
@@ -163,7 +163,7 @@
 }
 
 /**
- * raid0_mergeable_bvec -- tell bio layer if a two requests can be merged
+ * raid0_mergeable_bvec -- tell bio layer if two requests can be merged
  * @q: request queue
  * @bio: the buffer head that's been built up so far
  * @biovec: the request that could be merged to it.
@@ -181,7 +181,7 @@
        block = bio->bi_sector >> 1;
        bio_sz = (bio->bi_size + biovec->bv_len) >> 10;
 
- return (chunk_size - ((block & (chunk_size - 1)) + bio_sz)) << 10;
+ return (chunk_size - (sector_div(block, chunk_size) + bio_sz))
<< 10;
 }
 

--
Dr Peter Chubb				    peterc@gelato.unsw.edu.au
You are lost in a maze of BitKeeper repositories, all almost the same.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Nov 23 2002 - 22:00:30 EST