* [PATCH v2] md/bitmap: fix missing_pages restore in resize rollback
@ 2026-11-07 17:57 Chengyu Liu
2026-11-11 1:23 ` yu kuai
0 siblings, 1 reply; 2+ messages in thread
From: Chengyu Liu @ 2026-11-07 17:57 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.
Fixes: c9d650322829 ("md-cluster: always setup in-memory bitmap")
Signed-off-by: Chengyu Liu <lui2012qwq@gmail.com>
---
v2: add Fixes tag (spotted by sashiko)
v1: https://lore.kernel.org/linux-raid/20261107164305.11476-1-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] 2+ messages in thread
end of thread, other threads:[~2026-11-11 1:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-07 17:57 [PATCH v2] md/bitmap: fix missing_pages restore in resize rollback Chengyu Liu
2026-11-11 1:23 ` yu kuai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox