Skip to content

Commit

Permalink
md/raid*: Fix the set_queue_limits implementations
Browse files Browse the repository at this point in the history
queue_limits_cancel_update() must only be called if
queue_limits_start_update() is called first. Remove the
queue_limits_cancel_update() calls from the raid*_set_limits() functions
because there is no corresponding queue_limits_start_update() call.

Cc: Christoph Hellwig <hch@lst.de>
Fixes: c6e56cf ("block: move integrity information into queue_limits")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/linux-raid/20250212171108.3483150-1-bvanassche@acm.org/
Signed-off-by: Yu Kuai <yukuai@kernel.org>
  • Loading branch information
Bart Van Assche authored and Yu Kuai committed Feb 13, 2025
1 parent 96b531f commit fbe8f2f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions drivers/md/raid0.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,8 @@ static int raid0_set_limits(struct mddev *mddev)
lim.io_opt = lim.io_min * mddev->raid_disks;
lim.features |= BLK_FEAT_ATOMIC_WRITES;
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
if (err) {
queue_limits_cancel_update(mddev->gendisk->queue);
if (err)
return err;
}
return queue_limits_set(mddev->gendisk->queue, &lim);
}

Expand Down
4 changes: 1 addition & 3 deletions drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -3219,10 +3219,8 @@ static int raid1_set_limits(struct mddev *mddev)
lim.max_write_zeroes_sectors = 0;
lim.features |= BLK_FEAT_ATOMIC_WRITES;
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
if (err) {
queue_limits_cancel_update(mddev->gendisk->queue);
if (err)
return err;
}
return queue_limits_set(mddev->gendisk->queue, &lim);
}

Expand Down
4 changes: 1 addition & 3 deletions drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -4020,10 +4020,8 @@ static int raid10_set_queue_limits(struct mddev *mddev)
lim.io_opt = lim.io_min * raid10_nr_stripes(conf);
lim.features |= BLK_FEAT_ATOMIC_WRITES;
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
if (err) {
queue_limits_cancel_update(mddev->gendisk->queue);
if (err)
return err;
}
return queue_limits_set(mddev->gendisk->queue, &lim);
}

Expand Down

0 comments on commit fbe8f2f

Please sign in to comment.