From patchwork Thu Aug 3 12:05:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 9878875 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 A4B1860311 for ; Thu, 3 Aug 2017 12:05:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BF3D1FF26 for ; Thu, 3 Aug 2017 12:05:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9096A2866F; Thu, 3 Aug 2017 12:05:31 +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=ham 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 ED3C41FF26 for ; Thu, 3 Aug 2017 12:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752395AbdHCMFa (ORCPT ); Thu, 3 Aug 2017 08:05:30 -0400 Received: from [183.91.158.132] ([183.91.158.132]:32871 "EHLO heian.cn.fujitsu.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752370AbdHCMF2 (ORCPT ); Thu, 3 Aug 2017 08:05:28 -0400 X-IronPort-AV: E=Sophos;i="5.41,315,1498492800"; d="scan'208";a="22170524" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Aug 2017 20:05:19 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id D43A14724E4F for ; Thu, 3 Aug 2017 20:05:19 +0800 (CST) Received: from localhost.localdomain (10.167.220.81) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 3 Aug 2017 20:05:18 +0800 From: Xiao Yang To: CC: Xiao Yang Subject: [PATCH] xfs/424: add check for crc and finobt Date: Thu, 3 Aug 2017 20:05:14 +0800 Message-ID: <1501761914-16445-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.81] X-yoursite-MailScanner-ID: D43A14724E4F.AA25C X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 1) When crc is not supported or disabled, this case could not indicate any expected error. Running all tests without crc makes no sense. 2) When finobt is disabled, xfs_db fails to get current address of free_root, as below: xfs_db -c "agi" -c "addr free_root" -c "daddr" /dev/sda11 Metadata CRC error detected at xfs_inobt block 0x0/0x1000 ... Running related tests without finobt makes no sense. We add check to fix it. Signed-off-by: Xiao Yang --- tests/xfs/424 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/xfs/424 b/tests/xfs/424 index 0a1eef9..165c390 100755 --- a/tests/xfs/424 +++ b/tests/xfs/424 @@ -55,9 +55,15 @@ rm -f $seqres.full _supported_os Linux _supported_fs xfs _require_scratch +_require_xfs_mkfs_crc echo "Silence is golden." +crc_finobt_enabled="crc=1,finobt=0" + +[ _scratch_mkfs_xfs_supported -m crc=1,finobt=1 >/dev/null 2>&1 ] && \ + crc_finobt_enabled="crc=1,finobt=1" + # real QA test starts here # for different sector sizes, ensure no CRC errors are falsely reported. @@ -77,7 +83,7 @@ while [ $sec_sz -le 4096 ]; do done for SECTOR_SIZE in $sector_sizes; do - $MKFS_XFS_PROG -f -s size=$SECTOR_SIZE $SCRATCH_DEV > /dev/null + $MKFS_XFS_PROG -f -m "$crc_finobt_enabled" -s size=$SECTOR_SIZE $SCRATCH_DEV > /dev/null for TYPE in agf agi agfl sb; do DADDR=`_scratch_xfs_db -c "$TYPE" -c "daddr" | filter_dbval` @@ -96,9 +102,11 @@ for SECTOR_SIZE in $sector_sizes; do DADDR=`_scratch_xfs_db -c "agi" -c "addr root" -c "daddr" | filter_dbval` _scratch_xfs_db -c "daddr $DADDR" -c "type inobt" - DADDR=`_scratch_xfs_db -c "agi" -c "addr free_root" -c "daddr" | - filter_dbval` - _scratch_xfs_db -c "daddr $DADDR" -c "type finobt" + if [[ "$crc_finobt_enabled" =~ 'finobt=1' ]]; then + DADDR=`_scratch_xfs_db -c "agi" -c "addr free_root" -c "daddr" | + filter_dbval` + _scratch_xfs_db -c "daddr $DADDR" -c "type finobt" + fi _scratch_xfs_db -c "daddr $DADDR" -c "type text" _scratch_xfs_db -c "daddr $DADDR" -c "type data"