From: Darrick J. Wong <darrick.wong@oracle.com>
To: Eric Ren <zren@suse.com>
Cc: mfasheh@versity.com, jlbec@evilplan.org,
linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 6/6] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features
Date: Fri, 11 Nov 2016 01:01:19 -0800 [thread overview]
Message-ID: <20161111090119.GE21519@birch.djwong.org> (raw)
In-Reply-To: <5b95de23-5751-72a6-1733-2af0a683c80f@suse.com>
On Fri, Nov 11, 2016 at 02:45:54PM +0800, Eric Ren wrote:
> On 11/11/2016 02:20 PM, Darrick J. Wong wrote:
> >On Fri, Nov 11, 2016 at 01:49:48PM +0800, Eric Ren wrote:
> >>Hi,
> >>
> >>A few issues obvious to me:
> >>
> >>On 11/10/2016 06:51 AM, Darrick J. Wong wrote:
> >>>Connect the new VFS clone_range, copy_range, and dedupe_range features
> >>>to the existing reflink capability of ocfs2. Compared to the existing
> >>>ocfs2 reflink ioctl We have to do things a little differently to support
> >>>the VFS semantics (we can clone subranges of a file but we don't clone
> >>>xattrs), but the VFS ioctls are more broadly supported.
> >>How can I test the new ocfs2 reflink (with this patch) manually? What
> >>commands should I use to do xxx_range things?
> >See the 'reflink', 'dedupe', and 'copy_range' commands in xfs_io.
> >
> >The first two were added in xfsprogs 4.3, and copy_range in 4.7.
>
> OK, thanks. I think you are missing the following two inline comments:
>
> >>>+ spin_lock(&OCFS2_I(dest)->ip_lock);
> >>>+ if (newlen > i_size_read(dest)) {
> >>>+ i_size_write(dest, newlen);
> >>>+ di->i_size = newlen;
> >>di->i_size = cpu_to_le64(newlen);
Good catch!
> >>>+ }
> >>>+ spin_unlock(&OCFS2_I(dest)->ip_lock);
> >>>+
> >>Add ocfs2_update_inode_fsync_trans() here? Looks this function was
> >>introduced by you to improve efficiency.
> >>Just want to awake your memory about this, though I don't know about the
> >>details why it should be.
D'oh! Yes, I did miss that.
The function updates the destination inode's information. Specifically,
it updates i_size if we reflinked blocks into the file past EOF.
Looking at it some more, I also need to update i_blocks or the stat(2) info
will be wrong, and I also need to convert inline data to extents prior
to reflinking.
--D
> >>
> >>Eric
> Thanks,
> Eric
next prev parent reply other threads:[~2016-11-11 9:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 22:51 [Ocfs2-devel] [PATCH 0/6] ocfs2: wire up {clone, copy, dedupe}_range Darrick J. Wong
2016-11-09 22:51 ` [Ocfs2-devel] [PATCH 1/6] ocfs2: convert inode refcount test to a helper Darrick J. Wong
2016-11-10 2:14 ` Eric Ren
2016-11-10 17:51 ` Darrick J. Wong
2016-11-10 17:52 ` [Ocfs2-devel] [PATCH v2 " Darrick J. Wong
2016-11-09 22:51 ` [Ocfs2-devel] [PATCH 2/6] ocfs2: add newlines to some error messages Darrick J. Wong
2016-11-09 22:51 ` [Ocfs2-devel] [PATCH 3/6] ocfs2: prohibit refcounted swapfiles Darrick J. Wong
2016-11-09 22:51 ` [Ocfs2-devel] [PATCH 4/6] ocfs2: budget for extent tree splits when adding refcount flag Darrick J. Wong
2016-11-10 9:20 ` Darwin
2016-11-10 17:11 ` Darrick J. Wong
2016-11-11 3:00 ` Darwin
2016-11-09 22:51 ` [Ocfs2-devel] [PATCH 5/6] ocfs2: don't eat io errors during _dio_end_io_write Darrick J. Wong
2016-11-09 22:51 ` [Ocfs2-devel] [PATCH 6/6] ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features Darrick J. Wong
2016-11-11 5:49 ` Eric Ren
2016-11-11 6:20 ` Darrick J. Wong
2016-11-11 6:45 ` Eric Ren
2016-11-11 9:01 ` Darrick J. Wong [this message]
2016-11-11 14:54 ` [Ocfs2-devel] [PATCH v2 " Darrick J. Wong
2016-11-09 23:00 ` [Ocfs2-devel] [PATCH 7/6] xfstests: fix some minor problems testing ocfs2 Darrick J. Wong
2016-11-11 3:15 ` [Ocfs2-devel] [PATCH 0/6] ocfs2: wire up {clone, copy, dedupe}_range Eric Ren
2016-11-11 15:05 ` 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=20161111090119.GE21519@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=jlbec@evilplan.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mfasheh@versity.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=zren@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox