All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm verity fec: fix hash block number in verity_fec_decode
       [not found] <CGME20200410035424epcas1p2d47ca3a171af6a895af17d86e2838269@epcas1p2.samsung.com>
@ 2020-04-10  3:54 ` Sunwook Eom
  2020-04-10 15:41   ` Sami Tolvanen
  0 siblings, 1 reply; 3+ messages in thread
From: Sunwook Eom @ 2020-04-10  3:54 UTC (permalink / raw)
  To: Alasdair Kergon
  Cc: mcneo.kang, device-mapper development, sunwook5492,
	Sami Tolvanen, Mike Snitzer

The error correction data is computed as if data and hash blocks
were concatenated. But hash block number is start 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")
Signed-off-by: Sunwook Eom <speed.eom@samsung.com>
---
  drivers/md/dm-verity-fec.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
2.17.1


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dm verity fec: fix hash block number in verity_fec_decode
  2020-04-10  3:54 ` [PATCH] dm verity fec: fix hash block number in verity_fec_decode Sunwook Eom
@ 2020-04-10 15:41   ` Sami Tolvanen
  2020-04-13  4:31     ` Sunwook Eom
  0 siblings, 1 reply; 3+ messages in thread
From: Sami Tolvanen @ 2020-04-10 15:41 UTC (permalink / raw)
  To: Sunwook Eom
  Cc: 강문철,
	device-mapper development, sunwook5492, Mike Snitzer,
	Alasdair Kergon

On Thu, Apr 9, 2020 at 8:54 PM Sunwook Eom <speed.eom@samsung.com> wrote:
>
> The error correction data is computed as if data and hash blocks
> were concatenated. But hash block number is start 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")
> Signed-off-by: Sunwook Eom <speed.eom@samsung.com>
> ---
>   drivers/md/dm-verity-fec.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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

Thank you for the patch!

Reviewed-by: Sami Tolvanen <samitolvanen@google.com>

Sami

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dm verity fec: fix hash block number in verity_fec_decode
  2020-04-10 15:41   ` Sami Tolvanen
@ 2020-04-13  4:31     ` Sunwook Eom
  0 siblings, 0 replies; 3+ messages in thread
From: Sunwook Eom @ 2020-04-13  4:31 UTC (permalink / raw)
  To: Sami Tolvanen
  Cc: Alasdair Kergon, Mike Snitzer, device-mapper development,
	강문철,
	sunwook5492, LKML


On 20. 4. 11. 오전 12:41, Sami Tolvanen wrote:
> On Thu, Apr 9, 2020 at 8:54 PM Sunwook Eom <speed.eom@samsung.com> wrote:
>> The error correction data is computed as if data and hash blocks
>> were concatenated. But hash block number is start 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")
>> Signed-off-by: Sunwook Eom <speed.eom@samsung.com>
>> ---
>>    drivers/md/dm-verity-fec.c | 2 +-
>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 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
> Thank you for the patch!
>
> Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
>
> Sami
>
>
Add CC : LKML <linux-kernel@vger.kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-13  4:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200410035424epcas1p2d47ca3a171af6a895af17d86e2838269@epcas1p2.samsung.com>
2020-04-10  3:54 ` [PATCH] dm verity fec: fix hash block number in verity_fec_decode Sunwook Eom
2020-04-10 15:41   ` Sami Tolvanen
2020-04-13  4:31     ` Sunwook Eom

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.