All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Anand Jain <anand.jain@oracle.com>
Cc: David Sterba <dsterba@suse.com>,
	fstests@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH 1/5] common/verity: use the correct options for btrfs-corrupt-block
Date: Wed, 20 Mar 2024 16:23:32 +0100	[thread overview]
Message-ID: <20240320152332.GB14596@suse.cz> (raw)
In-Reply-To: <d8e9d153-aff6-4f47-888b-b2ab91f7eb5b@oracle.com>

On Wed, Mar 20, 2024 at 03:28:52PM +0530, Anand Jain wrote:
> On 3/19/24 23:42, David Sterba wrote:
> > From: Josef Bacik <josef@toxicpanda.com>
> > 
> > A long time ago we changed the short options to long options in
> > btrfs-corrupt-block, so adjust the helper to use the correct options so
> > the verity tests pass properly.
> > 
> > Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> > ---
> >   common/verity | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/common/verity b/common/verity
> > index 03d175ce1b7a18..0e5f0d75e746a8 100644
> > --- a/common/verity
> > +++ b/common/verity
> > @@ -402,7 +402,7 @@ _fsv_scratch_corrupt_merkle_tree()
> >   			# in the default filesystem tree (-r 5) and corrupt one byte (-b 1) at
> >   			# $offset (-o $offset) with the ascii representation of the byte we read
> >   			# (-v $ascii)
> 
> > -			$BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,37,0 -v $ascii -o $offset -b 1 $SCRATCH_DEV
> > +			$BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,37,0 --value $ascii --offset $offset -b 1 $SCRATCH_DEV
> 
> 
> Can we still make it work with the older btrfs-corrupt-block?
> 
> How about..
> 
> corrupt_block_value_opt()
> {
> 	$BTRFS_CORRUPT_BLOCK_PROG -h 2>&1 | grep -q -e "--value"
> 	if [ $? == 0 ]; then
> 		echo "--value"
> 	else
> 		echo "-v"
> 	fi
> }
> 
> And to use,
> 
> $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,37,0 $(corrupt_block_value_opt) 
> $ascii --offset $offset -b 1 $SCRATCH_DEV
> 
> 
> I will make this change before submitting the PR if no objection.

Thanks, that would be great. The option changed in btrfs-progs 5.18
which is still relatively recent so both options should be supported.

  reply	other threads:[~2024-03-20 15:30 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 18:11 [PATCH 0/5] Btrfs fstests fixups and updates David Sterba
2024-03-19 18:12 ` [PATCH 1/5] common/verity: use the correct options for btrfs-corrupt-block David Sterba
2024-03-20  9:58   ` Anand Jain
2024-03-20 15:23     ` David Sterba [this message]
2024-03-24  7:56       ` Anand Jain
2024-03-19 18:12 ` [PATCH 2/5] btrfs/131,btrfs/172,btrfs/206: add check for block-group-tree feature in btrfs David Sterba
2024-03-20 10:01   ` Anand Jain
2024-03-19 18:12 ` [PATCH 3/5] btrfs/330: add test to validate ro/rw subvol mounting David Sterba
2024-03-20 11:33   ` Anand Jain
2024-03-20 17:01     ` Filipe Manana
2024-03-21  3:51       ` Anand Jain
2024-03-19 18:12 ` [PATCH 4/5] common/rc: use proper temporary file path in _repair_test_fs() David Sterba
2024-03-20 11:35   ` Anand Jain
2024-03-19 18:12 ` [PATCH 5/5] generic/733: disable for btrfs David Sterba
2024-03-19 21:01   ` Christoph Hellwig
2024-03-19 21:10     ` Darrick J. Wong
2024-03-19 21:16       ` Christoph Hellwig
2024-03-20 15:58     ` David Sterba
2024-03-21 21:36       ` Christoph Hellwig
2024-03-21 21:52         ` Kent Overstreet
2024-03-22 15:08           ` Josef Bacik
2024-03-22 15:45             ` Darrick J. Wong
2024-03-22 18:28             ` Kent Overstreet
2024-03-20  9:49 ` [PATCH 0/5] Btrfs fstests fixups and updates Anand Jain
2024-03-20 15:26   ` David Sterba
2024-03-21  4:09 ` [PATCH] common/btrfs: set BTRFS_CORRUPT_BLOCK_OPT_<VALUE|OFFSET> Anand Jain
2024-03-21 11:13   ` Filipe Manana
2024-03-21 12:34     ` Anand Jain
2024-03-24  8:35 ` [PATCH 0/5] Btrfs fstests fixups and updates Anand Jain

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=20240320152332.GB14596@suse.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=josef@toxicpanda.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.