From patchwork Sat Apr 1 01:21:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Owens X-Patchwork-Id: 9657425 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 B07F960351 for ; Sat, 1 Apr 2017 01:21:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D4AB28621 for ; Sat, 1 Apr 2017 01:21:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90771286AE; Sat, 1 Apr 2017 01:21:37 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 67A5828621 for ; Sat, 1 Apr 2017 01:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755326AbdDABVe (ORCPT ); Fri, 31 Mar 2017 21:21:34 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:34163 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755271AbdDABVd (ORCPT ); Fri, 31 Mar 2017 21:21:33 -0400 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.20/8.16.0.20) with SMTP id v311IhiL010372; Fri, 31 Mar 2017 18:21:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=gAHSWlsd3yAUKQ5Eju/ZmR3UJ5xAJ8AovXebNY6RLiE=; b=aG3fVT3rYpElK1/f6lvYlfAhl6IWWNfFMSrRSjqR/LttyK4nAs99xdydV09Lr3v9aVSf vdKs1t0w5U5xt0FNQF5n1d3i2aAyjr7fSDusTsVfj6GDxON05gmuR8RV63ozG+cow44t dGtUvXvBasoZWMD5F4Etb0P66vAbjyDIaTs= Received: from maileast.thefacebook.com ([199.201.65.23]) by m0089730.ppops.net with ESMTP id 29hy2u8k5b-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 31 Mar 2017 18:21:27 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.26) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 31 Mar 2017 21:21:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gAHSWlsd3yAUKQ5Eju/ZmR3UJ5xAJ8AovXebNY6RLiE=; b=KFHINC9Hv/QCXlpZlfJEoscerZ5xLvCAUNvcF6mFeGr/AoyraIFapzWxBViueHW/BCaL/bbBQhGJROf2zKwsbqIBT5MbMk4pDaU0YW9TY7Np/yNxCLBTKIxCVMTeZHpUAvfRmWTnvyA2c3LpO6fe/p+KhjHjAc9eYZAqqPvppH4= Authentication-Results: oracle.com; dkim=none (message not signed) header.d=none; oracle.com; dmarc=none action=none header.from=fb.com; Received: from Haydn (2620:10d:c090:200::c:a991) by BN6PR15MB1218.namprd15.prod.outlook.com (10.172.205.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.947.12; Sat, 1 Apr 2017 01:21:25 +0000 Date: Fri, 31 Mar 2017 18:21:15 -0700 From: Calvin Owens To: "Darrick J. Wong" CC: Eryu Guan , , Subject: Re: [PATCH v2] generic/418: Add test for fallocate() PUNCH_HOLE|KEEP_SIZE Message-ID: <20170401012115.ti6ek2gojghutzgx@Haydn> References: <8044718e71d02568f3fe84fc57478e9ca99b4f1a.1489799266.git.calvinowens@fb.com> <20170320063849.GI14226@eguan.usersys.redhat.com> <5c0dee13-0fc0-2c25-bdde-2dfc1b24b1e4@fb.com> <20170331042456.z6hak722a5ofajp6@Haydn> <20170331053039.GJ22845@eguan.usersys.redhat.com> <20170331161126.GB10881@birch.djwong.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170331161126.GB10881@birch.djwong.org> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [2620:10d:c090:200::c:a991] X-ClientProxiedBy: CO2PR07CA0079.namprd07.prod.outlook.com (10.174.192.47) To BN6PR15MB1218.namprd15.prod.outlook.com (10.172.205.148) X-MS-Office365-Filtering-Correlation-Id: a0f84a8c-90e4-452a-eff1-08d4789d6a7a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN6PR15MB1218; X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1218; 3:lamdDe0Rve4qm3mRWmpnbv0mIiY291bhmLlQ7VQXlkBo/jHS0psMT/QCECwa4BP3/PK/CTqfPu8c80QZC3gEn+IcHC17sajaPsb9A5KVfIycycJsTe71KfykfMJNvqmYm5qkgM8dZny2bkKOaFTAXw4k5H26s69g3lyIafZ548TPjvphZFvreQ1vJkLvJb7n/WNb75p3wqYvGc3fcSedkAFGUez2quB/eIyj/P1cYj6HlewOnVQOuRsZVLsCq5A1vlrvM9+lDFmsyBbTZ4nyT2Wz2Luy79reMLZjzUs5LaYcm2yXOSxOF6ItTCEjlvmDUFP2lM7DvTMksmz47UNhzA==; 25:zymMkwSvPgW7R2Jc3Kt62R0YRSVy0dRhJ4wUE4DBTX+Zd5u3hy5XPgvIc8/jRZsoES6kQyY8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ObfCmklpEcUFWmsYeUKWMc3kLKgn24HSUZBvthsC/zkhZON/BJrDFkZ+Tu+uJbxHuurbLkCG8PV35tMzGwUJ4Zq5W9pCs3DgwadDj/dUDnV430wIosuSMM5a3VOBg7MAxcRXo6reGmOZEL0GqIyfPjXboLNzVmR99QgAcGHc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(20161123564025)(20161123555025)(6072148); SRVR:BN6PR15MB1218; BCL:0; PCL:0; RULEID:; SRVR:BN6PR15MB1218; X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1218; 4:AN5bui4jvmqmm8YQcnhgpp62ixOiVGGrKB67yp43XTVpRwlZOpoX5EOKpG1zASKyaYua/CTMWku6PS2TZiXMS5KEvz5BQzE2ubsDVLGAb806lJsYCm5hNrQogzeW270W5oRNs2vqKyJ8oH6bO5p07xsuBK3CRfauyS1yP04YI0tDkuW+g0jpYLrbZ372N3EyT7HLgGEfu9NRxvuDiZ1yIzrr/L+OHN8kQ63T9/akwIl4fMLPaLO6gIee8VcBz4Fg00qiwjPEDM3qMCjsirNUZhW9YN22e5GoXmWsG6lzV1coKWzfg5YcEQmUciHTndTCCOvpXsGTtL2AyuXPlv8X91Kp1mf9ptLyYlUsCFyvNlRs/rDo/n0vb0GFqQicxUnRnv7MDmA2OyNmcYCkduOTbDPNVzcgGoxlW1v+eHl/VXQqo6jO0aEzWDSgMS35goG0iylGzFiImTP2BuN8LxcS8lJUrQkCz1rJP+r5ZXJniRdWahEAfcf5NNLdqtRZkWAKGkXSO3xVFyWG+dH1cT4bNla1QL3Chec9CL1HGXJhiStJgsZnSbFfqx1vYQI1TQJ86amEj/vB8hcXAii4MaLFNl0s643fsc2bT1x0OD1z9XVTyxkbY8DOZT4bgqu8CxH0msATeblcOjRZ/rkNBjv09z5/+iKRdM7ZAm/zW8IkG6Q1G4wIrILN+1kvELRBbB6j0vXFJwTGWo2+MnXgPjAzpafLJyf75riev2g5jBQs5OlpRtm1w/oKYQAInd+U6UfpoPCy5onc3StZxDT5HrepdA== X-Forefront-PRVS: 0264FEA5C3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39840400002)(39410400002)(39850400002)(39400400002)(24454002)(9686003)(6246003)(2906002)(53936002)(33716001)(4326008)(76176999)(55016002)(5660300001)(110136004)(229853002)(6666003)(38730400002)(42186005)(23676002)(86362001)(6496005)(83506001)(47776003)(4001350100001)(1076002)(50466002)(7736002)(50986999)(2950100002)(81166006)(25786009)(8676002)(6116002)(6916009)(54356999)(305945005)(54906002)(53546009)(33646002)(93886004)(189998001)(83133001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR15MB1218; H:Haydn; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjE1TUIxMjE4OzIzOmR3RHJReXRpZ3FRelpoV3A0MjhISXhNcUhD?= =?utf-8?B?cUkxQ2kwZmoxVmxXdXhUVzNUb2tXMjZWdCtXTkhQSXZ2bnJvRDIzYTBKLzBZ?= =?utf-8?B?d1puYUZOTXJxcmtkRVcvN2wxUDkweGhtemV1dkNJVm9pdDNhbWQrbzNiWktE?= =?utf-8?B?WkF0RHYvbTZmem1XUGlKbmdRUzFabmdxR0hZc1NtN1Z5VFVlaW9uR1IxaU5K?= =?utf-8?B?WVVTT2c2dGlUQmRIK3o3dVk0bWhrYmEwQWI5a0V6M0FrcmxwQ2xjaFBXWnNH?= =?utf-8?B?ZGJYc2E5R2d4VENDejc2WUpVRGZyTVdMRXZ6cGRJWGFZVklWSHhYT2ZEaVBL?= =?utf-8?B?MWh5ZmtmcnByaVZXNFBra1hsUEsrVlI0VWI1b2xtckc5bHlDajl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mkbyWZ28gXY10S0e77uZ5SgHYgRqg5zSqWk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1218; 7:8/OJxdLGkE+EPor2uSdz2HCf5pY5rUoMm8wFl1EjgdIbGyq8nIf5JHMUHYxIDMyK112KujeNTlFArO0Qvpz7oAAeozJgTjrDQZIgmGWw6hOm56B4pHKAT8wqddObEAFWbyautRgLtOmjoPCarAxNW7NSPPameYnnv5MjoGb3OJRU+TAnt+bbxEJp56bbYoYRPxAb5P7rcGbCzSp5En/rPkYu5QkMnwb/yoZqpp0Vi6YHo5lKivhdple+GBKZ/wMVRXsQIO8PRWAHvdCeK95rQhXgdKgQx5He/n93ZfWlvOO1U7fUR06IdVlvhLBa6HiO5/soJa+rsFcQm50DCLHSgw==; 20:SpCXphK8sueP9jA/mPPPAjEwEv2LANCaYb+oQGPoYoEKBisOiVLOXTUs81Etu+rJ67AP2zQdl1FMyapZkQx5K+ywRnqsAOHtWxsOCm8dToc7BMgBV9WoMqCWDrF3DRHAz/tsJtKDDx6wOm12xS/4rsgFEkOk87GVnYb4ce8eKfA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2017 01:21:25.0727 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1218 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-31_18:, , signatures=0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Friday 03/31 at 09:11 -0700, Darrick J. Wong wrote: > On Fri, Mar 31, 2017 at 01:30:39PM +0800, Eryu Guan wrote: > > On Thu, Mar 30, 2017 at 09:24:56PM -0700, Calvin Owens wrote: > > > Verify that punching holes at ends of files does not alter st_size if we > > > pass FALLOC_FL_KEEP_SIZE to fallocate(). > > > > > > Signed-off-by: Calvin Owens > > > --- > > > tests/generic/418 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ > > > tests/generic/418.out | 3 +++ > > > tests/generic/group | 1 + > > > 3 files changed, 67 insertions(+) > > > create mode 100755 tests/generic/418 > > > create mode 100644 tests/generic/418.out > > > > > > diff --git a/tests/generic/418 b/tests/generic/418 > > > new file mode 100755 > > > index 0000000..e04d08c > > > --- /dev/null > > > +++ b/tests/generic/418 > > > @@ -0,0 +1,63 @@ > > > +#! /bin/bash > > > +# FS QA Test 418 > > > +# > > > +# Verify fallocate(mode=FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE) does > > > +# not alter the file size. > > > +# > > > +#----------------------------------------------------------------------- > > > +# Copyright (c) 2017 Calvin Owens. All Rights Reserved. > > > +# > > > +# This program is free software; you can redistribute it and/or > > > +# modify it under the terms of the GNU General Public License as > > > +# published by the Free Software Foundation. > > > +# > > > +# This program is distributed in the hope that it would be useful, > > > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > > > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > > +# GNU General Public License for more details. > > > +# > > > +# You should have received a copy of the GNU General Public License > > > +# along with this program; if not, write the Free Software Foundation, > > > +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > > > +#----------------------------------------------------------------------- > > > +# > > > + > > > +seq=`basename $0` > > > +seqres=$RESULT_DIR/$seq > > > +echo "QA output created by $seq" > > > + > > > +here=`pwd` > > > +tmp=/tmp/$$ > > > +status=1 # failure is the default! > > > +trap "_cleanup; exit \$status" 0 1 2 3 15 > > > + > > > +_cleanup() > > > +{ > > > + cd / > > > + rm -f $tmp.* > > > +} > > > + > > > +# get standard environment, filters and checks > > > +. ./common/rc > > > +. ./common/filter > > > + > > > +# remove previous $seqres.full before test > > > +rm -f $seqres.full > > > + > > > +# real QA test starts here > > > + > > > +# Modify as appropriate. > > > +_supported_fs generic > > > +_supported_os Linux > > > +_require_test > > I think this test needs a "_require_xfs_io_command fpunch". Will do. > > > + > > > +testfile="${TEST_DIR}/testfile" > > > + > > > +echo "Testing fallocate(mode=FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE)" > > > +$XFS_IO_PROG -fc "pwrite -b 2048 0 2048" $testfile > > > > Need to either discard the stdout or filter stdout then update .out > > file, otherwise test fails with > > > > +wrote 2048/2048 bytes at offset 0 > > +2 KiB, 1 ops; 0.0000 sec (122 MiB/sec and 62500.0000 ops/sec) > > > > I think discarding stdout is sufficient, any pwrite error to stderr will > > break golden image and fail the test. That was a stupid thing to miss, my apologies :/ > > $XFS_IO_PROG -fc "pwrite -b 2048 0 2048" $testfile >/dev/null > > > > > +$XFS_IO_PROG -c "fpunch 2048 2048" $testfile > > > +$XFS_IO_PROG -c "stat" $testfile 2>/dev/null | grep -F 'stat.size' > > > > Minor nit, I'd rather not discarding stderr, with similar reason above. > > > > These are straightforward updates, I can fix them at commit time if > > you're OK with the fixes. > > Usually we toss the xfs_io stdout stuff into $seqres.full so that it's > recorded somewhere just in case someone wants to see what xfs_io thinks > it did. Makes sense, new patch below. Thanks, Calvin ---8<--- From: Calvin Owens Date: Fri, 31 Mar 2017 18:13:41 -0700 Subject: [PATCH v3] generic/418: Add test for fallocate() PUNCH_HOLE|KEEP_SIZE Verify that punching holes at ends of files does not alter st_size if we pass FALLOC_FL_KEEP_SIZE to fallocate(). Signed-off-by: Calvin Owens --- tests/generic/418 | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/418.out | 4 ++++ tests/generic/group | 1 + 3 files changed, 69 insertions(+) create mode 100755 tests/generic/418 create mode 100644 tests/generic/418.out diff --git a/tests/generic/418 b/tests/generic/418 new file mode 100755 index 0000000..12599b1 --- /dev/null +++ b/tests/generic/418 @@ -0,0 +1,64 @@ +#! /bin/bash +# FS QA Test 418 +# +# Verify fallocate(mode=FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE) does +# not alter the file size. +# +#----------------------------------------------------------------------- +# Copyright (c) 2017 Calvin Owens. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +# Modify as appropriate. +_supported_fs generic +_supported_os Linux +_require_test +_require_xfs_io_command fpunch + +testfile="${TEST_DIR}/testfile" + +echo "Testing fallocate(mode=FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE)" +$XFS_IO_PROG -fc "pwrite -b 2048 0 2048" $testfile | head -n1 +$XFS_IO_PROG -c "fpunch 2048 2048" $testfile +$XFS_IO_PROG -c "stat" $testfile | grep -F 'stat.size' + +# success, all done +status=0 +exit diff --git a/tests/generic/418.out b/tests/generic/418.out new file mode 100644 index 0000000..805fc55 --- /dev/null +++ b/tests/generic/418.out @@ -0,0 +1,4 @@ +QA output created by 418 +Testing fallocate(mode=FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE) +wrote 2048/2048 bytes at offset 0 +stat.size = 2048 diff --git a/tests/generic/group b/tests/generic/group index f0096bb..068aa61 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -420,3 +420,4 @@ 415 auto clone 416 auto enospc 417 auto quick shutdown log +418 auto quick punch