From patchwork Mon Dec 12 09:01:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 9470183 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 9FAFA60573 for ; Mon, 12 Dec 2016 09:01:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88DC82811D for ; Mon, 12 Dec 2016 09:01:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AE242843D; Mon, 12 Dec 2016 09:01:24 +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 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 16E6C2811D for ; Mon, 12 Dec 2016 09:01:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752314AbcLLJBX (ORCPT ); Mon, 12 Dec 2016 04:01:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50964 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751266AbcLLJBX (ORCPT ); Mon, 12 Dec 2016 04:01:23 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A821961BA6; Mon, 12 Dec 2016 09:01:22 +0000 (UTC) Received: from localhost (vpn1-5-97.pek2.redhat.com [10.72.5.97]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBC91LnN016164; Mon, 12 Dec 2016 04:01:22 -0500 Date: Mon, 12 Dec 2016 17:01:20 +0800 From: Eryu Guan To: "Darrick J. Wong" Cc: ocfs2-devel@oss.oracle.com, fstests@vger.kernel.org Subject: Re: [PATCH 1/7] ocfs2: test reflinking to inline data files Message-ID: <20161212090120.GV29149@eguan.usersys.redhat.com> References: <148149316504.31093.16129068344227450710.stgit@birch.djwong.org> <148149317133.31093.439907074888693999.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <148149317133.31093.439907074888693999.stgit@birch.djwong.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 12 Dec 2016 09:01:22 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Dec 11, 2016 at 01:52:51PM -0800, Darrick J. Wong wrote: > Make sure that we can handle reflinking from and to inline-data files. > > Signed-off-by: Darrick J. Wong > --- > common/reflink | 2 + > tests/ocfs2/001 | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/ocfs2/001.out | 14 ++++++++ > tests/ocfs2/Makefile | 20 +++++++++++ > tests/ocfs2/group | 1 + > 5 files changed, 124 insertions(+), 1 deletion(-) > create mode 100755 tests/ocfs2/001 > create mode 100644 tests/ocfs2/001.out > create mode 100644 tests/ocfs2/Makefile > create mode 100644 tests/ocfs2/group > > > diff --git a/common/reflink b/common/reflink > index 9d51729..d048045 100644 > --- a/common/reflink > +++ b/common/reflink > @@ -197,7 +197,7 @@ _cp_reflink() { > file1="$1" > file2="$2" > > - cp --reflink=always -p "$file1" "$file2" > + cp --reflink=always -p -f "$file1" "$file2" I'm still seeing "File exists" error with this patch, tested with your ocfs2-vfs-reflink-6 branch, compiled on openSUSE Tumbleweed. FSTYP -- ocfs2 PLATFORM -- Linux/x86_64 bootp-73-5-234 4.9.0-rc8.djwong-ocfs2+ MKFS_OPTIONS -- --fs-features=local /dev/sda5 MOUNT_OPTIONS -- /dev/sda5 /mnt/testarea/scratch ocfs2/001 - output mismatch (see /root/xfstests/results//ocfs2/ocfs2/001.out.bad) --- tests/ocfs2/001.out 2016-12-12 13:51:38.053909486 +0800 +++ /root/xfstests/results//ocfs2/ocfs2/001.out.bad 2016-12-12 16:49:35.038882697 +0800 @@ -1,14 +1,18 @@ QA output created by 001 +mkfs.ocfs2 1.8.4 Format and mount Create the original files reflink into the start of file2 +cp: failed to reflink '/mnt/testarea/scratch/test-001/file2' from '/mnt/testarea/scratch/test-001/file1': File exists reflink past the stuff in file3 ... (Run 'diff -u tests/ocfs2/001.out /root/xfstests/results//ocfs2/ocfs2/001.out.bad' to see the entire diff) I did the "reflink into the start of file2" test manually, and strace showed that it is file1 reports EEXIST. open("/mnt/ocfs2/testfile1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0600, st_size=65536, ...}) = 0 ioctl(3, _IOC(_IOC_WRITE, 0x6f, 0x04, 0x18), 0x7ffc8daf09f0) = -1 EEXIST (File exists) The same test on XFS works fine. Did I miss anything? Thanks, Eryu --- 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 --- tests/ocfs2/001.out 2016-12-12 13:51:38.053909486 +0800 +++ /root/xfstests/results//ocfs2/ocfs2/001.out.bad 2016-12-12 16:44:31.991943842 +0800 @@ -1,14 +1,18 @@ QA output created by 001 +mkfs.ocfs2 1.8.4 Format and mount Create the original files reflink into the start of file2 +cp: failed to reflink '/mnt/testarea/scratch/test-001/file2' from '/mnt/testarea/scratch/test-001/file1': File exists reflink past the stuff in file3 reflink an inline-data file to a regular one +cp: failed to reflink '/mnt/testarea/scratch/test-001/file5' from '/mnt/testarea/scratch/test-001/file4': File exists reflink an inline-data file to another inline-data file +cp: failed to reflink '/mnt/testarea/scratch/test-001/file6' from '/mnt/testarea/scratch/test-001/file4': File exists Verify the whole mess 2d61aa54b58c2e94403fb092c3dbc027 SCRATCH_MNT/test-001/file1 -2d61aa54b58c2e94403fb092c3dbc027 SCRATCH_MNT/test-001/file2 +401b30e3b8b5d629635a5c613cdb7919 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 +2d61aa54b58c2e94403fb092c3dbc027 SCRATCH_MNT/test-001/file5 +60b725f10c9c85c70d97880dfe8191b3 SCRATCH_MNT/test-001/file6