FSTests Archive on lore.kernel.org
 help / color / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] xfs/516: Use scratch_xfs_get/set_sb_field api
Date: Tue, 30 Jun 2020 08:48:19 -0700
Message-ID: <20200630154819.GD7600@magnolia> (raw)
In-Reply-To: <1593498187-21213-1-git-send-email-xuyang2018.jy@cn.fujitsu.com>

On Tue, Jun 30, 2020 at 02:23:07PM +0800, Yang Xu wrote:
> When using old xfsprogs, this case fails as below:
>     +write: invalid option -- 'd'
> 
> xfs_db write command support -d options since xfsprogs commit
> 86769b32d01 ("xfs_db: allow recalculating CRCs on invalid metadata").
> For avoid invalid error, use scratch_xfs_set_sb_field api instead.
> 
> Also add missing "rm -f $seqres.full" at the beginning of the test.
> 
> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>

Looks good to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  tests/xfs/516 | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/xfs/516 b/tests/xfs/516
> index ca8c0412..3a7afd0e 100755
> --- a/tests/xfs/516
> +++ b/tests/xfs/516
> @@ -22,6 +22,8 @@ _cleanup()
>  	cd /
>  }
>  
> +rm -f $seqres.full
> +
>  # get standard environment, filters and checks
>  . ./common/rc
>  . ./common/fuzzy
> @@ -60,7 +62,8 @@ __test_mount_opts()
>  	else
>  		echo "mount failed" >> $seqres.full
>  	fi
> -	_scratch_xfs_db -c 'sb 0' -c 'p unit width' >> $seqres.full
> +	_scratch_xfs_get_sb_field unit >> $seqres.full
> +	_scratch_xfs_get_sb_field width  >> $seqres.full
>  
>  	# Run xfs_repair in repair mode to see if it can be baited into nuking
>  	# the root filesystem on account of the sunit update.
> @@ -119,9 +122,12 @@ test_repair_detection()
>  	fi
>  
>  	# Update the superblock like the kernel used to do.
> -	_scratch_xfs_db -c 'sb 0' -c 'p unit width' >> $seqres.full
> -	_scratch_xfs_db -x -c 'sb 0' -c 'write -d unit 256' -c 'write -d width 1024' >> $seqres.full
> -	_scratch_xfs_db -c 'sb 0' -c 'p unit width' >> $seqres.full
> +	_scratch_xfs_get_sb_field unit >> $seqres.full
> +	_scratch_xfs_get_sb_field width >> $seqres.full
> +	_scratch_xfs_set_sb_field unit 256 >> $seqres.full
> +	_scratch_xfs_set_sb_field width 1024 >> $seqres.full
> +	_scratch_xfs_get_sb_field unit >> $seqres.full
> +	_scratch_xfs_get_sb_field width >> $seqres.full
>  
>  	# Run xfs_repair in repair mode to see if it can be baited into nuking
>  	# the root filesystem on account of the sunit update.
> -- 
> 2.23.0
> 
> 
> 

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30  6:23 Yang Xu
2020-06-30 15:48 ` Darrick J. Wong [this message]

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=20200630154819.GD7600@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=xuyang2018.jy@cn.fujitsu.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

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git