summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Kuai <yukuai@fygo.io>2026-08-03 03:50:32 +0800
committerYu Kuai <yukuai@fygo.io>2026-08-07 14:43:35 +0800
commitecb66a97af620135f207cddabeb7f589510640fc (patch)
tree4577cf495329fd4f0bc604d406a0c832f1f966f0
parent3fa5499f32f16133e32c9fb696bc6c0a07483396 (diff)
md/raid10: reject llbitmap reshape when md chunk shrinks
llbitmap reshape keeps one live bitmap and cannot safely make an existing bitmap bit cover a smaller data range. The llbitmap chunksize itself will not shrink when mddev->chunk_sectors stays the same or grows. However, shrinking mddev->chunk_sectors can shrink the effective data range covered by each bit for the RAID10 reshape geometry. Reject that reshape while llbitmap is active. Tested-by: Mykola Marzhan <mykola@meshstor.io> Link: https://patch.msgid.link/20260802195038.164272-24-yukuai@kernel.org Signed-off-by: Yu Kuai <yukuai@fygo.io>
-rw-r--r--drivers/md/raid10.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index ed3c6fbe65f7..1c3393467667 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -4245,6 +4245,10 @@ static int raid10_check_reshape(struct mddev *mddev)
if (conf->geo.far_copies != 1 && !conf->geo.far_offset)
return -EINVAL;
+ if (mddev->bitmap_id == ID_LLBITMAP &&
+ mddev->new_chunk_sectors &&
+ mddev->new_chunk_sectors < mddev->chunk_sectors)
+ return -EOPNOTSUPP;
if (setup_geo(&geo, mddev, geo_start) != conf->copies)
/* mustn't change number of copies */