Re: [PATCH] fix random failures in shell/integrity.sh

Stuart D Gathman <[email protected]> Thu, 7 Aug 2025 11:31:07 -0400 (EDT)
Newsgroups dev.linux.lists.lvm-devel,dev.linux.lists.linux-lvm
Message-ID <[email protected]>
On Thu, 7 Aug 2025, John Stoffel wrote:

>
> 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?

Modern filesystems like btrfs (and xfs for metadata) have csums on
extents.  So they know which version is good.  Btrfs can do it's own
version of raid1, with multiple copies of each extents on different 
devices.  But this doesn't integrate well with LVM. (It's great for
arrays of external USB disks for archival purposes.)  LVM is 
more efficient as a base - especially for use with KVM virtual machines.
(You could use containers on btrfs, but I like the better security
of KVM despite higher CPU usage.)

> 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?

Modern filesystems have csums on extents.  There is an integrity layer
for dm that also does this.  Both filesystems and integrity layer
need a way to read all versions of a block/extent to see which is
correct.