From patchwork Sat Nov 10 11:51:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10677087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 509CD109C for ; Sat, 10 Nov 2018 11:51:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D6B32CF3E for ; Sat, 10 Nov 2018 11:51:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 307EC2CF6D; Sat, 10 Nov 2018 11:51:55 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 501DB2CF08 for ; Sat, 10 Nov 2018 11:51:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728989AbeKJVgj (ORCPT ); Sat, 10 Nov 2018 16:36:39 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35884 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728983AbeKJVgj (ORCPT ); Sat, 10 Nov 2018 16:36:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SGwMu/Ow3JRKB5dXev1lD/C2OcrKPisiPwJTsIvdEkA=; b=p9yv2LAWxwCzovrnl7Hhl152VX ZeZCEyWC26/9GWbdyL5cNdLW2RAb2sosrqNPhMqf6Mp3LRibHoO2LTywatO1JFSuvFWgzp0KPMJK4 7Vo4DSY2BFTtiJG4qU8hrItXMZ075b85748jhSaQRMeGp7l85wu59HFbFAOG6aw2be+2i9Qec/2AY r25TYU86jH8zWR1NKGgOIntfzbPfIELxxLkmo1FCbEOoAOYalJgf3iq9TdmIWRIw4croHhJUpoPP2 MD5izEmFaSItP3CZBhhTKYeAHgQvxBb2e/vQKg2o7fXjVPnpbUSS3hAfaBKrIQa8q9j113kaGTPEI F5aCphNw==; Received: from 089144211136.atnat0020.highway.a1.net ([89.144.211.136] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLRnt-0000cE-3N; Sat, 10 Nov 2018 11:51:53 +0000 From: Christoph Hellwig To: guaneryu@gmail.com Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 1/5] generic: move prealloc-enabled fsx to separate tests Date: Sat, 10 Nov 2018 12:51:41 +0100 Message-Id: <20181110115145.30356-2-hch@lst.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181110115145.30356-1-hch@lst.de> References: <20181110115145.30356-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently generic/075 and generic/112 have two extra fsx passes each that exercise fsx with preallocation, which are only enabled for XFS. These tests can also be run with other file systems, given that the XFS prealloc ioctls are implemented in generic code since the addition of the fallocate system call. This also means a version of XFS that does not support preallocation (e.g. because it always writes out of place) can skip the prealloc tests while still completing the normal fsx tests just fine. Signed-off-by: Christoph Hellwig --- tests/generic/075 | 7 +-- tests/generic/075.out | 10 +-- tests/generic/112 | 13 +--- tests/generic/112.out | 10 +-- tests/generic/601 | 136 +++++++++++++++++++++++++++++++++++++++++ tests/generic/601.out | 10 +++ tests/generic/602 | 137 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/602.out | 10 +++ tests/generic/group | 2 + 9 files changed, 299 insertions(+), 36 deletions(-) create mode 100755 tests/generic/601 create mode 100644 tests/generic/601.out create mode 100755 tests/generic/602 create mode 100644 tests/generic/602.out diff --git a/tests/generic/075 b/tests/generic/075 index 2b957891..424ec485 100755 --- a/tests/generic/075 +++ b/tests/generic/075 @@ -48,14 +48,11 @@ _do_test() echo "fsx.$_n : $_filter_param" echo "-----------------------------------------------" - if [ "$FSTYP" != "xfs" ] - then if [ "$_n" = "1" -o "$_n" = "3" ] then # HACK: only xfs handles preallocation (-x) so just skip this test return fi - fi # This cd and use of -P gets full debug on $here (not TEST_DEV) cd $out @@ -138,9 +135,7 @@ _check_test_fs # -x: pre-allocate file space, exercising unwritten extents _do_test 0 "-d -N $numops1 -S 0" -_do_test 1 "-d -N $numops1 -S 0 -x" -_do_test 2 "-d -N $numops2 -l $filelen -S 0" -_do_test 3 "-d -N $numops2 -l $filelen -S 0 -x" +_do_test 1 "-d -N $numops2 -l $filelen -S 0" rm -f $seq.*.fsx{good,log} exit 0 diff --git a/tests/generic/075.out b/tests/generic/075.out index 1f81cdf0..3ad4ae95 100644 --- a/tests/generic/075.out +++ b/tests/generic/075.out @@ -6,13 +6,5 @@ fsx.0 : -d -N numops -S 0 ----------------------------------------------- ----------------------------------------------- -fsx.1 : -d -N numops -S 0 -x ------------------------------------------------ - ------------------------------------------------ -fsx.2 : -d -N numops -l filelen -S 0 ------------------------------------------------ - ------------------------------------------------ -fsx.3 : -d -N numops -l filelen -S 0 -x +fsx.1 : -d -N numops -l filelen -S 0 ----------------------------------------------- diff --git a/tests/generic/112 b/tests/generic/112 index 1879e7b5..c9c5e194 100755 --- a/tests/generic/112 +++ b/tests/generic/112 @@ -48,15 +48,6 @@ _do_test() echo "fsx.$_n : $_filter_param" echo "-----------------------------------------------" - if [ "$FSTYP" != "xfs" ] - then - if [ "$_n" = "1" -o "$_n" = "3" ] - then - # HACK: only xfs handles preallocation (-x) so just skip this test - return - fi - fi - # This cd and use of -P gets full debug on $here (not TEST_DEV) cd $out if ! $here/ltp/fsx $_param -P $here $FSX_AVOID $seq.$_n &>/dev/null @@ -139,9 +130,7 @@ _check_test_fs # -A: use the AIO system calls _do_test 0 "-A -d -N $numops1 -S 0" -_do_test 1 "-A -d -N $numops1 -S 0 -x" -_do_test 2 "-A -d -N $numops2 -l $filelen -S 0" -_do_test 3 "-A -d -N $numops2 -l $filelen -S 0 -x" +_do_test 1 "-A -d -N $numops2 -l $filelen -S 0" rm -f $seq.*.fsx{good,log} exit 0 diff --git a/tests/generic/112.out b/tests/generic/112.out index 7d1709cf..488ec682 100644 --- a/tests/generic/112.out +++ b/tests/generic/112.out @@ -6,13 +6,5 @@ fsx.0 : -A -d -N numops -S 0 ----------------------------------------------- ----------------------------------------------- -fsx.1 : -A -d -N numops -S 0 -x ------------------------------------------------ - ------------------------------------------------ -fsx.2 : -A -d -N numops -l filelen -S 0 ------------------------------------------------ - ------------------------------------------------ -fsx.3 : -A -d -N numops -l filelen -S 0 -x +fsx.1 : -A -d -N numops -l filelen -S 0 ----------------------------------------------- diff --git a/tests/generic/601 b/tests/generic/601 new file mode 100755 index 00000000..3fb785a1 --- /dev/null +++ b/tests/generic/601 @@ -0,0 +1,136 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. +# +# FS QA Test No. 601 +# +# fsx (non-AIO variant, with preallocation) +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $TEST_DIR/fsx.* $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +_do_test() +{ + _n="$1" + _param="$2" + + out=$TEST_DIR/fsx + rm -rf $out + if ! mkdir $out + then + echo " failed to mkdir $out" + status=1 + exit + fi + + _filter_param=`echo "$_param" | sed\ + -e 's/-N [0-9][0-9]*/-N numops/' \ + -e 's/-l [0-9][0-9]*/-l filelen/'` + + echo "" + echo "-----------------------------------------------" + echo "fsx.$_n : $_filter_param" + echo "-----------------------------------------------" + + # This cd and use of -P gets full debug on $here (not TEST_DEV) + cd $out + if ! $here/ltp/fsx $_param -P $here $seq.$_n $FSX_AVOID &>/dev/null + then + echo " fsx ($_param) failed, $? - compare $seqres.$_n.{good,bad,fsxlog}" + mv $out/$seq.$_n $seqres.$_n.full + mv $here/$seq.$_n.fsxlog $seqres.$_n.fsxlog + od -xAx $seqres.$_n.full > $seqres.$_n.bad + od -xAx $here/$seq.$_n.fsxgood > $seqres.$_n.good + rm -f $here/$seq.$_n.fsxgood + status=1 + exit + fi + + cd $here + _check_test_fs +} + +_usage() +{ + echo "$0: [-l filelen] [-n numops1] [-N numops2]" +} + +_process_args() +{ + OPTIND=1 + while getopts "l:n:N:?" c $@ + do + case $c + in + l) + filelen=$OPTARG + param_type="$param_type, overidde -l" + ;; + N) + numops2=$OPTARG + param_type="$param_type, overidde -N" + ;; + n) + numops1=$OPTARG + param_type="$param_type, overidde -n" + ;; + ?) + _usage + exit + ;; + esac + done +} + +# real QA test starts here +_supported_fs generic +_supported_os Linux +_require_test +_require_xfs_io_command "falloc" + +size10=`expr 10 \* 1024 \* 1024` # 10 megabytes +filelen=$size10 +numops1=1000 +numops2=10000 + +# can override the params here +_process_args "$@" + +echo "Params are for $param_type" >>$seqres.full +echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full + +rm -f $seqres.full +echo "brevity is wit..." + +_check_test_fs + +# Options: +# -d: debug output for all operations +# -l flen: the upper bound on file size (default 262144) +# -o oplen: the upper bound on operation size +# -N numops: total # operations to do (default infinity) +# -P: save .fsxlog and .fsxgood files in dirpath (default ./) +# -S seed: for random # generator (default 1) 0 gets timestamp +# -x: pre-allocate file space, exercising unwritten extents + +_do_test 0 "-d -N $numops1 -S 0 -x" +_do_test 1 "-d -N $numops2 -l $filelen -S 0 -x" + +rm -f $seq.*.fsx{good,log} +exit 0 diff --git a/tests/generic/601.out b/tests/generic/601.out new file mode 100644 index 00000000..d1346da2 --- /dev/null +++ b/tests/generic/601.out @@ -0,0 +1,10 @@ +QA output created by 601 +brevity is wit... + +----------------------------------------------- +fsx.0 : -d -N numops -S 0 -x +----------------------------------------------- + +----------------------------------------------- +fsx.1 : -d -N numops -l filelen -S 0 -x +----------------------------------------------- diff --git a/tests/generic/602 b/tests/generic/602 new file mode 100755 index 00000000..ec853eb1 --- /dev/null +++ b/tests/generic/602 @@ -0,0 +1,137 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. +# +# FS QA Test No. 602 +# +# fsx (AIO variant, with preallocation, based on 601) +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 # success is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -rf $TEST_DIR/fsx.* $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +_do_test() +{ + _n="$1" + _param="$2" + + out=$TEST_DIR/fsx + rm -rf $out + if ! mkdir $out + then + echo " failed to mkdir $out" + status=1 + exit + fi + + _filter_param=`echo "$_param" | sed\ + -e 's/-N [0-9][0-9]*/-N numops/' \ + -e 's/-l [0-9][0-9]*/-l filelen/'` + + echo "" + echo "-----------------------------------------------" + echo "fsx.$_n : $_filter_param" + echo "-----------------------------------------------" + + # This cd and use of -P gets full debug on $here (not TEST_DEV) + cd $out + if ! $here/ltp/fsx $_param -P $here $FSX_AVOID $seq.$_n &>/dev/null + then + echo " fsx ($_param) returned $? - see $seq.$_n.full" + mv $here/$seq.$_n.fsxlog $seqres.$_n.full + status=1 + exit + fi + + cd $here + _check_test_fs +} + +_usage() +{ + echo "$0: [-l filelen] [-n numops1] [-N numops2]" +} + +_process_args() +{ + OPTIND=1 + while getopts "l:n:N:?" c $@ + do + case $c + in + l) + filelen=$OPTARG + param_type="$param_type, overidde -l" + ;; + N) + numops2=$OPTARG + param_type="$param_type, overidde -N" + ;; + n) + numops1=$OPTARG + param_type="$param_type, overidde -n" + ;; + ?) + _usage + exit + ;; + esac + done +} + +# real QA test starts here +_supported_fs generic +_supported_os Linux +_require_test +_require_aio +_require_xfs_io_command "falloc" + +[ -x $here/ltp/aio-stress ] || \ + _notrun "fsx not built with AIO for this platform" + +size10=`expr 10 \* 1024 \* 1024` # 10 megabytes +filelen=$size10 +numops1=1000 +numops2=10000 + +# can override the params here +_process_args "$@" + +echo "Params are for $param_type" >>$seqres.full +echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full + +rm -f $seqres.full +echo "brevity is wit..." + +_check_test_fs + +# Options: +# -d: debug output for all operations +# -l flen: the upper bound on file size (default 262144) +# -o oplen: the upper bound on operation size +# -N numops: total # operations to do (default infinity) +# -P: save .fsxlog and .fsxgood files in dirpath (default ./) +# -S seed: for random # generator (default 1) 0 gets timestamp +# -x: pre-allocate file space, exercising unwritten extents +# -A: use the AIO system calls + +_do_test 0 "-A -d -N $numops1 -S 0 -x" +_do_test 1 "-A -d -N $numops2 -l $filelen -S 0 -x" + +rm -f $seq.*.fsx{good,log} +exit 0 diff --git a/tests/generic/602.out b/tests/generic/602.out new file mode 100644 index 00000000..bf771f04 --- /dev/null +++ b/tests/generic/602.out @@ -0,0 +1,10 @@ +QA output created by 602 +brevity is wit... + +----------------------------------------------- +fsx.0 : -A -d -N numops -S 0 -x +----------------------------------------------- + +----------------------------------------------- +fsx.1 : -A -d -N numops -l filelen -S 0 -x +----------------------------------------------- diff --git a/tests/generic/group b/tests/generic/group index 54d71d55..b01e1cb0 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -519,3 +519,5 @@ 514 auto quick clone 515 auto quick clone 516 auto quick dedupe clone +601 auto rw +602 auto aio rw