md/md-llbitmap: don't skip reshape ranges from bitmap state

Reshape progress is tracked by array metadata rather than llbitmap.
Do not let llbitmap skip_sync_blocks() suppress reshape ranges based on
stale bitmap state before the corresponding checkpoint is persisted.

Tested-by: Mykola Marzhan <mykola@meshstor.io>
Link: https://patch.msgid.link/20260802195038.164272-21-yukuai@kernel.org
Signed-off-by: Yu Kuai <yukuai@fygo.io>
This commit is contained in:
Yu Kuai
2026-08-03 03:50:29 +08:00
parent 629c1659e9
commit 44aa6154e1

View File

@@ -1707,6 +1707,14 @@ static sector_t llbitmap_skip_sync_blocks(struct mddev *mddev, sector_t offset)
return 0;
c = llbitmap_read(llbitmap, p);
/*
* Reshape progress is tracked by array metadata rather than llbitmap.
* Skipping reshape ranges from stale bitmap state can lose data after a
* restart before the corresponding bits are checkpointed to disk.
*/
if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
return 0;
/* always skip unwritten blocks */
if (c == BitUnwritten)
return blocks;