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

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