From e01c06fb9c182151d4bbbe90873f79b5b2295245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Mon, 2 Jan 2023 23:16:07 +0000 Subject: [PATCH] doc: copy: mention the reinstated I/O size constraints * NEWS: Mention the change in behavior re block size multiples to support unusual devices with this constraint. * src/copy.c (copy_reg): Likewise. --- NEWS | 4 ++++ src/copy.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 7a655974a..dce09e9ba 100644 --- a/NEWS +++ b/NEWS @@ -58,6 +58,10 @@ GNU coreutils NEWS -*- outline -*- 'cp --reflink=always A B' no longer leaves behind a newly created empty file B merely because copy-on-write clones are not supported. + cp, mv, and install again read in multiples of the reported block size, + to support unusual devices that may have this constraint. + [behavior inadvertently changed in coreutils-7.2] + 'ls -v' and 'sort -V' go back to sorting ".0" before ".A", reverting to the behavior in coreutils-9.0 and earlier. This behavior is now documented. diff --git a/src/copy.c b/src/copy.c index 1058b08ec..251769300 100644 --- a/src/copy.c +++ b/src/copy.c @@ -1387,7 +1387,9 @@ copy_reg (char const *src_name, char const *dst_name, if (! make_holes) { /* Compute the least common multiple of the input and output - buffer sizes, adjusting for outlandish values. */ + buffer sizes, adjusting for outlandish values. + Note we read in multiples of the reported block size + to support (unusual) devices that have this constraint. */ size_t blcm_max = MIN (SIZE_MAX, SSIZE_MAX); size_t blcm = buffer_lcm (io_blksize (src_open_sb), buf_size, blcm_max); -- 2.26.2