linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Stuart D Gathman <stuart@gathman.org>
Cc: John Stoffel <john@stoffel.org>,
	Peter Rajnoha <prajnoha@redhat.com>,
	 Zdenek Kabelac <zkabelac@redhat.com>,
	 Heinz Mauelshagen <heinzm@redhat.com>,
	 David Teigland <teigland@redhat.com>,
	linux-lvm@lists.linux.dev,  lvm-devel@lists.linux.dev
Subject: Re: [PATCH] fix random failures in shell/integrity.sh
Date: Thu, 7 Aug 2025 16:07:53 +0200 (CEST)	[thread overview]
Message-ID: <36d044e7-75f0-9b53-8969-0423fade7ea7@redhat.com> (raw)
In-Reply-To: <65919799-842c-9428-8bfc-5c1c0671338@gathman.org>



On Thu, 7 Aug 2025, Stuart D Gathman wrote:

> On Wed, 6 Aug 2025, John Stoffel wrote:
> 
> > > > > > > "Mikulas" == Mikulas Patocka <mpatocka@redhat.com> 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.

> Linux needs an optional parameter to read() syscall that is "leg index"
> for the blk interface.  Thus, btrfs scrub can check all legs, and this
> test can check all legs.  Filesystems with checks can repair corruption
> by rewriting the block after finding a leg with correct csum.
> 
> This only needs a few bits (how many legs can there be?), so can go in
> the FLAGS argument.

I think that adding a new bit for the read syscalls is not a workable 
solition. There are so many programs using the read() syscall and teaching 
them to use this new bit is impossible.

Mikulas


  reply	other threads:[~2025-08-07 14:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-04 14:17 [PATCH] fix random failures in shell/integrity.sh Mikulas Patocka
2025-08-06 21:24 ` John Stoffel
2025-08-06 23:25   ` matthew patton
2025-08-07  4:23   ` Stuart D Gathman
2025-08-07 14:07     ` Mikulas Patocka [this message]
2025-08-07 14:26       ` Zdenek Kabelac
2025-08-11 12:22         ` Mikulas Patocka
2025-08-07 14:38       ` John Stoffel
2025-08-07 14:58         ` Mikulas Patocka
2025-08-07 15:31         ` Stuart D Gathman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36d044e7-75f0-9b53-8969-0423fade7ea7@redhat.com \
    --to=mpatocka@redhat.com \
    --cc=heinzm@redhat.com \
    --cc=john@stoffel.org \
    --cc=linux-lvm@lists.linux.dev \
    --cc=lvm-devel@lists.linux.dev \
    --cc=prajnoha@redhat.com \
    --cc=stuart@gathman.org \
    --cc=teigland@redhat.com \
    --cc=zkabelac@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).