[Top][All Lists]

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

Re: [Bug-tar] POSIX_ARCHIVE & big sparse files (>= 2^33 B excluding hole

From: Pavel Raiskup
Subject: Re: [Bug-tar] POSIX_ARCHIVE & big sparse files (>= 2^33 B excluding holes)
Date: Mon, 28 Jan 2013 14:59:07 +0100

On Mon, 2013-01-28 at 10:17 +0100, Pavel Raiskup wrote:
> Hi Paul,
> > Thanks for catching that bug.  We don't yet have a facility
> > for large test cases, so I guess we can put that on the todo list.
> I agree (this is probably about paxutils?).
> > Your patch doesn't feel quite right, as there's a similar
> > issue in pax_dump_header_0, and also there's a problem if
> > the shrunken size is less than 8 GiB but the real size is not.
> > I pushed the following patch instead: does it fix things for you?
> Of course, it fixes the issue.  Thanks for this!

Another small problem: tar is unable to list such archive (containing
sparse file(s) of size >8GB).  It does not honor the size=N extended
header during reading.  This is because the file_stat->archive_file_size
is set based on basic header field only before xheader_decode() is

Could you consider/use as inspiration the following fix?  Thanks.

diff --git a/src/xheader.c b/src/xheader.c
index c8c54b6..534ed68 100644
--- a/src/xheader.c
+++ b/src/xheader.c
@@ -1305,7 +1305,11 @@ size_decoder (struct tar_stat_info *st,
   uintmax_t u;
   if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), keyword))
-    st->stat.st_size = u;
+    {
+      if (u > st->stat.st_size)
+        st->stat.st_size = u;
+      st->archive_file_size = u;
+    }
 static void

This solves also other problem.  Listing of big sparse file (>8GB) in
archive causes that bad size is printed to stdout (the effective size
instead of real size).  This is because the "size" extended header is
stored after "GNU.sparse.realsize".

More then previous fix, this should be tested by testsuite to not break
desired behavior in future.


reply via email to

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