]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix another dm and bio problem
authorAndrew Morton <akpm@osdl.org>
Tue, 30 Dec 2003 07:47:20 +0000 (23:47 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 30 Dec 2003 07:47:20 +0000 (23:47 -0800)
From: Mark Haverkamp <markh@osdl.org>

This fixes a problem similar to the patch I submitted on 11/20

http://marc.theaimsgroup.com/?l=linux-kernel&m=106936439707962&w=2

In this case, though, the result is an:

"Incorrect number of segments after building list" message.

The macro __BVEC_START assumes a bi_idx of zero when the dm code can
submit a bio with a non-zero bi_idx.
The code has been tested on an 8 way / 8gb OSDL STP machine with a 197G
lvm volume running dbt2 test.

include/linux/bio.h

index 0ac6a27ea0dbeed8af58fc162a55b1dd3988b346..4f090059372ed4f2fa31e7c333d4d82be5a94d70 100644 (file)
@@ -162,7 +162,7 @@ struct bio {
  */
 
 #define __BVEC_END(bio)                bio_iovec_idx((bio), (bio)->bi_vcnt - 1)
-#define __BVEC_START(bio)      bio_iovec_idx((bio), 0)
+#define __BVEC_START(bio)      bio_iovec_idx((bio), (bio)->bi_idx)
 #define BIOVEC_PHYS_MERGEABLE(vec1, vec2)      \
        ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
 #define BIOVEC_VIRT_MERGEABLE(vec1, vec2)      \