From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: Dave Chinner <david@fromorbit.com>, Christoph Hellwig <hch@lst.de>
Cc: Amir Goldstein <amir73il@gmail.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Steve French <smfrench@gmail.com>,
overlayfs <linux-unionfs@vger.kernel.org>,
Anna Schumaker <Anna.Schumaker@netapp.com>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: Re: [PATCH 3/3] ovl: Use splice_with_holes in copy_up
Date: Tue, 8 May 2018 11:11:33 -0500 [thread overview]
Message-ID: <5fd8ee75-58ee-c254-2912-f28e913bd6ad@suse.de> (raw)
In-Reply-To: <20180508100624.GL10363@dastard>
On 05/08/2018 05:06 AM, Dave Chinner wrote:
> On Tue, May 08, 2018 at 06:02:42AM +0200, Christoph Hellwig wrote:
>> On Tue, May 08, 2018 at 09:16:46AM +1000, Dave Chinner wrote:
>>> This sort of whacky undefined behaviour w.r.t. sparseness was the
>>> reason we were given at LSFMM for cp and rsync not implementing
>>> copy_file_range() - they could not control it according to the
>>> user's direction. Hence my suggestion that we need flags to
>>> specifically direct the behaviour of the syscall so that userspace
>>> will actually use it....
>>
>> They can just use SEEK_HOLE/DATA and just copy the chunk they care
>> about. Especially as they already have the SEEK_HOLE/DATA logic
>> for the plain old copy anyway
>
> Well, you think they would given what we've told them in the past
> about using fiemap for finding holes and the potential for data
> corruption it comes along with. But - as I found out recently - cp
> is still using fiemap to find holes, not SEEK_HOLE/DATA. See:
>
> https://github.com/coreutils/coreutils/blob/master/src/extent-scan.c
>
>> - that is the only thing they have
>> to create holes in the destination file to start with. Nevermind
>> that a file system with inline dedup will happily create holes for
>> them underneath.
>
> Yup, I know. However, it's not me that I'm suggesting we do this
> for....
>
What should the default behavior (without flags) be? Should it create
holes or not? If the filesystem supports reflink then we would end up
with destination having holes and if it does not we will have
destination not having holes even though the filesystem supports sparse
files. It is not consistent though there is no documentation to specify
it will be one way or the other. Are users okay with inconsistent
behavior? Depending on the answer, we can add either one of the two
options: CFR_FILL_HOLES or CFR_KEEP_HOLES. Alternatively, we can
document the state of holes in the destination is not determinant and
coreutils/cp can perform the lseek(SEEK_HOLE/DATA)
If we do handle the hole behavior, should the individual filesystems
handle this or should we handle in in VFS. VFS seems simple because
NFS42: nfs42_copy_args does not seem to have a field which could
represent flags.
If cp calls copy_file_range(), it will clone the portion if the
filesystem supports it, which may not work with "cp --reflink=never"
option. In that case, should we have CFR_NO_REFLINK option for
copy_file_range()?
--
Goldwyn
next prev parent reply other threads:[~2018-05-08 16:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 15:26 [PATCH 0/3] Holey splice! copy_file_range() with holes Goldwyn Rodrigues
2018-05-03 15:26 ` [PATCH 1/3] Perform splice in copy_file_range if in/out SB are not same Goldwyn Rodrigues
2018-05-03 15:26 ` [PATCH 2/3] copy_file_range: splice with holes Goldwyn Rodrigues
2018-05-03 15:26 ` [PATCH 3/3] ovl: Use splice_with_holes in copy_up Goldwyn Rodrigues
2018-05-03 19:57 ` Amir Goldstein
2018-05-03 22:11 ` Dave Chinner
2018-05-04 1:29 ` Goldwyn Rodrigues
2018-05-05 23:16 ` Dave Chinner
2018-05-07 12:16 ` Christoph Hellwig
2018-05-07 23:16 ` Dave Chinner
2018-05-08 4:02 ` Christoph Hellwig
2018-05-08 10:06 ` Dave Chinner
2018-05-08 16:11 ` Goldwyn Rodrigues [this message]
2018-05-08 16:24 ` Christoph Hellwig
2018-05-07 18:50 ` Andreas Dilger
2018-05-04 1:29 ` Goldwyn Rodrigues
2018-05-04 1:31 ` Goldwyn Rodrigues
2018-05-04 6:18 ` Amir Goldstein
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=5fd8ee75-58ee-c254-2912-f28e913bd6ad@suse.de \
--to=rgoldwyn@suse.de \
--cc=Anna.Schumaker@netapp.com \
--cc=amir73il@gmail.com \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=rgoldwyn@suse.com \
--cc=smfrench@gmail.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;
as well as URLs for NNTP newsgroup(s).