Hi,
在 2025/05/19 20:34, Yu Kuai 写道:
Hi,
在 2025/05/19 20:05, Mikulas Patocka 写道:
On Mon, 19 May 2025, Yu Kuai wrote:
Hi,
在 2025/05/19 19:19, Yu Kuai 写道:
The commit e879a0d9cb08 ("md/raid1,raid10: don't ignore IO flags")
breaks
the lvm2 test shell/lvcreate-large-raid.sh. The commit changes
raid1 and
raid10 to pass down all the flags from the incoming bio. The
problem is
when we pass down the REQ_RAHEAD flag - bios with this flag may fail
anytime and md-raid is not prepared to handle this failure.
Can dm-raid handle this falg? At least from md-raid array, for read
ahead IO, it doesn't make sense to kill that flag.
If we want to fall back to old behavior, can we kill that flag from
dm-raid?
Please ignore the last reply, I misunderstand your commit message, I
thought you said dm-raid, actually you said mdraid, and it's correct,
if read_bio faild raid1/10 will set badblocks which is not expected.
Then for reada head IO, I still think don't kill REQ_RAHEAD for
underlying disks is better, what do you think about skip handling IO
error for ead ahead IO?
I presume that md-raid will report an error and kick the disk out of the
array if a bio with REQ_RAHEAD fails - could this be the explanation of
this bug?
This is right if the rdev is set FailFast. However, by default if bio
failed, raid1/raid10 will record badblocks first, and retry the read
untill all underlying disks faild, then read_balance() will finally
found there is no avaliable disk to read and return error.
BTW, I still need to figure out how to run this test to see what really
happened.
I can run the test now, and I confirmed that the dm-raid is build on the
top of dm-zero, and for dm-zero, all read ahead bio will return -EIO.
And failfast is set, causing test to fail:
[ 0:54.960] [135.521104] <2> 2025-05-20 06:20:23 md/raid1:mdX: Disk
failure on dm-6, disabling device.\x0amd/raid1:mdX: Operation continuing
on 1 devices.
[ 0:54.960] #lvcreate-large-raid.sh:77+ check lv_field
LVMTEST1119vg1/LV1 size 400.00t
[ 0:55.012] File descriptor 6 (/dev/pts/0) leaked on lvm invocation.
Parent PID 1670: bash
[ 0:55.278] WARNING: RaidLV LVMTEST1119vg1/LV1 needs to be refreshed!
See character 'r' at position 9 in the RaidLV's attributes and also its
SubLV(s) with option '-a'.
[ 0:55.307] check raid_leg_status $vg1 $lv1 "AA"
[ 0:55.474] #lvcreate-large-raid.sh:78+ check raid_leg_status
LVMTEST1119vg1 LV1 AA
[ 0:55.474] LVMTEST1119vg1-LV1 status DA != AA (0 858993459200 raid
raid1 2 DA 429496729600/429496729600 idle 0 0 -)
[ 0:55.534] set +vx; STACKTRACE; set -vx
Thanks,
Kuai
Thanks,
Kuai
Mikulas
.