GNU bug report logs - #79267
cp --sparse=auto heuristic fails on a squashfs mounted drive.

Previous Next

Package: coreutils;

Reported by: Jeremy Allison <jallison <at> ciq.com>

Date: Tue, 19 Aug 2025 02:39:02 UTC

Severity: normal

Full log


Message #24 received at 79267 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>,
 Jeremy Allison <jallison <at> ciq.com>
Cc: 79267 <at> debbugs.gnu.org, hvanderwal <at> ciq.com
Subject: Re: bug#79267: cp --sparse=auto heuristic fails on a squashfs mounted
 drive.
Date: Fri, 22 Aug 2025 18:48:31 -0600
[Message part 1 (text/plain, inline)]
On 8/22/25 07:04, Pádraig Brady wrote:
>        /* Copy this extent, looking for further opportunities to not
>           bother to write zeros if --sparse=always, since SEEK_HOLE
>           is conservative and may miss some holes.  */
> 
> So the comment needs to be tweaked, but a more general issue
> is that it disables copy offloading (copy_file_range) for sparse files.

Ouch, I didn't see that. That's a real loss. I installed the first 
attached patch to revert that part of my recent change.

I assume the part of the change that always punches holes is OK. I 
couldn't see why one would not want to punch a hole if one has already 
taken the trouble to find and create the hole.

> BTW commit 26bf557 also changed this a couple of weeks ago
> without updating the comment, so the comment relates to sparse_mode != 
> SPARSE_ALWAYS.

Not quite following but I hope the comment is OK now with the first 
patch installed.

> squashfs is giving the wrong info here after all, 
> right?

Yes, that's the actual space-performance bug here. I installed the 
second attached patch to try to work around it.

Jeremy, can you please try these two further patches? Thanks.
[0001-cp-go-back-to-copy_file_range-optimization.patch (text/x-patch, attachment)]
[0002-cp-improve-hole-handling-on-squashfs.patch (text/x-patch, attachment)]

This bug report was last modified 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.