<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/copy.c, branch v9.0</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v9.0</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v9.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2021-07-28T19:30:12Z</updated>
<entry>
<title>doc: modernize usage of “disk” and “core”</title>
<updated>2021-07-28T19:30:12Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2021-07-28T19:22:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=d60b2922ffb30d15e81b0019025b8e62af070a6e'/>
<id>urn:sha1:d60b2922ffb30d15e81b0019025b8e62af070a6e</id>
<content type='text'>
In documentation and comments, don’t assume that secondary storage
devices are disk devices.  Similarly, don’t assume that main memory
uses magnetic cores, which became obsolete in the 1970s.
* src/du.c (usage):
* src/ls.c (usage):
* src/shred.c (usage): Reword to avoid “disk” in usage messages.
</content>
</entry>
<entry>
<title>copy: remove fiemap logic</title>
<updated>2021-05-15T15:14:11Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-05-15T11:40:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=26eccf6c98696c50f4416ba2967edc8676870716'/>
<id>urn:sha1:26eccf6c98696c50f4416ba2967edc8676870716</id>
<content type='text'>
This is now only used on 10 year old linux kernels,
and performs a sync before each copy.

* src/copy.c (extent_copy): Remove function and all callers.
* src/extent-scan.c: Remove.
* src/extent-scan.h: Remove.
* src/fiemap.h: Remove.
* src/local.mk: Adjust for removed files.
* NEWS: Adjust to say fiemap is removed.
</content>
</entry>
<entry>
<title>copy: disallow copy_file_range() on Linux kernels before 5.3</title>
<updated>2021-05-12T23:14:22Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-05-12T22:47:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ba5e6885d2c255648cddb87b4e795659c1990374'/>
<id>urn:sha1:ba5e6885d2c255648cddb87b4e795659c1990374</id>
<content type='text'>
copy_file_range() before Linux kernel release 5.3 had many issues,
as described at https://lwn.net/Articles/789527/, which was
referenced from https://lwn.net/Articles/846403/; a more general
article discussing the generality of copy_file_range().
Linux kernel 5.3 was released in September 2019, which is new enough
that we need to actively avoid older kernels.

* src/copy.c (functional_copy_file_range): A new function
that returns false for Linux kernels before version 5.3.
(sparse_copy): Call this new function to gate use of
copy_file_range().
</content>
</entry>
<entry>
<title>copy: handle system security config issues with copy_file_range()</title>
<updated>2021-05-12T21:14:11Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-05-08T18:23:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=2e66e1732fced7af20fa76c60e636d39a1767d48'/>
<id>urn:sha1:2e66e1732fced7af20fa76c60e636d39a1767d48</id>
<content type='text'>
* src/copy.c (sparse_copy): Upon EPERM from copy_file_range(),
fall back to a standard copy, which will give a more accurate
error as to whether the issue is with the source or destination.
Also this will avoid the issue where seccomp or apparmor are
not configured to handle copy_file_range(), in which case
the fall back standard copy would succeed without issue.
This specific issue with seccomp was noticed for example in:
https://github.com/golang/go/issues/40900
</content>
</entry>
<entry>
<title>copy: handle EOPNOTSUPP from SEEK_DATA</title>
<updated>2021-05-12T21:14:11Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-05-09T20:55:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=017877bd088284d515753d78b81ca6e6a88c1350'/>
<id>urn:sha1:017877bd088284d515753d78b81ca6e6a88c1350</id>
<content type='text'>
* src/copy.c (infer_scantype): Ensure we don't error out
if SEEK_DATA returns EOPNOTSUPP, on systems where this value
is distinct from ENOTSUP.  Generally both of these should be checked.
</content>
</entry>
<entry>
<title>copy: handle ENOTSUP from copy_file_range()</title>
<updated>2021-05-12T21:14:11Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-05-08T16:18:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=8ec0d1799e19a079b8a661c6bb69f6c58e52f1aa'/>
<id>urn:sha1:8ec0d1799e19a079b8a661c6bb69f6c58e52f1aa</id>
<content type='text'>
* src/copy.c (sparse_copy): Ensure we fall back to
a standard copy if copy_file_range() returns ENOTSUP.
This generally is best checked when checking ENOSYS,
but it also seems to be a practical concern on Centos 7,
as a quick search gave https://bugzilla.redhat.com/1840284
</content>
</entry>
<entry>
<title>maint: consistently free hash structures in dev mode</title>
<updated>2021-05-08T13:57:33Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-05-03T17:11:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=09bbb2b703d78e2d577cba57b8bb3ad339303835'/>
<id>urn:sha1:09bbb2b703d78e2d577cba57b8bb3ad339303835</id>
<content type='text'>
Ensure we call hash_free() to avoid valgrind and leak_sanitizer
"definitely lost" warnings.  These were not real leaks as
we terminate immediately after, but we should avoid these
"definitely lost" warnings where possible.

* src/copy.c: Add dest_info_free() and src_info_free().
* src/copy.h: Declare the above.
* src/cp-hash.c: Don't define unless "lint" is defined.
* src/install.c: Call dest_info_free() in dev mode.
* src/mv.c: Likewise.
* src/cp.c: Likewise. Also call src_info_free().
* src/ln.c: Call hash_free() in dev mode.
* src/tail.c: Call hash_free() even if about to exit, in dev mode.

Fixes https://bugs.gnu.org/48189
</content>
</entry>
<entry>
<title>maint: fix sc_space_before_open_paren failure</title>
<updated>2021-05-06T21:42:57Z</updated>
<author>
<name>Bernhard Voelker</name>
<email>mail@bernhard-voelker.de</email>
</author>
<published>2021-05-06T21:38:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=65e4d0f71e3df711cf604209e148a051cd71580f'/>
<id>urn:sha1:65e4d0f71e3df711cf604209e148a051cd71580f</id>
<content type='text'>
* src/copy.c (dest_info_init): Add space before parens.
(src_info_init): Likewise.
Syntax-check failure introduced in the previous commit.
</content>
</entry>
<entry>
<title>copy: exit immediately upon failure to allocate hash memory</title>
<updated>2021-05-03T17:53:35Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-05-03T17:53:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=f1d2e8e2893961812483dcbd4ada0a68defa6653'/>
<id>urn:sha1:f1d2e8e2893961812483dcbd4ada0a68defa6653</id>
<content type='text'>
* src/copy.c (dest_info_init, src_info_init): Terminate immediately
upon memory exhaustion.
</content>
</entry>
<entry>
<title>copy: ensure we enforce --reflink=never</title>
<updated>2021-05-02T20:27:17Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2021-05-02T20:27:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ea9af99234031ab8d5169c8a669434e2a6b4f864'/>
<id>urn:sha1:ea9af99234031ab8d5169c8a669434e2a6b4f864</id>
<content type='text'>
* src/copy.c (sparse_copy): Don't use copy_file_range()
with --reflink=never as copy_file_range() may implicitly
use acceleration techniques like reflinking.
(extent_copy): Pass through whether we allow reflinking.
(lseek_copy): Likewise.
Fixes https://bugs.gnu.org/48164
</content>
</entry>
</feed>
