Skip to contentSkip to conversation

FAILED: patch "[PATCH] dm-integrity: don't increment hash_offset twice" failed to apply to 5.10-stable tree

PATCH New [email protected] 2 participants 2 messages Jul 20 – Jul 27

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x edf025f083854f80032b73a1aad69a3c90db236f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026072050-unless-decompose-8395@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From edf025f083854f80032b73a1aad69a3c90db236f Mon Sep 17 00:00:00 2001
From: Mikulas Patocka <[email protected]>
Date: Thu, 9 Jul 2026 21:24:09 +0200
Subject: [PATCH] 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 +0 -3
index 02b2805ed33a..f5508b1bca11 100644
@@ -1480,9 +1480,6 @@ static int dm_integrity_rw_tag(struct dm_integrity_c *ic, unsigned char *tag, se
 			*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));
 
maintainer
#1 lore raw

PATCH 1/1 dm-integrity: don't increment hash_offset twice

From: Mikulas Patocka <[email protected]>

[ Upstream commit edf025f083854f80032b73a1aad69a3c90db236f ]

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 | 4 ----
 1 file changed, 4 deletions(-)
drivers/md/dm-integrity.c +0 -4
index 227ed3b4687323..eb13b98ba0a9c5 100644
@@ -1377,10 +1377,6 @@ static int dm_integrity_rw_tag(struct dm_integrity_c *ic, unsigned char *tag, se
 			*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));
 
Signature · 1 line
2.53.0