mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 01:11:51 -04:00
md/raid5: 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 shrinks sectors_per_chunk used by raid5_bitmap_sector_map(). That can shrink the effective data range covered by each bit across the old and new RAID5 geometry. Reject that reshape while llbitmap is active. Tested-by: Mykola Marzhan <mykola@meshstor.io> Link: https://patch.msgid.link/20260802195038.164272-28-yukuai@kernel.org Signed-off-by: Yu Kuai <yukuai@fygo.io>
This commit is contained in:
@@ -8580,6 +8580,9 @@ static int check_reshape(struct mddev *mddev)
|
||||
if (!check_stripe_cache(mddev))
|
||||
return -ENOSPC;
|
||||
|
||||
if (mddev->bitmap_id == ID_LLBITMAP &&
|
||||
mddev->new_chunk_sectors < mddev->chunk_sectors)
|
||||
return -EOPNOTSUPP;
|
||||
if (mddev->new_chunk_sectors > mddev->chunk_sectors ||
|
||||
mddev->delta_disks > 0)
|
||||
if (resize_chunks(conf,
|
||||
|
||||
Reference in New Issue
Block a user