Skip to content

Commit b26d49e

Browse files
committed
md/raid10: wait barrier before returning discard request with REQ_NOWAIT
JIRA: https://issues.redhat.com/browse/RHEL-83988 commit 3db4404 Author: Xiao Ni <[email protected]> Date: Thu Mar 6 17:49:38 2025 +0800 md/raid10: wait barrier before returning discard request with REQ_NOWAIT raid10_handle_discard should wait barrier before returning a discard bio which has REQ_NOWAIT. And there is no need to print warning calltrace if a discard bio has REQ_NOWAIT flag. Quality engineer usually checks dmesg and reports error if dmesg has warning/error calltrace. Fixes: c9aa889 ("md: raid10 add nowait support") Signed-off-by: Xiao Ni <[email protected]> Acked-by: Coly Li <[email protected]> Link: https://lore.kernel.org/linux-raid/[email protected] Signed-off-by: Yu Kuai <[email protected]> Signed-off-by: Nigel Croxon <[email protected]>
1 parent 3924dfe commit b26d49e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/md/raid10.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,11 +1624,10 @@ static int raid10_handle_discard(struct mddev *mddev, struct bio *bio)
16241624
if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
16251625
return -EAGAIN;
16261626

1627-
if (WARN_ON_ONCE(bio->bi_opf & REQ_NOWAIT)) {
1627+
if (!wait_barrier(conf, bio->bi_opf & REQ_NOWAIT)) {
16281628
bio_wouldblock_error(bio);
16291629
return 0;
16301630
}
1631-
wait_barrier(conf, false);
16321631

16331632
/*
16341633
* Check reshape again to avoid reshape happens after checking

0 commit comments

Comments
 (0)