From patchwork Fri Mar 31 04:24:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Owens X-Patchwork-Id: 9655477 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 A686A60351 for ; Fri, 31 Mar 2017 04:25:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9930228673 for ; Fri, 31 Mar 2017 04:25:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DD5F28683; Fri, 31 Mar 2017 04:25: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 C1BD928673 for ; Fri, 31 Mar 2017 04:25:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751162AbdCaEZh (ORCPT ); Fri, 31 Mar 2017 00:25:37 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:40925 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbdCaEZf (ORCPT ); Fri, 31 Mar 2017 00:25:35 -0400 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2V4IEN3007097; Thu, 30 Mar 2017 21:25:32 -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=8fI1upDqzxMeJCVDh7JP5lL6pFkhkEI7Vy0fcffstPw=; b=PEqhXZhPWwy9D4GfQ+RYd0TlEehBpMhnWMcnQRh0HQnHkrDNHFfRC5giuiXKyVBZtVZT VBKxDkRLWl7asJJr/Rwo7Thl/Y/ou0UFDDdUsYUDFF+w96QpnEUQNXB45Q1rZRqGKwAI SDEWLycb9az4e9g3DsjzX0MWCayDc4KVkpw= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 29hfy780jm-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 30 Mar 2017 21:25:32 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.22) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 30 Mar 2017 21:25:32 -0700 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=8fI1upDqzxMeJCVDh7JP5lL6pFkhkEI7Vy0fcffstPw=; b=D/bYT2NGflFZaCA2/BWRabG0hyQqviF8Q2hHxuvNnISj1BAoteOS3HvojNjLXlA/vTdJK5TKHWx7l78eQ7d+XoBNN1EHjuvuV3deMbBE8RS3i0CWjmJXUWTA4BOkzwpP9FcGkw+D+gb0OoQ8biKIuA+g+iZaYfxulrTJSG8MC6U= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=fb.com; Received: from Haydn (2620:10d:c090:200::c:a991) by DM5PR15MB1226.namprd15.prod.outlook.com (10.173.209.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.961.17; Fri, 31 Mar 2017 04:25:12 +0000 Date: Thu, 30 Mar 2017 21:24:56 -0700 From: Calvin Owens To: Eryu Guan CC: , Subject: [PATCH v2] generic/418: Add test for fallocate() PUNCH_HOLE|KEEP_SIZE Message-ID: <20170331042456.z6hak722a5ofajp6@Haydn> References: <8044718e71d02568f3fe84fc57478e9ca99b4f1a.1489799266.git.calvinowens@fb.com> <20170320063849.GI14226@eguan.usersys.redhat.com> <5c0dee13-0fc0-2c25-bdde-2dfc1b24b1e4@fb.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5c0dee13-0fc0-2c25-bdde-2dfc1b24b1e4@fb.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [2620:10d:c090:200::c:a991] X-ClientProxiedBy: DM5PR1101CA0011.namprd11.prod.outlook.com (10.174.246.21) To DM5PR15MB1226.namprd15.prod.outlook.com (10.173.209.20) X-MS-Office365-Filtering-Correlation-Id: e5123234-5f55-4a90-4c88-08d477edec91 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:DM5PR15MB1226; X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1226; 3:nKqKeln7gvoJZcY6yexnMil5xybwh4c3ob7xNBdWV8AkKqG0S6YQllKPL4opCHGnY4FWNZvd0PG/aMpKZhKAVPX81lsk21ZfDuJ+7Muh4soktUruXVA9wCmh14ca9REWFLYv3XlQGGM21TPZayrUCl41Q4E981bBXQm9yUg++qcK0joMqq6M6qj1JXxDqt7VSUI+Cd+8ZlzVH12inLmPe43Md/ulSI62DpgVR7pRQt91YU0ya6xP/2VqcT6TE1BN5sh4D0HhGPrVjdA67bnks60L2oo8gO+g3XHVzdpCe6kvDaI1KztB3Bwojeyahe6QtJa7Ob/3f2a/f7Gie1ZS1Q==; 25:q/mRlAmR8SrFdbVHqQCxW9eDqbWpsAlnlF4QaP7wxUfX9uLOtwk2T4V+48RlwjrebdgMtz8I5mGXaLndWZMAHVwkuNzbU+dkZSdjdB4hLOw8YVQUoF7uREOw10cIf+rH1Q/6PKQJs5j5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BoTIEcFc67br/+3qkk6PQ/jTyb5IiDAXW5bjxWtwrwUwSXmFaI+ 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)(8121501046)(5005006)(93006087)(93001087)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148); SRVR:DM5PR15MB1226; BCL:0; PCL:0; RULEID:; SRVR:DM5PR15MB1226; X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1226; 4:pTTsxjFrr6cSTRJ2eXDFjq2v/uWYU/2rqemeVy0opmNHZ6XLzmMRdz/p00PxzRJfGq0pZY+/WdobjHtx78k7fBqh5PCL/Kyv6aepPC/VWZiWoSVsdDaW2Rm17ILRfvBaTiL3sVELVGqWW5vC8EqhkTfKToIes5nk22R9WQY5k2khhP+i8Sd2PVUPo7tcT1ALIIPHJs1pxpD07tTLats4L3CWQoEbj4IwGJKJ5upi6t4zvdCynKtphMw1UpoMvkybJY6Kwd4zpBnvdJMFUDto6ldixwPdFFOfhl0CsclltFy8di1vzu8lLsdsb9jpPObQ/6O1CwmMrR+UXb4/qeBqq37i5H39tmqOTgjcjsccCqCyfYky+R2DtfSBaR4dGDvNZlQX4dkvTyedleEadkZqAGuRlEsQ42ykmAe/lsYBuavr6nxbSCjV01OW8RZXZhgoIIr3oYSKuMTWzynBnuOjhIuKtbJSdjAqa4fFxRbESddcCs3ABcjY/B1OZWtOdOnE6yW/qwwjF6IVQB2CZC81P/MqVnl6hKMbu1hMNQBERuaL+kuMlUkiPNTJt3v2CfKhCcmdL5ATfkRUZiWM96h4gDPSsbQWJ1hQM4CJIpb1ZyHsR4GiF8HtsJ77XtMJDHqpSEekehPX+MpTaxYDyNw8gMwC5qruy9jaTkURCkgUoyW8viHvUKBabqmbx2DzoCxzKRvito3XI3iakMQ171PmahmDUQ7cEbmyqjLGi/eFlWuLv3M9k2ZB82olyX0Vqga2VLHxrr+48Ji4gNzvhb1+NA== X-Forefront-PRVS: 02638D901B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39840400002)(39450400003)(39400400002)(39410400002)(53936002)(54906002)(6116002)(6666003)(55016002)(2906002)(7736002)(50466002)(81166006)(305945005)(8676002)(189998001)(42186005)(6496005)(9686003)(33716001)(4326008)(38730400002)(86362001)(110136004)(50986999)(25786009)(47776003)(76176999)(54356999)(1076002)(83506001)(4001350100001)(5660300001)(2950100002)(23676002)(33646002)(6916009)(2004002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR15MB1226; H:Haydn; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjE1TUIxMjI2OzIzOlBtbzAxSzVLaGtoS2tERTdGNm5SeWpYVWhr?= =?utf-8?B?N3hrVU5LZndZeldOYWExaERuNGhTUWkxalBKVWFVYzBiWFJIZXYzb0xYNXg4?= =?utf-8?B?R3l0MGt0UlRqNU14SU4xcDhtUGk2Z29hKzd2SWlwRk1ueTdWbk9uU2xybGlP?= =?utf-8?B?Y1VSS0tIdUNtdGwzWDQ5SlI5NzQ2Ym8vUDZzVUZ2TjdWZHpBUEdzL0xPMGhn?= =?utf-8?B?UVZSTkpKWGxIZE55SXkrYmdpbWVpK0RoTWJKQWNxM3FUNGt0TVdubnhVZEs5?= =?utf-8?B?TTJuVGRGZDlWVVFHMFl4cUlpU1FXVEVSTS9nRlZFZXBrOXh0aEtZSFJjUjQ1?= =?utf-8?B?SUhzOWhBcEJLQm5NTHlDUWpRVXUvY1YwRFhjVmUrTWcwZ1N4WkJ4UkxWaEpi?= =?utf-8?B?S2tpLzV5ZjArUElQK3UzZlAyL3h1V1RqRk4rem1VdVFnNzV2Y1VjWlowSnUv?= =?utf-8?B?NE9KRlpYWXFsdGFzZzVXY1lJOG4wVkV1MTFmcVFFR3krVVZ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rrbivs2k1KSwGO165wGZo+5NxL0A7XNC0v7PdIzZpZN+S8ARdBN8gw==; 20:eZj9L6D7Z3jWafz+h1IIGmMn5bLGJm+L9JOmJF9Zplf9bs4wO2bJciYWUIA+WrpuUE+dqtzx9BEx2ptfZRoIgBDb1ne1CTaLp1raDX3EZY3d+b0y9UqINGXtT8YwTWb13AkChL+a2yJZe/UrP4Bvm7I8/MBSEN8FbU6K5s9cuoA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 04:25:12.1298 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1226 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_03:, , 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 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 + +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 +$XFS_IO_PROG -c "fpunch 2048 2048" $testfile +$XFS_IO_PROG -c "stat" $testfile 2>/dev/null | 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..9927731 --- /dev/null +++ b/tests/generic/418.out @@ -0,0 +1,3 @@ +QA output created by 418 +Testing fallocate(mode=FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE) +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