From patchwork Wed May 10 17:46:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 9720293 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 2091D6035D for ; Wed, 10 May 2017 17:46:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4210528622 for ; Wed, 10 May 2017 17:46:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3707E28627; Wed, 10 May 2017 17:46:53 +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=unavailable 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 D0B1D2862B for ; Wed, 10 May 2017 17:46:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752643AbdEJRqs (ORCPT ); Wed, 10 May 2017 13:46:48 -0400 Received: from mx142.netapp.com ([216.240.21.19]:11514 "EHLO mx142.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752804AbdEJRqq (ORCPT ); Wed, 10 May 2017 13:46:46 -0400 X-IronPort-AV: E=Sophos;i="5.38,320,1491289200"; d="scan'208";a="187610557" Received: from vmwexchts03-prd.hq.netapp.com ([10.122.105.31]) by mx142-out.netapp.com with ESMTP; 10 May 2017 10:31:46 -0700 Received: from VMWEXCCAS12-PRD.hq.netapp.com (10.122.105.30) by VMWEXCHTS03-PRD.hq.netapp.com (10.122.105.31) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 10 May 2017 10:46:44 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS12-PRD.hq.netapp.com (10.122.105.30) with Microsoft SMTP Server (TLS) id 15.0.1210.3 via Frontend Transport; Wed, 10 May 2017 10:46:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netapp.onmicrosoft.com; s=selector1-netapp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tyn2KSFNQ/NMeNpFXkE4Lbl7rM9UEbDuuX90ej8gqm4=; b=G4YWPFL4jtFCNjWSmXvC/6QESHXWVgm5VqCPKmzklv1tKQDmT4z2SEZjvxRJEsMR5OwruDDKerJf8m3/anpV8pnkQ1maUTIq3/PzyWb+rrGE8GwpTOzLqqDuT8hOZYSEcegpPvg18lxHo5613hC8VTcojA+YrXxQovH0Re5ZGuw= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=Netapp.com; Received: from gouda.nowheycreamery.com.nowheycreamery.com (68.40.188.1) by MWHPR06MB2479.namprd06.prod.outlook.com (10.168.248.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Wed, 10 May 2017 17:46:44 +0000 From: Anna Schumaker To: CC: , , Subject: [PATCH v6 4/5] generic/432: Add a copy test for overwriting small amounts of data Date: Wed, 10 May 2017 13:46:27 -0400 Message-ID: <20170510174628.22895-5-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170510174628.22895-1-Anna.Schumaker@Netapp.com> References: <20170510174628.22895-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 X-Originating-IP: [68.40.188.1] X-ClientProxiedBy: MWHPR1601CA0024.namprd16.prod.outlook.com (10.172.93.34) To MWHPR06MB2479.namprd06.prod.outlook.com (10.168.248.15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70ab354a-d79e-4e7f-af6c-08d497cc8659 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:MWHPR06MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 3:YzCW96wrT30jX0zuFlYsWSBpL9g37JUhMccnnopq7OzbZ7zA2sPvVGte7naZthaNt64EASZIxxs+lFMtq3rzseWs8fqtm6+qYUJqeRmKuhTtVd5dVej1rjTiNru5Rdem0M+veN6HoR4mfP+myqoQ9kERq4wz1tdWAezqWJ7FGKGxAw39E2Vn99GVHvE5qHMsLLCe9liXkh6XqqLR6DRtJuO1IJZ4pOfcXUXI9vVGuC0bHTkOSIz5EJi8MfYHOv3IO7KkgZ8/LQ/dcgLD2pSzmHLvXSu3J+iTzlTnWUQtzPs7Y7DKp0nT2jwFHGqnekRhMCKyD7OGwfriK/kJKDe3ww==; 25:2CiWIzNqkvtc8JGriIDUj3KUjTWtyc8flJ8uNnVHRWOt5Y5BLjKMaPV6o0rxmK3ezvTgVxwSI9v6DrftN2BaqtZZzUlGYOWDfpYkBuRbtg0p06Z/rm4DT9dfnLmvKpKhlwjXFBdQLyAvuBqU4fp0qHs2YJBc/7Bwn3aEzP9uTqeuChETtW6rPlXz+BfvYbbWohfpleZGR9ZgfWu+lnWDlFSsUtTM0jT3kg/dyJsB8OTRhhQs7+SMvns3KbmZ190W7alCcm7X/9mL12NeBjEvh1tnwsspvx3Aar6h6sWY3muK363nD5KyrsIi9iAQnpQMtIsblypZgiau9mvLbB2VsrmkLkvOA4Wv9hWsGSpTSXsmyVtT84wcFnQLvG9LqO0OzojVUVT5gHDsLAQvGqwddq5Wkl6SvNnMrdj8PsO9UWtwcvnSd6q6aW7DMsIOv6176N4ohUf3Es+VHxdnDV7LLOry/6Qa7SWuoIHJQlyhV24= X-LD-Processed: 4b0911a0-929b-4715-944b-c03745165b3a,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 31:KkQuyDu/s6uxm/g+MtSrW+Czi6zc6eoHx9cf0d3L9H5nS0YgR5cfxCT/FbH4GxbNkmTUIVhQSYmxjP4bQE34GrcaLX1vp+WbS/1JU5yaGNDSLfi4Ed/HLWNZJ30YzovTCc3pjtRvwd3gCoL0nErFIOWBLYXAGrytqw518wJ7g9dfzMEKjDvY+1Z7E895g0HzRxUEdlJbo7uBeP0IwKGJhSmXgceiVyZ5nFyTY0vIP7k=; 20:cN5RapgfSOrPmqTWXNuyDgXJbPi5JKx8UhjLrRlu9MNOCebws/1s8ZtJuHAbRaCTM7N9viutxSlaiwd0ttcvAOJSb5SAm5QfgjP9NrZwXImeLaSLPTSNn12yama0rULR1ptaonzZsyZXNtGmyuLghUygbosHJ41rb3VGt+fWpfr49qrKvKJzwiivgcJnEhrgJMEJcxI4dH4MmE4r83yxmMcTU5o34zoLgW03o8V67eIGw+gGC3m0hxJBQxHaZHzozQjYOUKcQvqScJ7KDCjYALuNd3hzMFsGptg9e60oQx3dMFZGJ/zlTu5yn8thaufq3Fek3JQzyxDXNmZ4NGyVwyjGTY/fFMvxcEo611mJVF+ujnroyT/JVCwvAFP+SmpBMb43e18zrLF0MebNKsMxPXpXscuqeZrY/FpLVZ2PzZm0QZt5ehbtAGbwBZNaV351cXeYeebOzmjK+QlsMYEj4q9vRXv+8aT4Vkyx2qw6WKtzX5hBeYzxbYlFpnSGEe/j X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123560025)(20161123562025)(20161123555025)(6072148); SRVR:MWHPR06MB2479; BCL:0; PCL:0; RULEID:; SRVR:MWHPR06MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 4:vFywb9IQV1i2EojOIPpd3FWuzmULMUwelx3Q4ouuK5GOD1HrUHML4G9OwljmoKQhaat1bEq5Wz8apkJmmSvhTqdCwlVBcNjGzN5cMtu/6tRUobjEDozvOQa6DDjfuoL1/05HjchmNhgT3cJa4DQxISRiO/AcXS3u7fa/8yfwEWOJr7q911qc9gMLOHM5G9cbwTDC2hmS/4rRIBPog9AurKgI8Ztv8gHII96AD6+fosbGwlz1msMtBY5lHK8hnpiYFm+RDiuEKMxsUq99QnORrdQk7qr7GvrBmGIsHE8d3+3nx/ptDoPdauQN1j2wOwwypPUmMrRTkG/36hdHC3m4ZUYbea7MJFGrJQPR302stlEVHM9WaXfmMqkvH3VGmU5amu+prqwWCVOvwYnpkaL+gXKZ3BWJlgX7XGIcq7L7dkZ2kAnYyDrKYS8LFZnG7Mq//j6EB2pBT96rWJXjK0+SJgTd3RbyrpEtNDZ6Bl0kOYZWTmtzCafL6KvNSy0GaeFNyz64qikT6F2fniqgUhxbRprwebyvcTwCVX8KJsAxezYQ6KtoPPgmpSdlePEYOqKJ/n2xAKT4G751nHsf+oINcL4ujbT34AolCAwYOZTAyMSEVcgaNu4gNzwMYrs8tXPQONh8LxboJnt01vqfJj3EnzWWzz6rkrAsIEGD+0fIFWYpHlwoXUnmNlK0byWM1a2eQbMdbMqFSBkdCVMX7cvq70gxzn0/pOFF5ZG5JJvykzujnk/CGMTUo8853kewmWyHrTqZadXevebaECbPb5ruLLalDVUK7zrKz+I0xbsciJE= X-Forefront-PRVS: 03030B9493 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39840400002)(39850400002)(39410400002)(39450400003)(39400400002)(6512007)(54906002)(4326008)(189998001)(3846002)(6486002)(6506006)(2906002)(6116002)(25786009)(1076002)(38730400002)(86362001)(66066001)(72206003)(110136004)(50466002)(48376002)(2351001)(42186005)(81166006)(8676002)(5003940100001)(478600001)(50226002)(47776003)(5660300001)(53936002)(36756003)(6666003)(2950100002)(76176999)(50986999)(7736002)(305945005)(6916009)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR06MB2479; H:gouda.nowheycreamery.com.nowheycreamery.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR06MB2479; 23:7mTREc+7LizpKCCPLrN+ZrnxIAj28Cph/7u8RoJBf?= =?us-ascii?Q?9rwMCIu24LKQQteC1UmgNrUpU2gjcf7gNbRGSRCyOIyQ/48NVDnpoHPYF68E?= =?us-ascii?Q?KmGgcD+lRJBoz63ETOAGqW2jJI0tMjreXbbRby7h7Gl4+fZkmgkfPUmhCHI0?= =?us-ascii?Q?mzMbzry7idNrIHRoAcdlL3WRb2rI1sGtgm0BkcqRNP4JkyOce67ookCuYk1N?= =?us-ascii?Q?+9BSslNW8qdZCpLWYSIWtJcj9/bRhqKn3qCiCSsw/AqmaZh0yotMg1Ho69Yg?= =?us-ascii?Q?Wpm6/1G2p+APYpH2aMtkwYeRth5FizS5qq4r+qA20CgtwDce0WYMl5iSrFJZ?= =?us-ascii?Q?BFIEAvN8/viMoa95He6vfZ2PG92VZ9LDdI+xZPraju9sVuaZKwCA4X5EJ0e9?= =?us-ascii?Q?3TLF0f4zHijuly6/+JhyxpcA2MckM/6WYTX4u7r3QhzPdbKN+e6mmqlDoqg9?= =?us-ascii?Q?k3yrfxwmdFYd7oJPX/cdw0mi6YMH4el2CahKYwXy2taCevYReStTg0oefL1M?= =?us-ascii?Q?vCl4BY6Ef5X8DpYRDtm+7xnCVhsvdb+Sgcr9OGSmS9aqMgQu6TMeZtErkEFr?= =?us-ascii?Q?M8WLojjGIJHAo9h0HyBDZP9W+TQpQI48pFxya1lIsgZvk7iVetYX57fRyZtQ?= =?us-ascii?Q?G8kHnAIvw3tloNgFYm7Lxe6iqXMlPMLHzgqBWmWm5hbk+943ewVa9tcTuar9?= =?us-ascii?Q?NyEbWIUgtf4AcYKzTP6TI+8t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9FMxCOGM8MxoJKNia+RrA8aE3ZDjctnJacwHuhQrqCuCB1tucWHJJkwrpe8oSugY9loozpPhjswXV6HfDuzrt8RRg21UCCLufJxpfK6Zhld8RDoHT7QjfhTtgfw3gzSh/qcw==; 24:IaXerNvD+H/LUrk1a1bPdS1GbBMW1NYq2+vMDFRsTd65a7uJsv46FrghCakxrwxIQPqZNAbw3NyANkMoxoUX5NrMo4/j8HJx1d31sY4jFSo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 7:lzZKJpXu0aPjfOGs0I0T4dRvpwBJ8T2shL3tNVJYzCVOSZHBEDXeaRwZNiwzuFrsG6KaoTpn4cgDWJQeAzr82txZanET9XetnW+MWU1EJAcGYmpH/Blp8epoDXTz1In/JltfMqfM5etsCfPViM05N1LmO4Jta9/PUTmmK0Ko481r5m7VvtFk6GBMgfF+pV22XridOolUrnYnKS/dZS/d1scxvInmoxxTAsYosyWmAz26ytPhA2ECeYCxSYY7khZ+t2H4ZmE0/47XJdRKotWz41+DfHOHYmJewuGgrcLZ+dyE5bV4JsunDkUxq/sj1fxXoiadsgPQjoOdTHOvdr1H6w== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2017 17:46:44.4986 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR06MB2479 X-OriginatorOrg: netapp.com Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This test is similar to 345, except that it copies one byte at a time to make sure that this case works as expected. Signed-off-by: Anna Schumaker Reviewed-by: Darrick J. Wong --- tests/generic/432 | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/432.out | 17 ++++++++++ tests/generic/group | 1 + 3 files changed, 105 insertions(+) create mode 100755 tests/generic/432 create mode 100644 tests/generic/432.out diff --git a/tests/generic/432 b/tests/generic/432 new file mode 100755 index 00000000..9cd899ce --- /dev/null +++ b/tests/generic/432 @@ -0,0 +1,87 @@ +#!/bin/bash +# FS QA Test No. 432 +# +# Tests vfs_copy_file_range(): +# - Copy a small file +# - Use copy to swap data at beginning and end +# - Use copy to swap data in the middle +# - Use copy to swap data in a small file +#----------------------------------------------------------------------- +# Copyright (c) 2017 Netapp, Inc. 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 -rf $tmp.* +} + +# get standard environment +. common/rc +. common/filter + +# real QA test starts here +_supported_fs generic +_supported_os Linux + +_require_xfs_io_command "copy_range" +_require_test + +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir +rm -f $seqres.full + +echo "Create the original file and then copy" +echo -n "abcde" > $testdir/file +$XFS_IO_PROG -f -c "copy_range $testdir/file" "$testdir/copy" 2>&1 +cmp $testdir/file $testdir/copy +echo "Original md5sums:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Swap beginning and end of original file" +$XFS_IO_PROG -f -c "copy_range -s 0 -d 4 -l 1 $testdir/file" "$testdir/copy" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 4 -d 0 -l 1 $testdir/file" "$testdir/copy" 2>&1 +echo -n "ebcda" | cmp $testdir/copy +echo "md5sums after swapping beginning and end:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Swap middle parts of original file" +$XFS_IO_PROG -f -c "copy_range -s 1 -d 3 -l 1 $testdir/file" "$testdir/copy" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 3 -d 1 -l 1 $testdir/file" "$testdir/copy" 2>&1 +echo -n "edcba" | cmp $testdir/copy +echo "md5sums after swapping middle:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Copy tail of original file onto copy" +$XFS_IO_PROG -f -c "copy_range -s 1 -d 3 -l 4 $testdir/file" "$testdir/copy" 2>&1 +echo -n "edcbcde" | cmp $testdir/copy +echo "md5sums after copying tail:" +md5sum $testdir/{file,copy} | _filter_test_dir + +#success, all done +status=0 +exit diff --git a/tests/generic/432.out b/tests/generic/432.out new file mode 100644 index 00000000..eec84392 --- /dev/null +++ b/tests/generic/432.out @@ -0,0 +1,17 @@ +QA output created by 432 +Create the original file and then copy +Original md5sums: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-432/file +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-432/copy +Swap beginning and end of original file +md5sums after swapping beginning and end: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-432/file +32db1f6d06d15f7e38e1ab1c69da498a TEST_DIR/test-432/copy +Swap middle parts of original file +md5sums after swapping middle: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-432/file +295228f3d82d344bbcf2f0030519c2ea TEST_DIR/test-432/copy +Copy tail of original file onto copy +md5sums after copying tail: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-432/file +0c4aac952f72fa078e2f8419aca70b28 TEST_DIR/test-432/copy diff --git a/tests/generic/group b/tests/generic/group index 608c45b2..43aac9fd 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -434,3 +434,4 @@ 429 auto quick copy 430 auto quick copy 431 auto quick copy +432 auto quick copy