Skip to content

Commit 5ee3ac0

Browse files
author
Ming Lei
committed
md/raid0: set chunk_sectors limit
JIRA: https://issues.redhat.com/browse/RHEL-106845 commit 4b8beba Author: John Garry <john.g.garry@oracle.com> Date: Fri Jul 11 10:52:55 2025 +0000 md/raid0: set chunk_sectors limit Currently we use min io size as the chunk size when deciding on the atomic write size limits - see blk_stack_atomic_writes_head(). The limit min_io size is not a reliable value to store the chunk size, as this may be mutated by the block stacking code. Such an example would be for the min io size less than the physical block size, and the min io size is raised to the physical block size - see blk_stack_limits(). The block stacking limits will rely on chunk_sectors in future, so set this value (to the chunk size). Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20250711105258.3135198-4-john.g.garry@oracle.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Ming Lei <ming.lei@redhat.com>
1 parent 906ad93 commit 5ee3ac0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/md/raid0.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ static int raid0_set_limits(struct mddev *mddev)
384384
lim.max_write_zeroes_sectors = mddev->chunk_sectors;
385385
lim.io_min = mddev->chunk_sectors << 9;
386386
lim.io_opt = lim.io_min * mddev->raid_disks;
387+
lim.chunk_sectors = mddev->chunk_sectors;
387388
lim.features |= BLK_FEAT_ATOMIC_WRITES;
388389
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
389390
if (err)

0 commit comments

Comments
 (0)