bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Detection of sparse files is broken on btrfs


From: Joerg Schilling
Subject: Re: [Bug-tar] Detection of sparse files is broken on btrfs
Date: Thu, 18 Jan 2018 11:25:52 +0100
User-agent: Heirloom mailx 12.5 7/5/10

Andreas Dilger <address@hidden> wrote:

> Given that calling SEEK_HOLE is also going to have some cost, my suggestion
> would be to ignore st_blocks completely for small files (size < 64KB) and
> just read the file in this case, since the overhead of reading will probably
> be about the same as checking if any blocks are allocated.  If no blocks are
> allocated, then the read will not do any disk IO, and if there are blocks
> allocated they would have needed to be read from disk anyway and SEEK_HOLE
> would be pure overhead.

If you propose to ignore st_blocks completely for small files that are on 
historic (unmaintained) filesystems without SEEK_HOLE support, this is what 
star does since years ;-)



> To catch larger files that have been written to cache but haven't flushed
> data to disk yet, it might still make sense to use SEEK_HOLE on larger files
> with st_blocks == 0, especially if they have a recent mtime.

Using mtime does not look like a good idea in this context.

Jörg

-- 
 EMail:address@hidden                    (home) Jörg Schilling D-13353 Berlin
    address@hidden (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'



reply via email to

[Prev in Thread] Current Thread [Next in Thread]