From: Mikulas Patocka Date: Thu, 9 Jul 2026 19:24:09 +0000 (+0200) Subject: dm-integrity: don't increment hash_offset twice X-Git-Tag: v7.2-rc3~11^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=edf025f083854f80032b73a1aad69a3c90db236f;p=thirdparty%2Fkernel%2Flinux.git dm-integrity: don't increment hash_offset twice hash_offset is already incremented in the loop "for (i = 0; i < to_copy; i++, ts--)". Do not increment it again. Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-4.6 Fixes: 84597a44a9d8 ("dm-integrity: dm integrity: add optional discard support") Cc: stable@vger.kernel.org --- diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 02b2805ed33a..f5508b1bca11 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -1480,9 +1480,6 @@ thorough_test: *metadata_offset = 0; } - if (unlikely(!is_power_of_2(ic->tag_size))) - hash_offset = (hash_offset + to_copy) % ic->tag_size; - total_size -= to_copy; } while (unlikely(total_size));