Skip to content

Commit

Permalink
md/raid10: wait barrier before returning discard request with REQ_NOWAIT
Browse files Browse the repository at this point in the history
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 <xni@redhat.com>
Acked-by: Coly Li <colyli@kernel.org>
Link: https://lore.kernel.org/linux-raid/20250306094938.48952-1-xni@redhat.com
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
  • Loading branch information
Xiao Ni authored and Yu Kuai committed Mar 6, 2025
1 parent 6130825 commit 3db4404
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -1624,11 +1624,10 @@ static int raid10_handle_discard(struct mddev *mddev, struct bio *bio)
if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
return -EAGAIN;

if (WARN_ON_ONCE(bio->bi_opf & REQ_NOWAIT)) {
if (!wait_barrier(conf, bio->bi_opf & REQ_NOWAIT)) {
bio_wouldblock_error(bio);
return 0;
}
wait_barrier(conf, false);

/*
* Check reshape again to avoid reshape happens after checking
Expand Down

0 comments on commit 3db4404

Please sign in to comment.