From patchwork Tue Jul 9 11:05:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Monakhov X-Patchwork-Id: 257701 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C70E02C0299 for ; Tue, 9 Jul 2013 21:05:49 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753386Ab3GILFt (ORCPT ); Tue, 9 Jul 2013 07:05:49 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:13327 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840Ab3GILFl (ORCPT ); Tue, 9 Jul 2013 07:05:41 -0400 Received: from mct-mail.qa.sw.ru ([10.29.1.112]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id r69B5PIc022022; Tue, 9 Jul 2013 15:05:30 +0400 (MSK) From: Dmitry Monakhov To: xfs@oss.sgi.com Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, dchinner@redhat.com, Dmitry Monakhov Subject: [PATCH 4/4] large-fs: fix ext4 defragmentation tests Date: Tue, 9 Jul 2013 15:05:18 +0400 Message-Id: <1373367918-7516-4-git-send-email-dmonakhov@openvz.org> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1373367918-7516-1-git-send-email-dmonakhov@openvz.org> References: <1373367918-7516-1-git-send-email-dmonakhov@openvz.org> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Initially work space size calculation was based on size of blkdev which obviously wrong for large-fs case. This patch calculate work space based on `df` cmd. Signed-off-by: Dmitry Monakhov --- tests/ext4/301 | 20 +++++++++++--------- tests/ext4/302 | 15 ++++++++------- tests/ext4/303 | 15 ++++++++------- tests/ext4/304 | 15 ++++++++------- 4 files changed, 35 insertions(+), 30 deletions(-) diff --git a/tests/ext4/301 b/tests/ext4/301 index 30e4273..8c698b5 100755 --- a/tests/ext4/301 +++ b/tests/ext4/301 @@ -45,18 +45,13 @@ _require_scratch _require_defrag NUM_JOBS=$((4*LOAD_FACTOR)) -BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` -# We need space for 2 files (test file, and donor one) -# reserve 30% in order to avoid ENOSPC -FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1)))) - cat >$fio_config <> $seqres.full cat $fio_config >> $seqres.full - run_check $FIO_PROG $fio_config -} + run_check $FIO_PROG $fio_config -_require_fio $fio_config +} +# Temproraly export FIO_FILE_SIZE which is required for fio's job validation +export FIO_FILE_SIZE=16384 +_require_fio $fio_config _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/302 b/tests/ext4/302 index 5ce007b..e525977 100755 --- a/tests/ext4/302 +++ b/tests/ext4/302 @@ -45,18 +45,13 @@ _need_to_be_root _require_scratch _require_defrag -BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` -# We need space for 2 files (test file, and donor one) -# reserve 30% in order to avoid ENOSPC -FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1)))) - cat >$fio_config <> $seqres.full cat $fio_config >> $seqres.full run_check $FIO_PROG $fio_config } - +# Temproraly export FIO_FILE_SIZE which is required for fio's job validation +export FIO_FILE_SIZE=16384 _require_fio $fio_config _scratch_mkfs >> $seqres.full 2>&1 diff --git a/tests/ext4/303 b/tests/ext4/303 index f96264e..6fb6357 100755 --- a/tests/ext4/303 +++ b/tests/ext4/303 @@ -45,18 +45,13 @@ _need_to_be_root _require_scratch _require_defrag -BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` -# We need space for 3 files (one donor file and two test files) -# Reserve space for 4 files in order to avoid ENOSPC -FILE_SIZE=$((BLK_DEV_SIZE * (512 / (3+1)))) - cat >$fio_config <> $seqres.full cat $fio_config >> $seqres.full run_check $FIO_PROG $fio_config } - +# Temproraly export FIO_FILE_SIZE which is required for fio's job validation +export FIO_FILE_SIZE=16384 _require_fio $fio_config _scratch_mkfs >> $seqres.full 2>&1 diff --git a/tests/ext4/304 b/tests/ext4/304 index 5e03d4a..7cbf1dd 100755 --- a/tests/ext4/304 +++ b/tests/ext4/304 @@ -46,18 +46,13 @@ _need_to_be_root _require_scratch _require_defrag -BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` -# We need space for 2 files (test file, and donor one) -# reserve 30% in order to avoid ENOSPC -FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1)))) - cat >$fio_config <> $seqres.full cat $fio_config >> $seqres.full run_check $FIO_PROG $fio_config } - +# Temproraly export FIO_FILE_SIZE which is required for fio's job validation +export FIO_FILE_SIZE=16384 _require_fio $fio_config _scratch_mkfs >> $seqres.full 2>&1