Skip to content

Commit fa6fec8

Browse files
johnpgarryaxboe
authored andcommitted
md/raid0: Atomic write support
Set BLK_FEAT_ATOMIC_WRITES_STACKED to enable atomic writes. All other stacked device request queue limits should automatically be set properly. With regards to atomic write max bytes limit, this will be set at hw_max_sectors and this is limited by the stripe width, which we want. 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/20241118105018.1870052-4-john.g.garry@oracle.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent d7f36dc commit fa6fec8

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.features |= BLK_FEAT_ATOMIC_WRITES_STACKED;
387388
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
388389
if (err) {
389390
queue_limits_cancel_update(mddev->gendisk->queue);

0 commit comments

Comments
 (0)