Previously it would have failed with a "No such file or directory" error.
[bug introduced in coreutils-9.1]
+ 'cp --sparse=never' will avoid copy-on-write (reflinking) and copy offloading,
+ to ensure no holes present in the destination copy.
+ [bug introduced in coreutils-9.0]
+
cksum again diagnoses read errors in its default CRC32 mode.
[bug introduced in coreutils-9.0]
{
scan_inference->ext_start = -1; /* avoid -Wmaybe-uninitialized */
+ /* Only attempt SEEK_HOLE if this heuristic
+ suggests the file is sparse. */
if (! (HAVE_STRUCT_STAT_ST_BLOCKS
&& S_ISREG (sb->st_mode)
&& ST_NBLOCKS (*sb) < sb->st_size / ST_NBLOCKSIZE))
}
}
+ /* With --sparse=never, disable reflinking so we create a non sparse copy.
+ This will also have the effect of disabling copy offload as that may
+ propagate holes. For e.g. FreeBSD documents that copy_file_range()
+ will try to propagate holes. */
+ if (x.reflink_mode == REFLINK_AUTO && x.sparse_mode == SPARSE_NEVER)
+ x.reflink_mode = REFLINK_NEVER;
+
if (x.hard_link && x.symbolic_link)
{
error (0, 0, _("cannot make both hard and symbolic links"));
cmp k k2 || fail=1
grep 'sparse detection: .*zeros' cp.out || { cat cp.out; fail=1; }
+# cp should disable reflink AND copy offload with --sparse=never
+cp --debug --sparse=never k k2 >cp.out || fail=1
+cmp k k2 || fail=1
+grep 'copy offload: avoided, reflink: no' cp.out || { cat cp.out; fail=1; }
+
Exit $fail