public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v13 0/3] md/md-bitmap: restore bitmap grow through sysfs
@ 2026-04-25  2:46 Yu Kuai
  2026-04-25  2:46 ` [PATCH v13 1/3] md: factor bitmap creation away from sysfs handling Yu Kuai
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Yu Kuai @ 2026-04-25  2:46 UTC (permalink / raw)
  To: Song Liu; +Cc: glass.su, Yu Kuai, Li Nan, Xiao Ni, linux-raid, linux-kernel

mdadm --grow adds an internal bitmap by writing bitmap/location for an
array that currently has no bitmap. That requires the bitmap directory
and location attribute to exist before the classic bitmap backend is
created.

This series separates bitmap backend lifetime from bitmap sysfs lifetime,
splits the sysfs layout into common and backend-specific groups, and adds
a small "none" bitmap backend. The none backend keeps bitmap/location
available while no real bitmap is active, and the location store path can
then switch between the none backend and the classic bitmap backend
without tearing down the common bitmap sysfs directory.

Patch 1 factors bitmap creation and destruction into helpers that do not
touch sysfs registration.

Patch 2 splits the classic bitmap sysfs files into a common group and an
internal-bitmap group, and converts bitmap backend operations to use a
sysfs group array.

Patch 3 adds the none backend and uses it to restore mdadm --grow bitmap
addition through bitmap/location.

Changes since v12:
- Keep the factoring patch focused on no-sysfs bitmap lifetime helpers.
- Make bitmap operation lookup depend only on the current bitmap id
  matching the installed backend.
- Trim the none backend to only the operations required by the active
  call paths.
- Rework bitmap/location error handling with explicit cleanup labels.
- Restore the none backend after bitmap removal and creation/load
  failures so bitmap/location stays available.

Validation:
  - create a RAID1 array with --bitmap=none
  - verify /sys/block/md0/md/bitmap/location exists and reports "none"
  - mdadm --grow /dev/md0 --bitmap=internal
  - verify location switches to "+8", mdadm reports "Intent Bitmap:
    Internal", and /proc/mdstat reports a bitmap
  - mdadm --grow /dev/md0 --bitmap=none
  - verify location switches back to "none" and only the common location
    attribute remains under md/bitmap
  - repeat the internal/none switch once more
- Checked the QEMU serial log for panic, Oops, BUG, WARNING, Call Trace,
  RCU stall, and hung-task patterns; none were found.

Yu Kuai (3):
  md: factor bitmap creation away from sysfs handling
  md/md-bitmap: split bitmap sysfs groups
  md/md-bitmap: add a none backend for bitmap grow

 drivers/md/md-bitmap.c   | 131 +++++++++++++++++++++++++++++++++++----
 drivers/md/md-bitmap.h   |   2 +-
 drivers/md/md-llbitmap.c |   7 ++-
 drivers/md/md.c          | 125 ++++++++++++++++++++++++++-----------
 drivers/md/md.h          |   3 +
 5 files changed, 218 insertions(+), 50 deletions(-)

base-commit: c85d314b135ff569c1031f2ef8e40368bcfe72ac
-- 
2.51.0

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

end of thread, other threads:[~2026-04-25  8:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-25  2:46 [PATCH v13 0/3] md/md-bitmap: restore bitmap grow through sysfs Yu Kuai
2026-04-25  2:46 ` [PATCH v13 1/3] md: factor bitmap creation away from sysfs handling Yu Kuai
2026-04-25  8:30   ` Su Yue
2026-04-25  2:46 ` [PATCH v13 2/3] md/md-bitmap: split bitmap sysfs groups Yu Kuai
2026-04-25  8:36   ` Su Yue
2026-04-25  2:46 ` [PATCH v13 3/3] md/md-bitmap: add a none backend for bitmap grow Yu Kuai
2026-04-25  8:39   ` Su Yue
2026-04-25  2:49 ` [PATCH v13 0/3] md/md-bitmap: restore bitmap grow through sysfs Yu Kuai
2026-04-25  8:41 ` Su Yue

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