Return-Path: Received: from mail-io0-f172.google.com ([209.85.223.172]:34071 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752406AbbJ0LfG (ORCPT ); Tue, 27 Oct 2015 07:35:06 -0400 Subject: Re: [PATCH v7 5/4] copy_file_range.2: New page documenting copy_file_range() To: "J. Bruce Fields" , =?UTF-8?Q?P=c3=a1draig_Brady?= References: <1445628736-13058-1-git-send-email-Anna.Schumaker@Netapp.com> <1445628736-13058-6-git-send-email-Anna.Schumaker@Netapp.com> <562B734D.50800@draigBrady.com> <20151026033925.GA9945@infradead.org> <562E1A55.4050409@draigBrady.com> <20151026214110.GA9232@fieldses.org> Cc: Christoph Hellwig , Anna Schumaker , linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, zab@zabbo.net, viro@zeniv.linux.org.uk, clm@fb.com, darrick.wong@oracle.com, mtk.manpages@gmail.com, andros@netapp.com From: Austin S Hemmelgarn Message-ID: <562F613F.9070609@gmail.com> Date: Tue, 27 Oct 2015 07:34:23 -0400 MIME-Version: 1.0 In-Reply-To: <20151026214110.GA9232@fieldses.org> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-512; boundary="------------ms030709020907030100010502" Sender: linux-nfs-owner@vger.kernel.org List-ID: This is a cryptographically signed message in MIME format. --------------ms030709020907030100010502 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 2015-10-26 17:41, J. Bruce Fields wrote: > On Mon, Oct 26, 2015 at 12:19:33PM +0000, P=C3=A1draig Brady wrote: >> I get the impression that you think reflinking should be hidden >> from the user, i.e. cp(1) should not have had the --reflink option >> (for the last 6 years)? I'm not convinced of that, and even so >> I think lower level interfaces would benefit from finer grained option= s. >> This would be especially useful since there is no general interface >> to reflink at present. I was happy with the reflink control options, >> thinking the extra control could allow cp to use this by default. > > Maybe that's a case for Christoph's "clone" operation. > > I agree with him that it makes sense to allow the filesystem to > implement "copy" using reflink or similar tricks under the covers. And= > that in fact it's difficult to imagine how you'd prevent that in the > presence of layers of filesystem or block protocols underneath. > > That "cp" flag seems strange to me, but if "cp" wants to take advantage= > of a copy system call while continuing to make something like that > distinction then I suppose it could fallocate the destination range fil= e > after the copy. FWIW, I'm pretty sure that the '--reflink=3Dnever' option was added=20 originally just for those poor misguided people who don't understand=20 that deduplication is perfectly safe as long as you do it right.=20 Personally, I really hope that Busybox and the other Coreutils=20 replacements don't make that mistake, as the very fact that cp allows=20 you to force it not to reflink things indirectly implies that it isn't=20 safe in some circumstances, which is completely bogus WRT all the=20 filesystems in Linux that support it if they are used properly. If you want to make sure the space is allocated on disk, you should be=20 using fallocate (or dd, or something equivalent), not cp. --------------ms030709020907030100010502 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgMFADCABgkqhkiG9w0BBwEAAKCC Brgwgga0MIIEnKADAgECAgMRLfgwDQYJKoZIhvcNAQENBQAweTEQMA4GA1UEChMHUm9vdCBD QTEeMBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0IFNp Z25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2VydC5vcmcwHhcN MTUwOTIxMTEzNTEzWhcNMTYwMzE5MTEzNTEzWjBjMRgwFgYDVQQDEw9DQWNlcnQgV29UIFVz ZXIxIzAhBgkqhkiG9w0BCQEWFGFoZmVycm9pbjdAZ21haWwuY29tMSIwIAYJKoZIhvcNAQkB FhNhaGVtbWVsZ0BvaGlvZ3QuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA nQ/81tq0QBQi5w316VsVNfjg6kVVIMx760TuwA1MUaNQgQ3NyUl+UyFtj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