diff mbox series

[md-6.15,V2,1/1] md/raid10: wait barrier before returning discard request with REQ_NOWAIT

Message ID 20250306094938.48952-1-xni@redhat.com (mailing list archive)
State Accepted
Headers show
Series [md-6.15,V2,1/1] md/raid10: wait barrier before returning discard request with REQ_NOWAIT | expand

Checks

Context Check Description
mdraidci/vmtest-md-6_14-PR success PR summary
mdraidci/vmtest-md-6_14-VM_Test-0 success Logs for per-patch-testing

Commit Message

Xiao Ni March 6, 2025, 9:49 a.m. UTC
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>
---
v2: add target version in title and add Fixes tag
 drivers/md/raid10.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Coly Li March 6, 2025, 12:24 p.m. UTC | #1
On Thu, Mar 06, 2025 at 05:49:38PM +0800, Xiao Ni wrote:
> 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>

Thanks.

> ---
> v2: add target version in title and add Fixes tag
>  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 15b9ae5bf84d..7bbc04522f26 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -1631,11 +1631,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.32.0 (Apple Git-132)
> 
>
Yu Kuai March 7, 2025, 1:07 a.m. UTC | #2
在 2025/03/06 17:49, Xiao Ni 写道:
> 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>
> ---
> v2: add target version in title and add Fixes tag
>   drivers/md/raid10.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
Applied to md-6.15

Thanks!
Kuai
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 15b9ae5bf84d..7bbc04522f26 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -1631,11 +1631,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
>
diff mbox series

Patch

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 15b9ae5bf84d..7bbc04522f26 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1631,11 +1631,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