Skip to content

Commit 17cbda3

Browse files
committed
md: Fix linear_set_limits()
JIRA: https://issues.redhat.com/browse/RHEL-73514 commit a572593 Author: Bart Van Assche <bvanassche@acm.org> Date: Wed Jan 29 14:56:35 2025 -0800 md: Fix linear_set_limits() queue_limits_cancel_update() must only be called if queue_limits_start_update() is called first. Remove the queue_limits_cancel_update() call from linear_set_limits() because there is no corresponding queue_limits_start_update() call. This bug was discovered by annotating all mutex operations with clang thread-safety attributes and by building the kernel with clang and -Wthread-safety. Cc: Yu Kuai <yukuai3@huawei.com> Cc: Coly Li <colyli@kernel.org> Cc: Mike Snitzer <snitzer@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Fixes: 127186c ("md: reintroduce md-linear") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20250129225636.2667932-1-bvanassche@acm.org Signed-off-by: Song Liu <song@kernel.org> (cherry picked from commit a572593) Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
1 parent 392de5d commit 17cbda3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/md/md-linear.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ static int linear_set_limits(struct mddev *mddev)
6666

6767
md_init_stacking_limits(&lim);
6868
err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
69-
if (err) {
70-
queue_limits_cancel_update(mddev->gendisk->queue);
69+
if (err)
7170
return err;
72-
}
71+
7372
return queue_limits_set(mddev->gendisk->queue, &lim);
7473
}
7574

0 commit comments

Comments
 (0)