Re: [PATCH v5 24/29] md/raid10: wire llbitmap reshape lifecycle
From: sashiko-bot@kernel.org
Date: 2026-08-02 20:49:06
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Hardcoded check for `ID_LLBITMAP` in `raid10_finish_reshape()` violates the `bitmap_ops` vtable abstraction. --
--- Patch [24]: [PATCH v5 24/29] md/raid10: wire llbitmap reshape lifecycle ---commit 2a0099dd424ef7b25245673edf0ef62577007cc4 Author: Yu Kuai [off-list ref] md/raid10: wire llbitmap reshape lifecycle This commit wires up the llbitmap reshape lifecycle in the RAID10 subsystem. It prepares the bitmap before the array starts growing, checkpoints it during the reshape process, and finalizes the geometry update upon completion.
quoted hunk ↗ jump to hunk
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 1c3393467667b..bac9edd28c974 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -5011,10 +5034,15 @@ static void end_reshape_request(struct r10bio *r10_bio) static void raid10_finish_reshape(struct mddev *mddev) { struct r10conf *conf = mddev->private; + bool llbitmap = mddev->bitmap_id == ID_LLBITMAP && + md_bitmap_enabled(mddev, false); if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) return; + if (llbitmap && mddev->bitmap_ops->reshape_finish) + mddev->bitmap_ops->reshape_finish(mddev); +
[Severity: Low] Does this explicit check for ID_LLBITMAP defeat the purpose of the bitmap_ops vtable abstraction? Earlier in the file during raid10_start_reshape() and end_reshape(), the code relies entirely on checking if the virtual function pointers like reshape_can_start or reshape_mark are set. By hardcoding a check for mddev->bitmap_id == ID_LLBITMAP here, it leaks internal knowledge of which specific bitmap type supports reshape_finish. Would it be better to just rely on mddev->bitmap_ops->reshape_finish being non-NULL, so that any future bitmap type implementing this hook won't be silently bypassed? -- Sashiko AI review · https://sashiko.dev/#/patchset/20260802195038.164272-1-yukuai@kernel.org?part=24