public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>, fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH] xfs: test xfs_db fuzz command verbs
Date: Tue, 22 Aug 2017 15:06:14 +0800	[thread overview]
Message-ID: <20170822070614.GG31418@eguan.usersys.redhat.com> (raw)
In-Reply-To: <20170819154645.GD4794@magnolia>

Hi Darrick,

On Sat, Aug 19, 2017 at 08:46:45AM -0700, Darrick J. Wong wrote:
> Ensure that the fuzz command does what it says.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

I applied your patch "[PATCH] xfs_db: bit fuzzing should read the right
bit when flipping" on top of xfsprogs for-next branch (which contains
commit ef209a960d82 "xfs_db: make write/fuzz -c and -d work on non-crc
filesystems") and tested this patch. All worked fine on CRC enabled XFS,
but test failed with non-CRC xfs as it missed lines like:

Allowing fuzz of corrupted data with good CRC

I did the following modifications and test passed with both CRC and
non-CRC XFS, if you think it's OK then I can fold the changes to your
patch and no need for a resend :)

Thanks,
Eryu

diff --git a/tests/xfs/058 b/tests/xfs/058
index 4a39942..32ceb0d 100755
--- a/tests/xfs/058
+++ b/tests/xfs/058
@@ -50,21 +50,31 @@ _require_xfs_db_command "fuzz"
 rm -f "$seqres.full"
 
 echo "Format"
-_scratch_mkfs > "$seqres.full" 2>&1
+_scratch_mkfs | _filter_mkfs 2>$tmp.mkfs >> "$seqres.full"
+source $tmp.mkfs
+
+do_xfs_db()
+{
+       local cmd=$1
+       if [ $_fs_has_crcs -eq 0 ]; then
+               echo "Allowing $cmd of corrupted data with good CRC"
+       fi
+       _scratch_xfs_db -x -c 'sb 0' -c "$*"
+}
 
 # Make sure that each fuzz verb works.  For the firstbit/middlebit/lastbit
 # tests, we depend on 'ones' having set the field to all ones.
 field="fdblocks"
-_scratch_xfs_db -x -c 'sb 0' -c "write -d ${field} 0"
+do_xfs_db write -d ${field} 0
 SCRATCH_XFS_LIST_FUZZ_VERBS= _scratch_xfs_list_fuzz_verbs | while read verb; do
        test "${verb}" = "random" && continue
        echo "Test verb ${verb}"
-       _scratch_xfs_db -x -c 'sb 0' -c "fuzz -d ${field} ${verb}"
+       do_xfs_db fuzz -d ${field} ${verb}
 done
 
 echo "Test verb random"
 before="$(_scratch_xfs_get_metadata_field "${field}" 'sb 0')"
-_scratch_xfs_db -x -c 'sb 0' -c "fuzz -d ${field} random" >> $seqres.full
+do_xfs_db fuzz -d ${field} random >> $seqres.full
 after="$(_scratch_xfs_get_metadata_field "${field}" 'sb 0')"
 test "${before}" != "${after}" && echo "${field} changed"


  reply	other threads:[~2017-08-22  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-19 15:46 [PATCH] xfs: test xfs_db fuzz command verbs Darrick J. Wong
2017-08-22  7:06 ` Eryu Guan [this message]
2017-08-22 16:24   ` Darrick J. Wong

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=20170822070614.GG31418@eguan.usersys.redhat.com \
    --to=eguan@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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