bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] --sparse is broken on filesystems where small files may ha


From: Tim Kientzle
Subject: Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks
Date: Tue, 29 Oct 2013 08:06:40 -0700

On Oct 29, 2013, at 7:10 AM, Pavel Raiskup <address@hidden> wrote:

>> To be clear, I can see that the fix to ST_IS_SPARSE should cause
>> dump_regular_file to be called instead of sparse_dump_file, but I still
>> wonder if it is wise to leave this logic in place.  At the very last,
>> I think a comment would be helpful to explain that this test is valid
>> only because ST_IS_SPARSE has already succeeded.
> 
> At least for the check for zero blocks in sparse file:  It is intentional
> because it makes the processing of completely sparse files to be done in
> constant time (try to archive 'file' from `truncate -s 10G file`).  This
> could be documented possibly.  Otherwise, I would not say that there is
> unclear that sparse_dump_file is supposed to be called only against real
> sparse files.

What about this sparse file:

$ truncate -s 10G file && echo hello >> file

Are there filesystems where the 6 bytes here would be
stored in the inode?  That would give a large sparse
file with zero allocated blocks but not zero content.

Tim






reply via email to

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