From patchwork Tue May 29 16:55:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 10436463 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 057F0601E9 for ; Tue, 29 May 2018 16:56:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBA772844C for ; Tue, 29 May 2018 16:56:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFF7128A1B; Tue, 29 May 2018 16:56:17 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 9124C2844C for ; Tue, 29 May 2018 16:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965010AbeE2Q4Q (ORCPT ); Tue, 29 May 2018 12:56:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:39104 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936967AbeE2Q4G (ORCPT ); Tue, 29 May 2018 12:56:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 49797AD69 for ; Tue, 29 May 2018 16:56:05 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 16C2A1E04C7; Tue, 29 May 2018 18:56:05 +0200 (CEST) From: Jan Kara To: Cc: Jan Kara Subject: [PATCH 1/6] dmhugedisk: Allow specifying of chunk size Date: Tue, 29 May 2018 18:55:56 +0200 Message-Id: <20180529165601.32133-2-jack@suse.cz> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180529165601.32133-1-jack@suse.cz> References: <20180529165601.32133-1-jack@suse.cz> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ext4 will want to use dmhugedisk infrastructure for testing resize bugs. Ext4 fs images are rather sparse (especially with smaller block sizes) so the current chunk size of 512 sectors leads to large space consumption. Allow test to specify chunk size. Signed-off-by: Jan Kara --- common/dmhugedisk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/dmhugedisk b/common/dmhugedisk index 4d3b63fcfcca..733b10cd2292 100644 --- a/common/dmhugedisk +++ b/common/dmhugedisk @@ -31,6 +31,11 @@ _dmhugedisk_init() { test -z "$1" && _fatal "must specify sector count to _dmhugedisk_init" local dm_backing_dev=$SCRATCH_DEV + local chunk_size="$2" + + if [ -z "$chunk_size" ]; then + chunk_size=512 + fi $DMSETUP_PROG remove huge-test > /dev/null 2>&1 $DMSETUP_PROG remove huge-test-zero > /dev/null 2>&1 @@ -41,7 +46,7 @@ _dmhugedisk_init() DMHUGEDISK_DEV='/dev/mapper/huge-test' DMHUGEDISK_ZERO_TABLE="0 $blk_dev_size zero" - DMHUGEDISK_DEV_TABLE="0 $blk_dev_size snapshot $DMHUGEDISK_ZERO $SCRATCH_DEV N 512" + DMHUGEDISK_DEV_TABLE="0 $blk_dev_size snapshot $DMHUGEDISK_ZERO $SCRATCH_DEV N $chunk_size" $DMSETUP_PROG create huge-test-zero --table "$DMHUGEDISK_ZERO_TABLE" || \ _fatal "failed to create dm huge zero device"