Re: [PATCH] fix random failures in shell/integrity.sh
Mikulas Patocka <[email protected]> Thu, 7 Aug 2025 16:58:59 +0200 (CEST)
| Newsgroups | gmane.linux.lvm.devel |
|---|---|
| Message-ID | <d68121f2-aa4e-c7cf-b65f-231406f04c7e__24460.6243258872$1754578771$gmane$org@redhat.com> |
On Thu, 7 Aug 2025, John Stoffel wrote: > >>>>> "Mikulas" == Mikulas Patocka <[email protected]> writes: > > > On Thu, 7 Aug 2025, Stuart D Gathman wrote: > > >> On Wed, 6 Aug 2025, John Stoffel wrote: > >> > >> > > > > > > "Mikulas" == Mikulas Patocka <[email protected]> writes: > >> > > >> > > The problem is that the raid1 implementation may freely choose which leg > >> > > to read from. If it chooses to read from the non-corrupted leg, the > >> > > corruption is not detected, the number of mismatches is not incremented > >> > > and the test reports this as a failure. > >> > > >> > So wait, how is integrity supposed to work in this situation then? In > >> > real life? I understand the test is hard, maybe doing it in a loop > >> > three times? Or configure the RAID1 to prefer one half over another > >> > is the way to make this test work? > > > If you want to make sure that you detect (and correct) all mismatches, you > > have to scrub the raid array. > > And how do you know which level of the array is showing the errors? I > could have a RAID1 array composed of a single partition on the left > side, but then a RAID0 of two smaller disks on the right side. So how > would this read() flag know what to do? > > I would assume the integrity sub-system would be reading from both > sides and comparing them to look for errors. When you find a > mis-match, how do you tell which side is wrong? If you use dm-integrity on the raid legs (as it was done in this test), you know which leg is corrupted - dm-integrity will turn silent data corruptions into -EILSEQ. So, all you have to do, is to initiate scrub on the array. Mikulas