From patchwork Thu Apr 7 11:05:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 8771121 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7B184C0553 for ; Thu, 7 Apr 2016 11:06:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07EC920204 for ; Thu, 7 Apr 2016 11:06:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E983B2011E for ; Thu, 7 Apr 2016 11:06:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755388AbcDGLGt (ORCPT ); Thu, 7 Apr 2016 07:06:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56191 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755384AbcDGLGs (ORCPT ); Thu, 7 Apr 2016 07:06:48 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 20B8A7AEAC; Thu, 7 Apr 2016 11:06:48 +0000 (UTC) Received: from localhost (dhcp12-159.nay.redhat.com [10.66.12.159] (may be forged)) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u37B6kjo016386; Thu, 7 Apr 2016 07:06:47 -0400 From: Eryu Guan To: fstests@vger.kernel.org Cc: xfs@oss.sgi.com, Eryu Guan Subject: [PATCH] xfs/259: handle minimum block size more precisely Date: Thu, 7 Apr 2016 19:05:55 +0800 Message-Id: <1460027155-4222-1-git-send-email-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently xfs/259 checks $TEST_DIR for CRC support status to determine if 512 block size should be tested. But this doesn't always work. For example, when TEST_DEV is mkfs'ed with "-m crc=0" mkfs option, using mkfs.xfs binary with CRC being the default. What should be really checked is whether mkfs.xfs creates CRC enabled XFS by default. So introduce a new flag XFS_MKFS_CRC_DEFAULT for this purpose, and do the check based on it in xfs/259. Signed-off-by: Eryu Guan Reviewed-by: Christoph Hellwig --- This is actually the second attempt to fix this issue, because Christoph was not satisfied with the first attempt, and me either (after thinking about it more :-)). Hope it works this time. common/config | 8 ++++++++ tests/xfs/259 | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/config b/common/config index cacd815..13bd307 100644 --- a/common/config +++ b/common/config @@ -270,8 +270,16 @@ $MKFS_XFS_PROG -N -d file,name=/tmp/crc_check.img,size=32m -m crc=0 \ if [ $? -ne 0 ]; then XFS_MKFS_HAS_NO_META_SUPPORT=true fi +# check if v5 xfs is default +XFS_MKFS_CRC_DEFAULT=0 +$MKFS_XFS_PROG -N -d file,name=/tmp/crc_check.img,size=32m 2>&1 | grep -q crc=1 +if [ $? -eq 0 ]; then + XFS_MKFS_CRC_DEFAULT=1 +fi rm -f /tmp/crc_check.img + export XFS_MKFS_HAS_NO_META_SUPPORT +export XFS_MKFS_CRC_DEFAULT # new doesn't need config file parsed, we can stop here if [ "$iam" == "new" ]; then diff --git a/tests/xfs/259 b/tests/xfs/259 index 16c1935..3150ff3 100755 --- a/tests/xfs/259 +++ b/tests/xfs/259 @@ -51,9 +51,7 @@ testfile=$TEST_DIR/259.image # Test various sizes slightly less than 4 TB. Need to handle different # minimum block sizes for CRC enabled filesystems, but use a small log so we # don't write lots of zeros unnecessarily. -xfs_info $TEST_DIR | _filter_mkfs 2> $tmp.mkfs > /dev/null -. $tmp.mkfs -if [ $_fs_has_crcs -eq 1 ]; then +if [ $XFS_MKFS_CRC_DEFAULT -eq 1 ]; then blocksize=1024 sizes_to_check="1024 2048 4096" echo "Trying to make (4 TB - 512) B long xfs fs image"