[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] Detection of sparse files is broken on btrfs
From: |
Tim Kientzle |
Subject: |
Re: [Bug-tar] Detection of sparse files is broken on btrfs |
Date: |
Tue, 9 Jan 2018 09:02:08 -0800 |
> Paul Eggert <address@hidden> wrote:
>
>> POSIX does not require that st_nblocks remain constant across any system
>> call. It doesn't even require that it remain constant if you merely call
>> stat twice on the same file, without doing anything else in between.
The real question is then:
What is the most efficient (preferably portable) way for an archiving program
(such as tar) to determine whether it should archive a particular file as
sparse or non-sparse?
Historically, we’ve compared st_nblocks to st_size to quickly determine if a
file is sparse in order to avoid the SEEK_HOLE scan in most cases. Some
programs even consider st_nblocks == 0 as an indication that a file is entirely
sparse. Based on the claims I’ve read here, it sounds like st_nblocks can no
longer be trusted for these purposes.
So is there some other way to quickly identify sparse files so we can avoid the
SEEK_HOLE scan for non-sparse files?
Cheers,
Tim
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, (continued)
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Mark H Weaver, 2018/01/08
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Joerg Schilling, 2018/01/08
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Paul Eggert, 2018/01/08
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Joerg Schilling, 2018/01/08
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Paul Eggert, 2018/01/08
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Joerg Schilling, 2018/01/08
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Paul Eggert, 2018/01/08
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Joerg Schilling, 2018/01/08
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Paul Eggert, 2018/01/08
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Joerg Schilling, 2018/01/09
- Re: [Bug-tar] Detection of sparse files is broken on btrfs,
Tim Kientzle <=
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Paul Eggert, 2018/01/09
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Joerg Schilling, 2018/01/10
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Andreas Dilger, 2018/01/17
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Tim Kientzle, 2018/01/17
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Andreas Dilger, 2018/01/18
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Joerg Schilling, 2018/01/18
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Paul Eggert, 2018/01/09
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Joerg Schilling, 2018/01/10
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Paul Eggert, 2018/01/17
- Re: [Bug-tar] Detection of sparse files is broken on btrfs, Ralph Corderoy, 2018/01/17