From patchwork Mon Dec 26 17:32:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Rajendra X-Patchwork-Id: 9488715 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 50F2660838 for ; Mon, 26 Dec 2016 17:32:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46761204C1 for ; Mon, 26 Dec 2016 17:32:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3970926223; Mon, 26 Dec 2016 17:32:50 +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 29D5F204C1 for ; Mon, 26 Dec 2016 17:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755280AbcLZRcs (ORCPT ); Mon, 26 Dec 2016 12:32:48 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41337 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755260AbcLZRcr (ORCPT ); Mon, 26 Dec 2016 12:32:47 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uBQHTw6l136609 for ; Mon, 26 Dec 2016 12:32:47 -0500 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 27k5e8c4p5-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 26 Dec 2016 12:32:47 -0500 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 26 Dec 2016 10:32:46 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 26 Dec 2016 10:32:44 -0700 Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 492063E4003E; Mon, 26 Dec 2016 10:32:44 -0700 (MST) Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uBQHWi8f13304110; Mon, 26 Dec 2016 10:32:44 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B75A7803F; Mon, 26 Dec 2016 10:32:44 -0700 (MST) Received: from localhost.in.ibm.com (unknown [9.199.58.131]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id 88E0878041; Mon, 26 Dec 2016 10:32:42 -0700 (MST) From: Chandan Rajendra To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org Cc: Chandan Rajendra , quwenruo@cn.fujitsu.com Subject: [PATCH] btrfs/012: Enable test to be executed on non-4k block size filesystems Date: Mon, 26 Dec 2016 23:02:32 +0530 X-Mailer: git-send-email 2.5.5 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16122617-0016-0000-0000-0000058057D1 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006321; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000198; SDB=6.00799370; UDB=6.00388333; IPR=6.00577178; BA=6.00005009; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013724; XFM=3.00000011; UTC=2016-12-26 17:32:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16122617-0017-0000-0000-000035C8A105 Message-Id: <1482773552-15696-1-git-send-email-chandan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-26_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1612260286 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To get the test to work on non-4k block sized filesystems, this commit obtains the block size of the Btrfs filesystem from $TEST_DIR. Signed-off-by: Chandan Rajendra --- tests/btrfs/012 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/btrfs/012 b/tests/btrfs/012 index b39dec0..cbd3882 100755 --- a/tests/btrfs/012 +++ b/tests/btrfs/012 @@ -63,8 +63,10 @@ _require_command "$E2FSCK_PROG" e2fsck rm -f $seqres.full +BLOCK_SIZE=`get_block_size $TEST_DIR` + # Create & populate an ext4 filesystem -$MKFS_EXT4_PROG -F -b 4096 $SCRATCH_DEV > $seqres.full 2>&1 || \ +$MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \ _notrun "Could not create ext4 filesystem" # Manual mount so we don't use -t btrfs or selinux context mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT