diff --git a/NEWS b/NEWS index e3858a855..ca13267b3 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,11 @@ GNU coreutils NEWS -*- outline -*- ** Bug fixes + cp, install, and mv no longer enter an infinite loop copying sparse files + with SEEK_HOLE. E.g., this was seen on ext4 when copying sparse files with + extents that are being actively updated, and copy offload is not being used. + [bug introduced in coreutils-9.9] + 'date' no longer fails with format directives that return an empty string. [bug introduced in coreutils-9.9] diff --git a/src/copy-file-data.c b/src/copy-file-data.c index 927a6e048..56b669fe7 100644 --- a/src/copy-file-data.c +++ b/src/copy-file-data.c @@ -338,7 +338,7 @@ lseek_copy (int src_fd, int dest_fd, char **abuf, idx_t buf_size, for (off_t ext_start = scan_inference->ext_start; 0 <= ext_start && ext_start < max_ipos; ) { - off_t ext_end = (ext_start == ipos + off_t ext_end = (ext_start == src_pos ? scan_inference->hole_start : lseek (src_fd, ext_start, SEEK_HOLE)); if (0 <= ext_end)