Skip to content

Commit fe71097

Browse files
Zheng Qixingharshimogalapalli
authored andcommitted
md/raid1,raid10: strip REQ_NOWAIT from member bios
commit 5fa31c4 upstream. 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: 9f346f7 ("md/raid1,raid10: don't handle IO error for REQ_RAHEAD and REQ_NOWAIT") Signed-off-by: Zheng Qixing <zhengqixing@huawei.com> Link: https://lore.kernel.org/linux-raid/20250702102341.1969154-1-zhengqixing@huaweicloud.com Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 2c46c14fd386a39f07dca1db0152b0a0dfe1864d) Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
1 parent ebd873a commit fe71097

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/md/raid1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio,
13971397
}
13981398
read_bio = bio_alloc_clone(mirror->rdev->bdev, bio, gfp,
13991399
&mddev->bio_set);
1400-
1400+
read_bio->bi_opf &= ~REQ_NOWAIT;
14011401
r1_bio->bios[rdisk] = read_bio;
14021402

14031403
read_bio->bi_iter.bi_sector = r1_bio->sector +
@@ -1644,6 +1644,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
16441644
wait_for_serialization(rdev, r1_bio);
16451645
}
16461646

1647+
mbio->bi_opf &= ~REQ_NOWAIT;
16471648
r1_bio->bios[i] = mbio;
16481649

16491650
mbio->bi_iter.bi_sector = (r1_bio->sector + rdev->data_offset);

drivers/md/raid10.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,7 @@ static void raid10_read_request(struct mddev *mddev, struct bio *bio,
12231223
r10_bio->master_bio = bio;
12241224
}
12251225
read_bio = bio_alloc_clone(rdev->bdev, bio, gfp, &mddev->bio_set);
1226+
read_bio->bi_opf &= ~REQ_NOWAIT;
12261227

12271228
r10_bio->devs[slot].bio = read_bio;
12281229
r10_bio->devs[slot].rdev = rdev;
@@ -1258,6 +1259,7 @@ static void raid10_write_one_disk(struct mddev *mddev, struct r10bio *r10_bio,
12581259
conf->mirrors[devnum].rdev;
12591260

12601261
mbio = bio_alloc_clone(rdev->bdev, bio, GFP_NOIO, &mddev->bio_set);
1262+
mbio->bi_opf &= ~REQ_NOWAIT;
12611263
if (replacement)
12621264
r10_bio->devs[n_copy].repl_bio = mbio;
12631265
else

0 commit comments

Comments
 (0)