From: Sami Tolvanen Date: Fri, 17 Jun 2016 18:22:03 +0000 (-0700) Subject: ANDROID: dm verity fec: fix RS block calculation X-Git-Tag: firefly_0821_release~176^2~385 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dfe3d7751ae5be130bf07ccde00ceda35d327fc4;p=firefly-linux-kernel-4.4.55.git ANDROID: dm verity fec: fix RS block calculation A call to do_div was changed in Linux 4.5 to div64_u64 in verity_fec_decode, which broke RS block calculation due to incompatible semantics. This change fixes the computation. Bug: 21893453 Change-Id: Idb88b901e0209c2cccc9c0796689f780592d58f9 Signed-off-by: Sami Tolvanen (cherry picked from commit 879aac93eebcc2862d71afa9eca3a0c0f51b3b01) --- diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c index 454535d23a7f..a1e8571ce314 100644 --- a/drivers/md/dm-verity-fec.c +++ b/drivers/md/dm-verity-fec.c @@ -463,9 +463,7 @@ int verity_fec_decode(struct dm_verity *v, struct dm_verity_io *io, */ offset = block << v->data_dev_block_bits; - - res = offset; - div64_u64(res, v->fec->rounds << v->data_dev_block_bits); + res = div64_u64(offset, v->fec->rounds << v->data_dev_block_bits); /* * The base RS block we can feed to the interleaver to find out all