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

2018-01-09 Thread Pavel Raiskup
On Tuesday, January 9, 2018 8:59:06 AM CET Paul Eggert wrote: > Pavel Raiskup wrote: > > So what about special casing that filesystem, where we can lseek() for > > holes anyway? > > If we can lseek for holes, then why not just do that? Checking whether lseek() actually works costs some additional

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

2018-01-09 Thread Joerg Schilling
Paul Eggert 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. So > I agree with you that it's irrelevant whether fsy

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

2018-01-09 Thread Joerg Schilling
Paul Eggert wrote: > If we can lseek for holes, then why not just do that? We shouldn't need > special-case code for btrfs per se. Any filesystem where we can lseek for > holes > should take advantage of that optimization. This is what star uses since 13 years ;-) Jörg -- EMail:jo...@schi

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

2018-01-09 Thread Joerg Schilling
Pavel Raiskup wrote: > On Tuesday, January 9, 2018 8:59:06 AM CET Paul Eggert wrote: > > Pavel Raiskup wrote: > > > So what about special casing that filesystem, where we can lseek() for > > > holes anyway? > > > > If we can lseek for holes, then why not just do that? > > Checking whether lseek(

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

2018-01-09 Thread Tim Kientzle
> Paul Eggert 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 e

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

2018-01-09 Thread Paul Eggert
On 01/09/2018 09:02 AM, Tim Kientzle wrote: So is there some other way to quickly identify sparse files so we can avoid the SEEK_HOLE scan for non-sparse files? Nothing that's at all portable, no.

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

2018-01-09 Thread Paul Eggert
On 01/09/2018 01:38 AM, Joerg Schilling wrote: If POSIX would allow such unexpected behavior, this would have been documented. I'm afraid we'll just have to agree to disagree here. Even if you expect a particular behavior, it's not the behavior that I expect nor is it the behavior that we act

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

2018-01-09 Thread Mark H Weaver
Mark H Weaver writes: > I don't expect any of this to convince you, but it is most likely the > last message I will write in this "debate" between you and the rest of > the world. Instead, I will focus on fixing the bug. I apologize for losing my patience here. This last paragraph was in poor t

[Bug-tar] [PATCH] Remove nonportable check for files containing only zeroes

2018-01-09 Thread Mark H Weaver
>From da922703282b0d3b8837a99a9c7fdd32f1d20d49 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 9 Jan 2018 20:16:14 -0500 Subject: [PATCH] Remove nonportable check for files containing only zeroes. This check benefitted only one unlikely case (large files containing only zeroes, on systems