[PATCH OLK-6.6] md/raid10: wait barrier before returning discard request with REQ_NOWAIT

From: Xiao Ni <xni@redhat.com> mainline inclusion from mainline-v6.15-rc1 commit 3db4404435397a345431b45f57876a3df133f3b4 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IC2CC4 CVE: CVE-2025-40325 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... ------------------ 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: c9aa889b035f ("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> Signed-off-by: Zheng Qixing <zhengqixing@huawei.com> --- drivers/md/raid10.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 1f7fa6f8f84e..fbe52bd69ff9 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1601,11 +1601,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 -- 2.39.2

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/16538 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/5WB... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/16538 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/5WB...
participants (2)
-
patchwork bot
-
Zheng Qixing