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

2013-10-29 Thread Pavel Raiskup
#define ST_IS_SPARSE(st) \ (ST_NBLOCKS (st)\ - ((st).st_size / ST_NBLOCKSIZE + ((st).st_size % ST_NBLOCKSIZE != 0))) +((st).st_size / ST_NBLOCKSIZE \ + + ((st).st_size % ST_NBLOCKSIZE

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

2013-10-29 Thread Andrew J. Schorr
Hi Paul, On Mon, Oct 28, 2013 at 09:19:58PM -0700, Paul Eggert wrote: Thanks for the bug report. I pushed the following patch to paxutils and it should propagate into GNU tar in the next release. From 63493234ec38ad606a5f726bc82e4fe5d8661cab Mon Sep 17 00:00:00 2001 From: Paul Eggert

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

2013-10-29 Thread Andrew J. Schorr
Hi, On Tue, Oct 29, 2013 at 08:03:47AM -0400, Andrew J. Schorr wrote: Thanks for the patch, but I don't think that fixes the problem in sparse.c:sparse_scan_file where it says if (ST_NBLOCKS (st-stat) == 0) offset = st-stat.st_size; else ... To be clear, I can see that

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

2013-10-29 Thread Pavel Raiskup
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

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

2013-10-29 Thread Tim Kientzle
On Oct 29, 2013, at 7:10 AM, Pavel Raiskup prais...@redhat.com 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