lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e198d33c-7b02-4585-81d4-544911729051@huaweicloud.com>
Date: Sat, 5 Jul 2025 17:45:51 +0800
From: Zheng Qixing <zhengqixing@...weicloud.com>
To: Zheng Qixing <zhengqixing@...weicloud.com>, song@...nel.org,
 yukuai3@...wei.com
Cc: linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
 yi.zhang@...wei.com, yangerkun@...wei.com, houtao1@...wei.com
Subject: Re: [PATCH] md/raid1,raid10: strip REQ_NOWAIT from member bios

Hi,


Add fix tag.


在 2025/7/2 18:23, Zheng Qixing 写道:
> From: Zheng Qixing <zhengqixing@...wei.com>
>
> RAID layers don't implement proper non-blocking semantics for
> REQ_NOWAIT, making the flag potentially misleading when propagated
> to member disks.
>
> This patch clear REQ_NOWAIT from cloned bios in raid1/raid10. Retain
> original bio's REQ_NOWAIT flag for upper layer error handling.
>
> Maybe we can implement non-blocking I/O handling mechanisms within
> RAID in future work.


Fixes: 9f346f7d4ea7 ("md/raid1,raid10: don't handle IO error for 
REQ_RAHEAD and REQ_NOWAIT")


> Signed-off-by: Zheng Qixing <zhengqixing@...wei.com>
> ---
>   drivers/md/raid1.c  | 3 ++-
>   drivers/md/raid10.c | 2 ++
>   2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 19c5a0ce5a40..213ad5b7e20b 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -1399,7 +1399,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio,
>   	}
>   	read_bio = bio_alloc_clone(mirror->rdev->bdev, bio, gfp,
>   				   &mddev->bio_set);
> -
> +	read_bio->bi_opf &= ~REQ_NOWAIT;
>   	r1_bio->bios[rdisk] = read_bio;
>   
>   	read_bio->bi_iter.bi_sector = r1_bio->sector +
> @@ -1649,6 +1649,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
>   				wait_for_serialization(rdev, r1_bio);
>   		}
>   
> +		mbio->bi_opf &= ~REQ_NOWAIT;
>   		r1_bio->bios[i] = mbio;
>   
>   		mbio->bi_iter.bi_sector	= (r1_bio->sector + rdev->data_offset);
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index b74780af4c22..951b9b443cd1 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -1221,6 +1221,7 @@ static void raid10_read_request(struct mddev *mddev, struct bio *bio,
>   		r10_bio->master_bio = bio;
>   	}
>   	read_bio = bio_alloc_clone(rdev->bdev, bio, gfp, &mddev->bio_set);
> +	read_bio->bi_opf &= ~REQ_NOWAIT;
>   
>   	r10_bio->devs[slot].bio = read_bio;
>   	r10_bio->devs[slot].rdev = rdev;
> @@ -1256,6 +1257,7 @@ static void raid10_write_one_disk(struct mddev *mddev, struct r10bio *r10_bio,
>   			     conf->mirrors[devnum].rdev;
>   
>   	mbio = bio_alloc_clone(rdev->bdev, bio, GFP_NOIO, &mddev->bio_set);
> +	mbio->bi_opf &= ~REQ_NOWAIT;
>   	if (replacement)
>   		r10_bio->devs[n_copy].repl_bio = mbio;
>   	else


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ