Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH] md/bitmap: fix missing_pages restore in resize rollback
@ 2026-11-07 16:43 Chengyu Liu
  2026-11-07 16:53 ` sashiko-bot
  0 siblings, 1 reply; 3+ messages in thread
From: Chengyu Liu @ 2026-11-07 16:43 UTC (permalink / raw)
  To: linux-raid; +Cc: song, yukuai, Chengyu Liu

The rollback for a failed clustered-raid bitmap preallocation copies
old_counts.pages into missing_pages instead of old_counts.missing_pages.
The counter then reports every page as missing and can grow past the
page count as pages are freed later, making the used_pages stat in
/proc/mdstat wrap around.  Accounting only, no corruption.

Signed-off-by: Chengyu Liu <lui2012qwq@gmail.com>
---
 drivers/md/md-bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index b8325cb09a37..66ed92a0715b 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -2495,7 +2495,7 @@
 				/* restore some fields from old_counts */
 				bitmap->counts.bp = old_counts.bp;
 				bitmap->counts.pages = old_counts.pages;
-				bitmap->counts.missing_pages = old_counts.pages;
+				bitmap->counts.missing_pages = old_counts.missing_pages;
 				bitmap->counts.chunkshift = old_counts.chunkshift;
 				bitmap->counts.chunks = old_counts.chunks;
 				bitmap->mddev->bitmap_info.chunksize =
-- 
2.25.1

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

* Re: [PATCH] md/bitmap: fix missing_pages restore in resize rollback
  2026-11-07 16:43 [PATCH] md/bitmap: fix missing_pages restore in resize rollback Chengyu Liu
@ 2026-11-07 16:53 ` sashiko-bot
  2026-11-07 17:56   ` Chengyu Liu
  0 siblings, 1 reply; 3+ messages in thread
From: sashiko-bot @ 2026-11-07 16:53 UTC (permalink / raw)
  To: Chengyu Liu, linux-raid; +Cc: yukuai

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] md/bitmap: missing Fixes trailer for commit c9d650322829
--

commit 5db0c6c47a033569a681ebcef85c2c4ea4329e98
Author: Chengyu Liu <lui2012qwq@gmail.com>

> md/bitmap: fix missing_pages restore in resize rollback
>
> The rollback for a failed clustered-raid bitmap preallocation copies
> old_counts.pages into missing_pages instead of old_counts.missing_pages.
> The counter then reports every page as missing and can grow past the
> page count as pages are freed later, making the used_pages stat in
> /proc/mdstat wrap around.  Accounting only, no corruption.
>
> Signed-off-by: Chengyu Liu <lui2012qwq@gmail.com>

[Severity: Low]
Should this include a Fixes tag for the commit that introduced the
preallocation rollback in __bitmap_resize()?

  Fixes: c9d650322829 ("md-cluster: always setup in-memory bitmap")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261107164305.11476-1-lui2012qwq@gmail.com?part=1

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

* Re: [PATCH] md/bitmap: fix missing_pages restore in resize rollback
  2026-11-07 16:53 ` sashiko-bot
@ 2026-11-07 17:56   ` Chengyu Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Chengyu Liu @ 2026-11-07 17:56 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: linux-raid, yukuai

On Sun, Nov 8, 2026 at 12:53 AM <sashiko-bot@kernel.org> wrote:
> - [Low] md/bitmap: missing Fixes trailer for commit c9d650322829

Thanks, v2 sent with the Fixes tag.

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

end of thread, other threads:[~2026-11-07 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-07 16:43 [PATCH] md/bitmap: fix missing_pages restore in resize rollback Chengyu Liu
2026-11-07 16:53 ` sashiko-bot
2026-11-07 17:56   ` Chengyu Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox