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 From patchwork Sat Nov 10 11:51:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10677091 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 B004B139B for ; Sat, 10 Nov 2018 11:51:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F29B2CF08 for ; Sat, 10 Nov 2018 11:51:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93F2B2CF6D; Sat, 10 Nov 2018 11:51:57 +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 336722CF08 for ; Sat, 10 Nov 2018 11:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729013AbeKJVgm (ORCPT ); Sat, 10 Nov 2018 16:36:42 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35900 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728983AbeKJVgm (ORCPT ); Sat, 10 Nov 2018 16:36:42 -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=XJwnmLnaFIEuzGp0nkPcSPThSJtpj9DQFVRh+JPJkIc=; b=lIEp7fa+r+5N9GbYQrcBeK/n4f 89TVAMlkLSLO7hMp3E85r+WeQTfBk+g9pC6Q1xRQwvoV0PSVWkDBzHnumtCIQE6lgjOUrn5Z0J9QD hD4u0LwYjgsZWYIpeP9ruxjzf8+7DOy65HECfBX6HrPTgdDtjSQhU5v9IF/zRuthiNQViRRUPw+zX THtc7/fLVDgHrvibFDL2qcrCQwgMdfOA4nK4bR3qLMKsbYCTEnbGFwsZJcF2MtanZQvPoZBFSIxvs V9mHLwYO0yghGTzHzbUF/TwDcvYWlJG67IC3VoHlgB+psubndCjw0Udp6iALuan1H1uIXUQREKMI3 IdLg1A8w==; 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 1gLRnv-0000ca-Ti; Sat, 10 Nov 2018 11:51:56 +0000 From: Christoph Hellwig To: guaneryu@gmail.com Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 2/5] generic: don't assume preallocation is supported when reflinks are supported Date: Sat, 10 Nov 2018 12:51:42 +0100 Message-Id: <20181110115145.30356-3-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 Various reflink tests currently use fallocate to preallocate space without first checking that preallocations are supported. Add explicit checks. Signed-off-by: Christoph Hellwig --- tests/generic/176 | 1 + tests/generic/372 | 1 + tests/generic/414 | 1 + tests/generic/415 | 1 + tests/generic/447 | 1 + tests/generic/515 | 1 + 6 files changed, 6 insertions(+) diff --git a/tests/generic/176 b/tests/generic/176 index e0c0f225..a084578a 100755 --- a/tests/generic/176 +++ b/tests/generic/176 @@ -31,6 +31,7 @@ _cleanup() _supported_os Linux _require_scratch_reflink _require_cp_reflink +_require_xfs_io_command "fpunch" _require_test_program "punch-alternating" rm -f "$seqres.full" diff --git a/tests/generic/372 b/tests/generic/372 index 44914453..21cf283b 100755 --- a/tests/generic/372 +++ b/tests/generic/372 @@ -31,6 +31,7 @@ _cleanup() _supported_os Linux _supported_fs generic _require_scratch_reflink +_require_xfs_io_command "falloc" _require_xfs_io_command "fiemap" _require_scratch_explicit_shared_extents diff --git a/tests/generic/414 b/tests/generic/414 index 7c76d580..f9f26744 100755 --- a/tests/generic/414 +++ b/tests/generic/414 @@ -32,6 +32,7 @@ _cleanup() _supported_os Linux _supported_fs generic _require_scratch_reflink +_require_xfs_io_command "falloc" _require_xfs_io_command "fiemap" echo "Format and mount" diff --git a/tests/generic/415 b/tests/generic/415 index 14fbc232..0b7554ff 100755 --- a/tests/generic/415 +++ b/tests/generic/415 @@ -34,6 +34,7 @@ _supported_fs generic _supported_os Linux _require_scratch_reflink _require_cp_reflink +_require_xfs_io_command "fpunch" _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount || _fail "mount failed" diff --git a/tests/generic/447 b/tests/generic/447 index 3775e49f..1e7cb3c8 100755 --- a/tests/generic/447 +++ b/tests/generic/447 @@ -32,6 +32,7 @@ _supported_os Linux _require_scratch_reflink _require_cp_reflink _require_test_program "punch-alternating" +_require_xfs_io_command "fpunch" rm -f "$seqres.full" diff --git a/tests/generic/515 b/tests/generic/515 index 1ae9fbfe..f9e0b3be 100755 --- a/tests/generic/515 +++ b/tests/generic/515 @@ -31,6 +31,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch_reflink +_require_xfs_io_command "falloc" rm -f $seqres.full From patchwork Sat Nov 10 11:51:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10677095 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 6AE7C109C for ; Sat, 10 Nov 2018 11:52:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 595DE2CF08 for ; Sat, 10 Nov 2018 11:52:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DF562CF6D; Sat, 10 Nov 2018 11:52:00 +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 950AE2CF08 for ; Sat, 10 Nov 2018 11:51:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729034AbeKJVgo (ORCPT ); Sat, 10 Nov 2018 16:36:44 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35916 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728983AbeKJVgo (ORCPT ); Sat, 10 Nov 2018 16:36:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To: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=oJOnsnYuILjZM11nsdfT5NGhf4wLHKTSYC7LTMHQqwA=; b=ONvXu1YpkW3cEi6XmYrV9VuJ3 yA1qS+zoVJJ9kP1Yf7L8LSzZxTiWAGiCu65g4JV3K0W3ACsJo3JnTMnUpG/DzKfyX5iCIMWFieqeu TtG2Zs65/WNGVnAOaJelsb3X70lb9RKfINYw4CY8lnHJjqne9jj5ZN13gDoej5T3FhHcdoRRrt70Y tKd/9+F9cOXNFMJRaQ9TkvP4cilMm90ahi0cubzXGCzH22o0QZuQBNE8dIWunTpJriSu+kDFuMrMI URHJJt9URby3I3K/nyDQYXc4Ct6PSjqWl/AFuMKfSBlvpygVEuwDOMyHZ6HUCC04A5IKF4+5rDTcv lbpPYcpsQ==; 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 1gLRny-0000dP-Hc; Sat, 10 Nov 2018 11:51:58 +0000 From: Christoph Hellwig To: guaneryu@gmail.com Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 3/5] xfs: don't assume preallocation is always supported on XFS Date: Sat, 10 Nov 2018 12:51:43 +0100 Message-Id: <20181110115145.30356-4-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 The always_cow mode can't usefull preallocate space gіven that it always has to write out of place, and thus will reject falloc or ioctl calls to preallocate space in a file. Add explicit checks for preallocation support in various XFS-specific tests to support this. --- tests/xfs/009 | 1 + tests/xfs/072 | 3 +-- tests/xfs/084 | 1 + tests/xfs/104 | 1 + tests/xfs/128 | 1 + tests/xfs/164 | 1 + tests/xfs/165 | 1 + tests/xfs/166 | 2 ++ tests/xfs/167 | 1 + tests/xfs/231 | 1 + tests/xfs/232 | 1 + tests/xfs/242 | 1 + tests/xfs/250 | 1 + tests/xfs/280 | 1 + tests/xfs/294 | 2 ++ tests/xfs/312 | 1 + tests/xfs/313 | 1 + tests/xfs/316 | 1 + tests/xfs/324 | 1 + tests/xfs/326 | 1 + tests/xfs/328 | 1 + tests/xfs/330 | 1 + tests/xfs/444 | 1 + tests/xfs/445 | 1 + 24 files changed, 26 insertions(+), 2 deletions(-) diff --git a/tests/xfs/009 b/tests/xfs/009 index 7f95156c..9385d3b9 100755 --- a/tests/xfs/009 +++ b/tests/xfs/009 @@ -48,6 +48,7 @@ _supported_fs xfs _supported_os Linux _require_scratch +_require_xfs_io_command "falloc" _filesize() { diff --git a/tests/xfs/072 b/tests/xfs/072 index 735260b7..f86e4003 100755 --- a/tests/xfs/072 +++ b/tests/xfs/072 @@ -30,9 +30,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fs xfs _supported_os Linux -[ -n "$XFS_IO_PROG" ] || _notrun "xfs_io executable not found" - _require_scratch +_require_xfs_io_command "falloc" rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 diff --git a/tests/xfs/084 b/tests/xfs/084 index 8e9aff3c..fcdfc185 100755 --- a/tests/xfs/084 +++ b/tests/xfs/084 @@ -35,6 +35,7 @@ pgsize=`$here/src/feature -s` # real QA test starts here _supported_fs xfs _supported_os Linux +_require_xfs_io_command "falloc" _require_test echo diff --git a/tests/xfs/104 b/tests/xfs/104 index 218e2b60..bc38f969 100755 --- a/tests/xfs/104 +++ b/tests/xfs/104 @@ -55,6 +55,7 @@ _stress_scratch() # real QA test starts here _supported_fs xfs _require_scratch +_require_xfs_io_command "falloc" rm -f $seqres.full _scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs diff --git a/tests/xfs/128 b/tests/xfs/128 index 40ea0f04..f1b4fb4f 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -32,6 +32,7 @@ _supported_fs xfs _require_test_lsattr _require_scratch_reflink _require_cp_reflink +_require_xfs_io_command "falloc" echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 diff --git a/tests/xfs/164 b/tests/xfs/164 index fdd9293d..b0ec6df5 100755 --- a/tests/xfs/164 +++ b/tests/xfs/164 @@ -52,6 +52,7 @@ _filter_bmap() _supported_fs xfs _supported_os Linux _require_test +_require_xfs_io_command "falloc" testfile=$TEST_DIR/file.$seq rm -f $seqres.full diff --git a/tests/xfs/165 b/tests/xfs/165 index 4f6738d4..990d054c 100755 --- a/tests/xfs/165 +++ b/tests/xfs/165 @@ -49,6 +49,7 @@ _filter_bmap() _supported_fs xfs _supported_os Linux _require_test +_require_xfs_io_command "falloc" # io tests testfile=$TEST_DIR/file.$seq diff --git a/tests/xfs/166 b/tests/xfs/166 index 9814e4a3..8dc7e080 100755 --- a/tests/xfs/166 +++ b/tests/xfs/166 @@ -60,6 +60,8 @@ _supported_fs xfs _supported_os Linux _require_scratch +_require_xfs_io_command "falloc" + _scratch_mkfs_xfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/167 b/tests/xfs/167 index 40b45e86..015002d4 100755 --- a/tests/xfs/167 +++ b/tests/xfs/167 @@ -41,6 +41,7 @@ _supported_fs xfs _supported_os Linux _require_command "$KILLALL_PROG" killall +_require_xfs_io_command "falloc" _require_scratch _scratch_mkfs_xfs >/dev/null 2>&1 diff --git a/tests/xfs/231 b/tests/xfs/231 index 865c0331..12fdc490 100755 --- a/tests/xfs/231 +++ b/tests/xfs/231 @@ -38,6 +38,7 @@ _supported_fs xfs _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "cowextsize" +_require_xfs_io_command "falloc" _require_xfs_io_command "fiemap" old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime) diff --git a/tests/xfs/232 b/tests/xfs/232 index 3a88cc33..e768fa27 100755 --- a/tests/xfs/232 +++ b/tests/xfs/232 @@ -39,6 +39,7 @@ _supported_fs xfs _require_xfs_io_command "cowextsize" _require_scratch_reflink _require_cp_reflink +_require_xfs_io_command "falloc" _require_xfs_io_command "fiemap" old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime) diff --git a/tests/xfs/242 b/tests/xfs/242 index 9ae1aebd..5ce2c6f0 100755 --- a/tests/xfs/242 +++ b/tests/xfs/242 @@ -31,6 +31,7 @@ _supported_fs xfs _supported_os Linux _require_test +_require_xfs_io_command "falloc" _require_xfs_io_command "zero" testfile=$TEST_DIR/242.$$ diff --git a/tests/xfs/250 b/tests/xfs/250 index f8b800e4..1f4d818e 100755 --- a/tests/xfs/250 +++ b/tests/xfs/250 @@ -32,6 +32,7 @@ _supported_fs xfs _supported_os Linux _require_test _require_loop +_require_xfs_io_command "falloc" LOOP_DEV=$TEST_DIR/$seq.fs LOOP_MNT=$TEST_DIR/$seq.mnt diff --git a/tests/xfs/280 b/tests/xfs/280 index 172eee21..76287c85 100755 --- a/tests/xfs/280 +++ b/tests/xfs/280 @@ -31,6 +31,7 @@ _supported_os Linux _supported_fs xfs _require_scratch_reflink _require_xfs_io_command "bmap" +_require_xfs_io_command "falloc" echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 diff --git a/tests/xfs/294 b/tests/xfs/294 index 4c919432..bce4d07b 100755 --- a/tests/xfs/294 +++ b/tests/xfs/294 @@ -42,6 +42,8 @@ _supported_fs xfs _supported_os Linux _require_scratch _require_test_program "punch-alternating" +_require_xfs_io_command "falloc" +_require_xfs_io_command "fpunch" # We want to mkfs with a very specific geometry MKFS_OPTIONS="" diff --git a/tests/xfs/312 b/tests/xfs/312 index cdec9233..fa05754e 100755 --- a/tests/xfs/312 +++ b/tests/xfs/312 @@ -34,6 +34,7 @@ _supported_os Linux _supported_fs xfs _require_cp_reflink _require_scratch_reflink +_require_xfs_io_command "fpunch" _require_xfs_io_error_injection "bmap_finish_one" rm -f $seqres.full diff --git a/tests/xfs/313 b/tests/xfs/313 index 47ef7ec8..97c24f0a 100755 --- a/tests/xfs/313 +++ b/tests/xfs/313 @@ -34,6 +34,7 @@ _supported_os Linux _supported_fs xfs _require_cp_reflink _require_scratch_reflink +_require_xfs_io_command "fpunch" _require_xfs_io_error_injection "refcount_finish_one" rm -f $seqres.full diff --git a/tests/xfs/316 b/tests/xfs/316 index d0cd1e2f..063f0e43 100755 --- a/tests/xfs/316 +++ b/tests/xfs/316 @@ -35,6 +35,7 @@ _supported_fs xfs _require_cp_reflink _require_scratch_reflink _require_error_injection +_require_xfs_io_command "fpunch" _require_xfs_io_error_injection "refcount_continue_update" rm -f $seqres.full diff --git a/tests/xfs/324 b/tests/xfs/324 index a1be3318..e8ed2fc5 100755 --- a/tests/xfs/324 +++ b/tests/xfs/324 @@ -35,6 +35,7 @@ _supported_fs xfs _require_cp_reflink _require_scratch_reflink _require_error_injection +_require_xfs_io_command "fpunch" _require_xfs_io_error_injection "refcount_continue_update" rm -f $seqres.full diff --git a/tests/xfs/326 b/tests/xfs/326 index b6e01862..bb7e5590 100755 --- a/tests/xfs/326 +++ b/tests/xfs/326 @@ -37,6 +37,7 @@ _supported_fs xfs _require_cp_reflink _require_scratch_reflink _require_xfs_io_command "cowextsize" +_require_xfs_io_command "fpunch" _require_xfs_io_error_injection "refcount_finish_one" rm -f $seqres.full diff --git a/tests/xfs/328 b/tests/xfs/328 index ab8af12f..55fe3ec9 100755 --- a/tests/xfs/328 +++ b/tests/xfs/328 @@ -33,6 +33,7 @@ _supported_fs xfs _require_scratch_reflink _require_cp_reflink _require_test_program "punch-alternating" +_require_xfs_io_command "falloc" # used in FSR _require_command "$XFS_FSR_PROG" "xfs_fsr" rm -f "$seqres.full" diff --git a/tests/xfs/330 b/tests/xfs/330 index 3682525d..66a9b6e2 100755 --- a/tests/xfs/330 +++ b/tests/xfs/330 @@ -33,6 +33,7 @@ _supported_os Linux _supported_fs xfs _require_scratch_reflink _require_cp_reflink +_require_xfs_io_command "falloc" # used in FSR _require_command "$XFS_FSR_PROG" "xfs_fsr" _require_quota _require_nobody diff --git a/tests/xfs/444 b/tests/xfs/444 index f1c0ed03..7a33b9e9 100755 --- a/tests/xfs/444 +++ b/tests/xfs/444 @@ -38,6 +38,7 @@ _supported_os Linux _require_check_dmesg _require_scratch _require_test_program "punch-alternating" +_require_xfs_io_command "falloc" _require_xfs_db_write_array # This is only a v5 filesystem problem diff --git a/tests/xfs/445 b/tests/xfs/445 index 2d205a40..800d5d28 100755 --- a/tests/xfs/445 +++ b/tests/xfs/445 @@ -53,6 +53,7 @@ drop_caches() _supported_fs generic _supported_os Linux _require_scratch_size $((2*1024*1024)) # kb +_require_xfs_io_command "falloc" # check for filestreams _check_filestreams_support || _notrun "filestreams not available" From patchwork Sat Nov 10 11:51:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10677099 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 80423109C for ; Sat, 10 Nov 2018 11:52:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FCF42CF08 for ; Sat, 10 Nov 2018 11:52:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6421E2CF3E; Sat, 10 Nov 2018 11:52:02 +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 1DCDB2CF08 for ; Sat, 10 Nov 2018 11:52:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728983AbeKJVgr (ORCPT ); Sat, 10 Nov 2018 16:36:47 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35928 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728910AbeKJVgr (ORCPT ); Sat, 10 Nov 2018 16:36:47 -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=laEqnd2jgcohyjOgF3N7kddKvk8fT63lNC4qsNBtKo8=; b=gRbUOXI8FCLzbTb6ytEBFmeUKa qNiBrRj+d/qXuLEtTqNVnR37peZf80xqkbFK7xoeNfEDMwqPW0tQFTeqsuRN4z2dDGZs4n4X5Vs+T f47gi2l5EJlwV2yIvNLWjqSbpdQmWGayGUclMPq0A9dRGF8gBd9pz55kNXKj6pcJhp61BI3NvwwIY GH+uEKzgP1YUQxNNyQI+hqjHzDCsxR5vHYOZSzcnJW1LKOCwrkYMfY2TF0nzw9ktobxcwmn61GN/M 8/5T/GteICm496wLCcaH3PEEBN9rQaevsaLZ++/u8j4Mlgfo4t4dDueZg9S3JfUhbQdKCKdYduzH9 wUw5LI1Q==; 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 1gLRo1-0000dt-4c; Sat, 10 Nov 2018 11:52:01 +0000 From: Christoph Hellwig To: guaneryu@gmail.com Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 4/5] xfs: xfs_fsr requires working preallocation support Date: Sat, 10 Nov 2018 12:51:44 +0100 Message-Id: <20181110115145.30356-5-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 Check that the file system actually supports preallocation for defrag tests that end up calling xfs_fsr, as they can't be supported in always_cow mode. Signed-off-by: Christoph Hellwig --- common/defrag | 1 + 1 file changed, 1 insertion(+) diff --git a/common/defrag b/common/defrag index df249dfd..79485f0d 100644 --- a/common/defrag +++ b/common/defrag @@ -8,6 +8,7 @@ _require_defrag() { case "$FSTYP" in xfs) + _require_xfs_io_command "falloc" DEFRAG_PROG="$XFS_FSR_PROG" ;; ext4|ext4dev) From patchwork Sat Nov 10 11:51:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10677103 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 1DC4E139B for ; Sat, 10 Nov 2018 11:52:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CB2D2CF08 for ; Sat, 10 Nov 2018 11:52:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00C432CF6E; Sat, 10 Nov 2018 11:52:05 +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 E682A2CF08 for ; Sat, 10 Nov 2018 11:52:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729064AbeKJVgu (ORCPT ); Sat, 10 Nov 2018 16:36:50 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35942 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729060AbeKJVgt (ORCPT ); Sat, 10 Nov 2018 16:36:49 -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=+q3tJzwm+wKdh5f2q+S2mknXBGmZdAyIaQEPmpeWywU=; b=SEacM9KCpUHTMu3AMn62n843vg m0l6OzXEk/RRFB8tvBYFnGk2xRl1YaPu8ipGrX4VxIKedRccztqfCGjB1+CqpFa2cDbx+Lt/MgBZN q9of11G3/dK4qpCzaudpENcf0dbfrClmEZ5vfJnyH88nXCvWLYa2siqL7TgTwdMwbsjG/jU+C3fR6 XzUskUXZRJeFiI8tRvv+16eJCPR3suRMQTrvNsAqTgkwKZa7L20IaW9GbnICpz5GEtay8UbrNVd4H H4A4/OeDZZq3kAul4SQ3gX/OgV9ytyhXKZ+c3TO9ncjYMNudfmjZp5Z39DPri7sM8imsFher+nzVL uePYRHPw==; 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 1gLRo3-0000eN-NI; Sat, 10 Nov 2018 11:52:04 +0000 From: Christoph Hellwig To: guaneryu@gmail.com Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH 5/5] xfs/420: only check the extent layout after syncing Date: Sat, 10 Nov 2018 12:51:45 +0100 Message-Id: <20181110115145.30356-6-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 This tests validates the correct extent layout for some hairy reflink related issues. But until we called sync or fsync we have no gurantee of any data fork layout, as only writeback moves the extents from the COW for to the data fork. Without this we'll see an error if we use COW fork speculative preallocations for non-overwrites, which is useful to reduce fragmentation. Signed-off-by: Christoph Hellwig --- tests/xfs/420 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/xfs/420 b/tests/xfs/420 index a083a12b..aea95c7b 100755 --- a/tests/xfs/420 +++ b/tests/xfs/420 @@ -93,6 +93,8 @@ $XFS_IO_PROG -c "pwrite -S 0x63 $((blksz * 3)) $blksz" $testdir/file2 >> $seqres $XFS_IO_PROG -c "pwrite -S 0x63 0 $blksz" $testdir/file3 >> $seqres.full $XFS_IO_PROG -c "pwrite -S 0x63 $((blksz * 3)) $blksz" $testdir/file3 >> $seqres.full +sync + $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file1 >> $seqres.full 2>&1 $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file2 >> $seqres.full 2>&1 $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file3 >> $seqres.full 2>&1