summaryrefslogtreecommitdiff
path: root/drivers/md/dm-verity-fec.c
diff options
context:
space:
mode:
authorSunwook Eom <speed.eom@samsung.com>2020-04-10 12:54:19 +0900
committerMike Snitzer <snitzer@redhat.com>2020-04-16 16:16:38 -0400
commitad4e80a639fc61d5ecebb03caa5cdbfb91fcebfc (patch)
tree5bf4863ee8befc893f0b283bc5bc198f9886086e /drivers/md/dm-verity-fec.c
parent31b22120194b5c0d460f59e0c98504de1d3f1f14 (diff)
downloadlwn-ad4e80a639fc61d5ecebb03caa5cdbfb91fcebfc.tar.gz
lwn-ad4e80a639fc61d5ecebb03caa5cdbfb91fcebfc.zip
dm verity fec: fix hash block number in verity_fec_decode
The error correction data is computed as if data and hash blocks were concatenated. But hash block number starts from v->hash_start. So, we have to calculate hash block number based on that. Fixes: a739ff3f543af ("dm verity: add support for forward error correction") Cc: stable@vger.kernel.org Signed-off-by: Sunwook Eom <speed.eom@samsung.com> Reviewed-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-verity-fec.c')
-rw-r--r--drivers/md/dm-verity-fec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c
index 49147e634046..fb41b4f23c48 100644
--- a/drivers/md/dm-verity-fec.c
+++ b/drivers/md/dm-verity-fec.c
@@ -435,7 +435,7 @@ int verity_fec_decode(struct dm_verity *v, struct dm_verity_io *io,
fio->level++;
if (type == DM_VERITY_BLOCK_TYPE_METADATA)
- block += v->data_blocks;
+ block = block - v->hash_start + v->data_blocks;
/*
* For RS(M, N), the continuous FEC data is divided into blocks of N