From patchwork Thu Mar 8 08:30:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lu Fengqi X-Patchwork-Id: 10267193 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 6661760211 for ; Thu, 8 Mar 2018 08:31:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 577D328C2C for ; Thu, 8 Mar 2018 08:31:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B626297FF; Thu, 8 Mar 2018 08:31:09 +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 E7BB128C2C for ; Thu, 8 Mar 2018 08:31:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935383AbeCHIbG (ORCPT ); Thu, 8 Mar 2018 03:31:06 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:58506 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935317AbeCHIbF (ORCPT ); Thu, 8 Mar 2018 03:31:05 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="37608672" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 08 Mar 2018 16:31:04 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 9BFB748AE761; Thu, 8 Mar 2018 16:31:01 +0800 (CST) Received: from fnst.localdomain (10.167.226.155) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 8 Mar 2018 16:31:05 +0800 From: Lu Fengqi To: , Subject: [PATCH v3] fstests: btrfs/146: make sure hit all stripes in the case of compression Date: Thu, 8 Mar 2018 16:30:53 +0800 Message-ID: <20180308083053.3604-1-lufq.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.16.2 MIME-Version: 1.0 X-Originating-IP: [10.167.226.155] X-yoursite-MailScanner-ID: 9BFB748AE761.ADF83 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lufq.fnst@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the case of compression, each 128K input data chunk will be compressed to 4K (because of the characters written are duplicate). Therefore we have to write (128K * 16) to make sure every stripe can be hit. Signed-off-by: Lu Fengqi --- V3: Write ($number_of_devices * 2048)K data unconditionally. V2: Modify the regular expression to ensure that it matches various compress mount options. tests/btrfs/146 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/btrfs/146 b/tests/btrfs/146 index 7071c128ca0a..246baba1427a 100755 --- a/tests/btrfs/146 +++ b/tests/btrfs/146 @@ -74,9 +74,12 @@ _scratch_pool_mkfs "-d raid0 -m raid1" > $seqres.full 2>&1 _scratch_mount # How much do we need to write? We need to hit all of the stripes. btrfs uses -# a fixed 64k stripesize, so write enough to hit each one +# a fixed 64k stripesize, so write enough to hit each one. In the case of +# compression, each 128K input data chunk will be compressed to 4K (because of +# the characters written are duplicate). Therefore we have to write (128K * 16) +# to make sure every stripe can be hit. number_of_devices=`echo $SCRATCH_DEV_POOL | wc -w` -write_kb=$(($number_of_devices * 64)) +write_kb=$(($number_of_devices * 2048)) _require_fs_space $SCRATCH_MNT $write_kb testfile=$SCRATCH_MNT/fsync-err-test