Skip to contentSkip to conversation

dm-integrity: don't increment hash_offset twice

PATCH New Mikulas Patocka 1 participant 1 message Jul 9 Device mapper

lore
Share & tools
lore

Mikulas Patocka

author maintainer
#0 lore raw

PATCH 1/1 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.

Assisted-by Claude:claude-opus-4.6
Fixes 84597a44a9d8 ("dm-integrity: dm integrity: add optional discard support")
---
 drivers/md/dm-integrity.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/md/dm-integrity.c +0 -3
Index: linux-2.6/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));