From patchwork Wed Nov 23 02:11:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 9442491 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 31185606DB for ; Wed, 23 Nov 2016 02:11:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FCA4204BD for ; Wed, 23 Nov 2016 02:11:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 148F5208C2; Wed, 23 Nov 2016 02:11:16 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 8D1DD204BD for ; Wed, 23 Nov 2016 02:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755855AbcKWCLP (ORCPT ); Tue, 22 Nov 2016 21:11:15 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:44400 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755461AbcKWCLO (ORCPT ); Tue, 22 Nov 2016 21:11:14 -0500 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAN2BAAH009252 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Nov 2016 02:11:10 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uAN2B9bg028411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 23 Nov 2016 02:11:10 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id uAN2B7IU023057; Wed, 23 Nov 2016 02:11:08 GMT Received: from localhost (/24.21.211.40) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 22 Nov 2016 18:11:07 -0800 Subject: [PATCH 3/3] ocfs2: test reflinking to inline data files From: "Darrick J. Wong" To: david@fromorbit.com, eguan@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 22 Nov 2016 18:11:06 -0800 Message-ID: <147986706651.27133.4210661621329152871.stgit@birch.djwong.org> In-Reply-To: <147986705412.27133.3961713804630246198.stgit@birch.djwong.org> References: <147986705412.27133.3961713804630246198.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure that we can handle reflinking from and to inline-data files. Signed-off-by: Darrick J. Wong --- tests/ocfs2/001 | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/ocfs2/001.out | 14 ++++++++ tests/ocfs2/group | 1 + 3 files changed, 103 insertions(+) create mode 100755 tests/ocfs2/001 create mode 100644 tests/ocfs2/001.out create mode 100644 tests/ocfs2/group -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tests/ocfs2/001 b/tests/ocfs2/001 new file mode 100755 index 0000000..973682d --- /dev/null +++ b/tests/ocfs2/001 @@ -0,0 +1,88 @@ +#! /bin/bash +# FS QA Test No. 001 +# +# Ensure that reflink works correctly with inline-data files. +# +#----------------------------------------------------------------------- +# Copyright (c) 2016, Oracle and/or its affiliates. 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, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink + +# real QA test starts here +_supported_os Linux +_supported_fs ocfs2 +_require_scratch_reflink +_require_cp_reflink + +rm -f $seqres.full + +echo "Format and mount" +_scratch_mkfs > $seqres.full 2>&1 +tunefs.ocfs2 --query '%H' $SCRATCH_DEV | grep -q 'inline-data' || \ + _notrun "Inline data is not supported." +_scratch_mount >> $seqres.full 2>&1 + +testdir=$SCRATCH_MNT/test-$seq +mkdir $testdir + +sz=65536 +echo "Create the original files" +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file1 >> $seqres.full +echo x > $testdir/file2 +echo x > $testdir/file3 +echo y > $testdir/file4 +$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $sz 0 $sz" $testdir/file5 >> $seqres.full +echo a > $testdir/file6 +_scratch_cycle_mount + +echo "reflink into the start of file2" +_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full + +echo "reflink past the stuff in file3" +_reflink_range $testdir/file1 0 $testdir/file3 $sz $sz >> $seqres.full + +echo "reflink an inline-data file to a regular one" +_cp_reflink $testdir/file4 $testdir/file5 >> $seqres.full + +echo "reflink an inline-data file to another inline-data file" +_cp_reflink $testdir/file4 $testdir/file6 >> $seqres.full + +echo "Verify the whole mess" +_scratch_cycle_mount +md5sum $testdir/file* | _filter_scratch + +# success, all done +status=0 +exit diff --git a/tests/ocfs2/001.out b/tests/ocfs2/001.out new file mode 100644 index 0000000..99fa43a --- /dev/null +++ b/tests/ocfs2/001.out @@ -0,0 +1,14 @@ +QA output created by 001 +Format and mount +Create the original files +reflink into the start of file2 +reflink past the stuff in file3 +reflink an inline-data file to a regular one +reflink an inline-data file to another inline-data file +Verify the whole mess +2d61aa54b58c2e94403fb092c3dbc027 SCRATCH_MNT/test-001/file1 +2d61aa54b58c2e94403fb092c3dbc027 SCRATCH_MNT/test-001/file2 +4e68a2e24b6b0f386ab39d01d902293d SCRATCH_MNT/test-001/file3 +009520053b00386d1173f3988c55d192 SCRATCH_MNT/test-001/file4 +009520053b00386d1173f3988c55d192 SCRATCH_MNT/test-001/file5 +009520053b00386d1173f3988c55d192 SCRATCH_MNT/test-001/file6 diff --git a/tests/ocfs2/group b/tests/ocfs2/group new file mode 100644 index 0000000..28e6807 --- /dev/null +++ b/tests/ocfs2/group @@ -0,0 +1 @@ +001 auto quick clone