md/raid0: Atomic write support
authorJohn Garry <john.g.garry@oracle.com>
Mon, 18 Nov 2024 10:50:16 +0000 (10:50 +0000)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Nov 2024 17:30:02 +0000 (10:30 -0700)
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>
drivers/md/raid0.c

index baaf5f8..7049ec7 100644 (file)
@@ -384,6 +384,7 @@ static int raid0_set_limits(struct mddev *mddev)
        lim.max_write_zeroes_sectors = mddev->chunk_sectors;
        lim.io_min = mddev->chunk_sectors << 9;
        lim.io_opt = lim.io_min * mddev->raid_disks;
+       lim.features |= BLK_FEAT_ATOMIC_WRITES_STACKED;
        err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
        if (err) {
                queue_limits_cancel_update(mddev->gendisk->queue);