[PATCH] loop: fixing cryptoloop troubles.

Fruhwirth Clemens
2003-08-10T02:35:57Z

[-- Attachment #1.1: Type: text/plain, Size: 442 bytes --]

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.

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

This should close http://bugme.osdl.org/show_bug.cgi?id=1000

Please confirm.

Regards, Clemens

[-- Attachment #1.2: loop-2.6t2.diff --]
[-- Type: text/plain, Size: 310 bytes --]

--- linux-2.6.0-test2/drivers/block/loop.c~ Sun Jul 27 19:03:16 2003
+++ linux-2.6.0-test2/drivers/block/loop.c Sun Aug 10 04:22:44 2003
@@ -513,6 +513,7 @@
from_bvec->bv_len, IV);
kunmap(from_bvec->bv_page);
kunmap(to_bvec->bv_page);
+ IV += from_bvec->bv_len >> 9;
}

return ret;

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]