All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Mikulas Patocka <mpatocka@redhat.com>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1.y 5/5] dm-integrity: don't increment hash_offset twice
Date: Mon, 27 Jul 2026 15:50:51 -0400	[thread overview]
Message-ID: <20260727195052.1774404-5-sashal@kernel.org> (raw)
In-Reply-To: <20260727195052.1774404-1-sashal@kernel.org>

From: Mikulas Patocka <mpatocka@redhat.com>

[ Upstream commit edf025f083854f80032b73a1aad69a3c90db236f ]

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 <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-4.6
Fixes: 84597a44a9d8 ("dm-integrity: dm integrity: add optional discard support")
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/md/dm-integrity.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index be4d489269c179..f552c402b3c17e 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -1499,9 +1499,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));
 
-- 
2.53.0


      parent reply	other threads:[~2026-07-27 19:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 15:18 FAILED: patch "[PATCH] dm-integrity: don't increment hash_offset twice" failed to apply to 6.1-stable tree gregkh
2026-07-27 19:50 ` [PATCH 6.1.y 1/5] dm: fix trailing statements Sasha Levin
2026-07-27 19:50   ` [PATCH 6.1.y 2/5] dm crypt: correct 'foo*' to 'foo *' Sasha Levin
2026-07-27 19:50   ` [PATCH 6.1.y 3/5] dm: add missing empty lines Sasha Levin
2026-07-27 19:50   ` [PATCH 6.1.y 4/5] dm: remove unnecessary braces from single statement blocks Sasha Levin
2026-07-27 19:50   ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260727195052.1774404-5-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.