Skip to contentSkip to conversation

md/raid*: Fix the set_queue_limits implementations

PATCH Applied Bart Van Assche 3 participants 3 messages Feb 12, 2025 – Feb 14, 2025 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 md/raid*: Fix the set_queue_limits implementations

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 <[email protected]>
Fixes c6e56cf6b2e7 ("block: move integrity information into queue_limits")
---
 drivers/md/raid0.c  | 4 +---
 drivers/md/raid1.c  | 4 +---
 drivers/md/raid10.c | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)
drivers/md/raid0.c +1 -3
index 8fc9339b00c7..70bcc3cdf2cd 100644
@@ -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);
 }
 
drivers/md/raid1.c +1 -3
index 9d57a88dbd26..10ea3af40991 100644
@@ -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);
 }
 
drivers/md/raid10.c +1 -3
index efe93b979167..15b9ae5bf84d 100644
@@ -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);
 }
 
Applied
#2 lore raw
In reply to Bart Van Assche
Quoted 8 lines · Bart Van Assche

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 <[email protected]>
Fixes c6e56cf6b2e7 ("block: move integrity information into queue_limits")
Quoted 6 lines
---
  drivers/md/raid0.c  | 4 +---
  drivers/md/raid1.c  | 4 +---
  drivers/md/raid10.c | 4 +---
  3 files changed, 3 insertions(+), 9 deletions(-)

[...]

Applied to md-6.14, thanks!

Kuai