md/bitmap: fix missing_pages restore in resize rollback
PATCH 1/1 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.
--- drivers/md/md-bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md-bitmap.c +1 -1
@@ -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 =
Signature · 1 line
2.25.1
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] md/bitmap: missing Fixes trailer for commit c9d650322829 --
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 <[email protected]>
Quoted 9 lines
md/bitmap: fix
missing_pagesrestore in resize rollbackThe rollback for a failed clustered-raid bitmap preallocation copies old_counts.pages into
missing_pagesinstead 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 theused_pagesstat in/proc/mdstatwrap around. Accounting only, no corruption.Signed-off-by Chengyu Liu <[email protected]>
[Severity: Low]
Should this include a Fixes tag for the commit that introduced the preallocation rollback in __bitmap_resize()?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 1 line · On Sun, Nov 8, 2026 at 12:53 AM <[email protected]> wrote:
- [Low] md/bitmap: missing Fixes trailer for commit
c9d650322829
Thanks, v2 sent with the Fixes tag.