From patchwork Thu Jan 11 06:56:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10157367 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 7A115601A1 for ; Thu, 11 Jan 2018 06:56:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EAC628685 for ; Thu, 11 Jan 2018 06:56:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6358E286B0; Thu, 11 Jan 2018 06:56:32 +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 C4CDE28685 for ; Thu, 11 Jan 2018 06:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754088AbeAKG40 (ORCPT ); Thu, 11 Jan 2018 01:56:26 -0500 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:34447 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753981AbeAKG4Z (ORCPT ); Thu, 11 Jan 2018 01:56:25 -0500 Received: from adam-pc.lan (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Wed, 10 Jan 2018 23:56:11 -0700 From: Qu Wenruo To: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH 5/5] fstests: btrfs/143: Filter out offset to handle mkfs chunk layout change Date: Thu, 11 Jan 2018 14:56:01 +0800 Message-Id: <20180111065601.5831-5-wqu@suse.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180111065601.5831-1-wqu@suse.com> References: <20180111065601.5831-1-wqu@suse.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Due to recent mkfs.btrfs chunk layout change, offset in golden output is not flex to handle different mkfs chunk layout. So use _filter_xfs_io_offset to filter out offset so golden output can handle any chunk layout. Signed-off-by: Qu Wenruo --- tests/btrfs/143 | 9 ++++--- tests/btrfs/143.out | 70 ++++++++++++++++++++++++++--------------------------- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/tests/btrfs/143 b/tests/btrfs/143 index 3875b6c4..ca51d35e 100755 --- a/tests/btrfs/143 +++ b/tests/btrfs/143 @@ -106,7 +106,8 @@ _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1 # chunk _scratch_mount -o nospace_cache,nodatasum -$XFS_IO_PROG -f -d -c "pwrite -S 0xaa -b 128K 0 128K" "$SCRATCH_MNT/foobar" | _filter_xfs_io +$XFS_IO_PROG -f -d -c "pwrite -S 0xaa -b 128K 0 128K" "$SCRATCH_MNT/foobar" |\ + _filter_xfs_io | _filter_xfs_io_offset # step 2, corrupt the first 64k of one copy (on SCRATCH_DEV which is the first # one in $SCRATCH_DEV_POOL @@ -117,7 +118,8 @@ logical_in_btrfs=`${FILEFRAG_PROG} -v $SCRATCH_MNT/foobar | _filter_filefrag | c physical_on_scratch=`get_physical ${logical_in_btrfs}` _scratch_unmount -$XFS_IO_PROG -d -c "pwrite -S 0xbb -b 64K $physical_on_scratch 64K" $SCRATCH_DEV | _filter_xfs_io +$XFS_IO_PROG -d -c "pwrite -S 0xbb -b 64K $physical_on_scratch 64K" $SCRATCH_DEV |\ + _filter_xfs_io | _filter_xfs_io_offset _scratch_mount -o nospace_cache @@ -142,7 +144,8 @@ done _scratch_unmount # check if the repair works -$XFS_IO_PROG -c "pread -v -b 512 $physical_on_scratch 512" $SCRATCH_DEV | _filter_xfs_io +$XFS_IO_PROG -c "pread -v -b 512 $physical_on_scratch 512" $SCRATCH_DEV |\ + _filter_xfs_io | _filter_xfs_io_offset _scratch_dev_pool_put # success, all done diff --git a/tests/btrfs/143.out b/tests/btrfs/143.out index 97bf45c5..66afea4b 100644 --- a/tests/btrfs/143.out +++ b/tests/btrfs/143.out @@ -1,39 +1,39 @@ QA output created by 143 -wrote 131072/131072 bytes at offset 0 +wrote 131072/131072 bytes XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 65536/65536 bytes at offset 136708096 +wrote 65536/65536 bytes XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -08260000: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260010: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260020: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260030: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260040: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260050: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260060: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260070: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260080: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260090: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082600a0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082600b0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082600c0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082600d0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082600e0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082600f0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260100: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260110: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260120: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260130: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260140: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260150: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260160: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260170: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260180: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -08260190: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082601a0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082601b0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082601c0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082601d0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082601e0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -082601f0: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ -read 512/512 bytes at offset 136708096 +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +XXXXXXXX: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................ +read 512/512 bytes XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)