
From: Fruhwirth Clemens <clemens-dated-1061346967.29a4@endorphin.org>

In loop_transfer_bio the initial vector has been computed only once. For any
situation where more than one bio_vec is present the initial vector will be
wrong. Here is the trivial but important fix.=20

This will fix the disk corruption problems of cryptoloop for block-backed
loop devices mentioned earlier this month on this list.=20

This should close http://bugme.osdl.org/show_bug.cgi?id=3D1000=20



 drivers/block/loop.c |    1 +
 1 files changed, 1 insertion(+)

diff -puN drivers/block/loop.c~loop-iv-fix drivers/block/loop.c
--- 25/drivers/block/loop.c~loop-iv-fix	2003-08-09 20:52:34.000000000 -0700
+++ 25-akpm/drivers/block/loop.c	2003-08-09 20:52:34.000000000 -0700
@@ -513,6 +513,7 @@ static int loop_transfer_bio(struct loop
 					from_bvec->bv_len, IV);
 		kunmap(from_bvec->bv_page);
 		kunmap(to_bvec->bv_page);
+		IV += from_bvec->bv_len >> 9;
 	}
 
 	return ret;

_
