All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eryu Guan <eguan@redhat.com>
Cc: ocfs2-devel@oss.oracle.com, fstests@vger.kernel.org
Subject: Re: [PATCH 1/7] ocfs2: test reflinking to inline data files
Date: Tue, 13 Dec 2016 13:35:41 -0800	[thread overview]
Message-ID: <20161213213540.GC6366@birch.djwong.org> (raw)
In-Reply-To: <20161213071136.GB6366@birch.djwong.org>

On Mon, Dec 12, 2016 at 11:11:36PM -0800, Darrick J. Wong wrote:
> On Tue, Dec 13, 2016 at 11:20:57AM +0800, Eryu Guan wrote:
> > On Mon, Dec 12, 2016 at 10:09:22AM -0800, Darrick J. Wong wrote:
> > > On Mon, Dec 12, 2016 at 05:01:20PM +0800, Eryu Guan wrote:
> > > > 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 <darrick.wong@oracle.com>
> > > > > ---
> > > > >  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
> > > 
> > > I guess I'll have to neuter this on newer ocfs2-tools.  (Still running 1.6.4
> > > here).
> > 
> > I have a patch pending on review that could fix & filter this, FYI
> > 
> > fstests: teach _scratch_mkfs to handle mkfs option conflicts
> > https://www.spinics.net/lists/fstests/msg04550.html
> 
> <nod> I actually meant the printing of the mkfs version string.
> 
> > 
> > > 
> > > >      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)
> > > > 
> > > > --- 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
> > > > 
> > > > 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)
> > > 
> > > Wait, that's the ocfs2 reflink ioctl, not FICLONE.  Well that explains
> > > why the functional parts of the tests fail.  I looked at latest coreutils
> > > source, which does not use OCFS2_IOC_REFLINK, so I guess this must be an
> > > opensuse thing?
> > 
> > Ok, I'll try a newer coreutils.
> 
> coreutils 8.26 (latest) doesn't have any OCFS2_IOC_REFLINK support; I
> suspect a distro patch in the srpm or something....

Confirmed.  SuSE's coreutils package has a patch that tries the ocfs2
reflink ioctl and bails out of cp without trying the btrfs/vfs clone
ioctl if the ocfs2 ioctl returns EEXIST.  I suppose that'll have to get
fixed in their coreutils package, but until then it'll just be broken.
:/

FWIW I also confirm that none of (upstream, RHEL, OL, Debian, or Ubuntu)
have this patch, so this shouldn't be a problem on any of them.

--D

> 
> --D
> 
> > 
> > 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
> --
> 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

WARNING: multiple messages have this Message-ID (diff)
From: Darrick J. Wong <darrick.wong@oracle.com>
To: Eryu Guan <eguan@redhat.com>
Cc: ocfs2-devel@oss.oracle.com, fstests@vger.kernel.org
Subject: [Ocfs2-devel] [PATCH 1/7] ocfs2: test reflinking to inline data files
Date: Tue, 13 Dec 2016 13:35:41 -0800	[thread overview]
Message-ID: <20161213213540.GC6366@birch.djwong.org> (raw)
In-Reply-To: <20161213071136.GB6366@birch.djwong.org>

On Mon, Dec 12, 2016 at 11:11:36PM -0800, Darrick J. Wong wrote:
> On Tue, Dec 13, 2016 at 11:20:57AM +0800, Eryu Guan wrote:
> > On Mon, Dec 12, 2016 at 10:09:22AM -0800, Darrick J. Wong wrote:
> > > On Mon, Dec 12, 2016 at 05:01:20PM +0800, Eryu Guan wrote:
> > > > 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 <darrick.wong@oracle.com>
> > > > > ---
> > > > >  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
> > > 
> > > I guess I'll have to neuter this on newer ocfs2-tools.  (Still running 1.6.4
> > > here).
> > 
> > I have a patch pending on review that could fix & filter this, FYI
> > 
> > fstests: teach _scratch_mkfs to handle mkfs option conflicts
> > https://www.spinics.net/lists/fstests/msg04550.html
> 
> <nod> I actually meant the printing of the mkfs version string.
> 
> > 
> > > 
> > > >      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)
> > > > 
> > > > --- 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
> > > > 
> > > > 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)
> > > 
> > > Wait, that's the ocfs2 reflink ioctl, not FICLONE.  Well that explains
> > > why the functional parts of the tests fail.  I looked at latest coreutils
> > > source, which does not use OCFS2_IOC_REFLINK, so I guess this must be an
> > > opensuse thing?
> > 
> > Ok, I'll try a newer coreutils.
> 
> coreutils 8.26 (latest) doesn't have any OCFS2_IOC_REFLINK support; I
> suspect a distro patch in the srpm or something....

Confirmed.  SuSE's coreutils package has a patch that tries the ocfs2
reflink ioctl and bails out of cp without trying the btrfs/vfs clone
ioctl if the ocfs2 ioctl returns EEXIST.  I suppose that'll have to get
fixed in their coreutils package, but until then it'll just be broken.
:/

FWIW I also confirm that none of (upstream, RHEL, OL, Debian, or Ubuntu)
have this patch, so this shouldn't be a problem on any of them.

--D

> 
> --D
> 
> > 
> > Thanks,
> > Eryu
> > --
> > To unsubscribe from this list: send the line "unsubscribe fstests" in
> > the body of a message to majordomo at vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-12-13 21:38 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-11 21:52 [PATCH 0/7] xfstests: misc reflink test fixes Darrick J. Wong
2016-12-11 21:52 ` [Ocfs2-devel] " Darrick J. Wong
2016-12-11 21:52 ` [PATCH 1/7] ocfs2: test reflinking to inline data files Darrick J. Wong
2016-12-11 21:52   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-12  9:01   ` Eryu Guan
2016-12-12 18:09     ` Darrick J. Wong
2016-12-12 18:09       ` [Ocfs2-devel] " Darrick J. Wong
2016-12-13  3:20       ` Eryu Guan
2016-12-13  7:11         ` Darrick J. Wong
2016-12-13  7:11           ` [Ocfs2-devel] " Darrick J. Wong
2016-12-13 21:35           ` Darrick J. Wong [this message]
2016-12-13 21:35             ` Darrick J. Wong
2016-12-14  7:32             ` Eric Ren
2016-12-14  7:32               ` [Ocfs2-devel] " Eric Ren
2016-12-11 21:52 ` [PATCH 2/7] ocfs2/reflink: fix file block size reporting Darrick J. Wong
2016-12-11 21:52   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-12  9:48   ` Eryu Guan
2016-12-12 23:08     ` Darrick J. Wong
2016-12-12 23:08       ` [Ocfs2-devel] " Darrick J. Wong
2016-12-11 21:53 ` [PATCH 3/7] reflink: fix quota tests to work properly Darrick J. Wong
2016-12-11 21:53   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-12 10:06   ` Eryu Guan
2016-12-12 23:08     ` Darrick J. Wong
2016-12-12 23:08       ` [Ocfs2-devel] " Darrick J. Wong
2016-12-11 21:53 ` [PATCH 4/7] reflink: fix space consumption tests Darrick J. Wong
2016-12-11 21:53   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-12 10:25   ` Eryu Guan
2016-12-12 23:03     ` Darrick J. Wong
2016-12-12 23:03       ` [Ocfs2-devel] " Darrick J. Wong
2016-12-13  3:22       ` Eryu Guan
2016-12-11 21:53 ` [PATCH 5/7] reflink: make error reporting consistent Darrick J. Wong
2016-12-11 21:53   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-12 10:47   ` Eryu Guan
2016-12-12 23:06     ` Darrick J. Wong
2016-12-12 23:06       ` [Ocfs2-devel] " Darrick J. Wong
2016-12-11 21:53 ` [PATCH 6/7] reflink: don't test disjoint block sharing sets Darrick J. Wong
2016-12-11 21:53   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-11 21:53 ` [PATCH 7/7] xfs/ext4: check negative inode size Darrick J. Wong
2016-12-11 21:53   ` [Ocfs2-devel] " Darrick J. Wong
2016-12-12 11:07   ` Eryu Guan
2016-12-13 21:49     ` Darrick J. Wong
2016-12-13 21:49       ` [Ocfs2-devel] " Darrick J. Wong
2017-01-05  1:04 [PATCH 0/7] xfstests: misc reflink test fixes Darrick J. Wong
2017-01-05  1:04 ` [PATCH 1/7] ocfs2: test reflinking to inline data files Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161213213540.GC6366@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.