[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: |
Andrew J. Schorr |
Subject: |
Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks |
Date: |
Tue, 29 Oct 2013 08:03:47 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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 <address@hidden>
> Date: Mon, 28 Oct 2013 21:16:53 -0700
> Subject: [PATCH] paxutils: support --sparse with tiny files on Netapp filers
>
> * lib/system.h (ST_IS_SPARSE): Port to NFS + Netapp filers,
> where a tiny file can have zero blocks but nonzero size.
> Problem reported by Andrew J. Schorr in
> <http://lists.gnu.org/archive/html/bug-tar/2013-10/msg00030.html>.
> ---
> lib/system.h | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/lib/system.h b/lib/system.h
> index ef46267..e7f531c 100644
> --- a/lib/system.h
> +++ b/lib/system.h
> @@ -389,9 +389,16 @@ extern int errno;
> # define ST_NBLOCKSIZE 512
> #endif
>
> +/* Network Appliance file systems store small files directly in the
> + inode if st_size <= 64; in this case the number of blocks can be
> + zero. Perhaps other file systems have similar problems; so,
> + somewhat arbitrarily, do not consider a file to be sparse if
> + it has no blocks but st_size < ST_NBLOCKSIZE. */
> #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 != 0 \
> + && (st).st_size / ST_NBLOCKSIZE != 0)))
>
> /* Declare standard functions. */
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
...
Regards,
Andy
- [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Andrew J. Schorr, 2013/10/28
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Paul Eggert, 2013/10/29
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Pavel Raiskup, 2013/10/29
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Pavel Raiskup, 2013/10/29
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Joerg Schilling, 2013/10/29
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Christoph Hellwig, 2013/10/30
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Jan Kara, 2013/10/30
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Andreas Dilger, 2013/10/29
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Carlos Maiolino, 2013/10/31
Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks,
Andrew J. Schorr <=
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Andrew J. Schorr, 2013/10/29
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Pavel Raiskup, 2013/10/29
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Tim Kientzle, 2013/10/29
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Andrew J. Schorr, 2013/10/29
- Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks, Paul Eggert, 2013/10/29