From patchwork Tue Aug 22 07:06:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 9914329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2BA02603FF for ; Tue, 22 Aug 2017 07:06:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2781E28809 for ; Tue, 22 Aug 2017 07:06:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C4602880B; Tue, 22 Aug 2017 07:06:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA5CA28814 for ; Tue, 22 Aug 2017 07:06:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754594AbdHVHGQ (ORCPT ); Tue, 22 Aug 2017 03:06:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42520 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754565AbdHVHGQ (ORCPT ); Tue, 22 Aug 2017 03:06:16 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E8F44A707; Tue, 22 Aug 2017 07:06:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1E8F44A707 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=eguan@redhat.com Received: from localhost (dhcp-12-147.nay.redhat.com [10.66.12.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C0D57F6AC; Tue, 22 Aug 2017 07:06:15 +0000 (UTC) Date: Tue, 22 Aug 2017 15:06:14 +0800 From: Eryu Guan To: "Darrick J. Wong" Cc: xfs , fstests Subject: Re: [PATCH] xfs: test xfs_db fuzz command verbs Message-ID: <20170822070614.GG31418@eguan.usersys.redhat.com> References: <20170819154645.GD4794@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170819154645.GD4794@magnolia> User-Agent: Mutt/1.8.3 (2017-05-23) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 22 Aug 2017 07:06:16 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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 Reviewed-by: Darrick J. Wong --- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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"