]> git.wh0rd.org - dump.git/commitdiff
Fix restore when inode maps are not entirely contained on the first volume.
authorStelian Pop <stelian@popies.net>
Mon, 6 May 2002 08:45:41 +0000 (08:45 +0000)
committerStelian Pop <stelian@popies.net>
Mon, 6 May 2002 08:45:41 +0000 (08:45 +0000)
CHANGES
restore/tape.c

diff --git a/CHANGES b/CHANGES
index e055370d6215a46659d5efab62badbe485342304..1f139e5b3510c43d6042aa16aa23c52252dd0d24 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.173 2002/04/15 11:57:27 stelian Exp $
+$Id: CHANGES,v 1.174 2002/05/06 08:45:41 stelian Exp $
 
 Changes between versions 0.4b28 and 0.4b29 (released ??????????????)
 ====================================================================
@@ -10,6 +10,11 @@ Changes between versions 0.4b28 and 0.4b29 (released ??????????????)
        Jörg Schilling <schilling@fokus.gmd.de> for reporting this bug and
        providing an excellent, cross-platform replacement for rmt in his
        star package.
+
+2.     Fixed a bug reported by Andy Mentges <amentges@jumpline.com>
+       which caused restore to fail when the inode maps were not entirely
+       contained on the first volume (when using really small volumes or
+       when dumping a huge number of inodes).
        
 Changes between versions 0.4b27 and 0.4b28 (released April 12, 2002)
 ====================================================================
index 453b7eb276e533f694cfc73bfdd7d2ae0b8c32c1..1b6b1d9d52578436d8fd6c1cfa6baf712359fe11 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.60 2002/04/04 08:20:23 stelian Exp $";
+       "$Id: tape.c,v 1.61 2002/05/06 08:45:41 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -431,6 +431,8 @@ getvol(long nextvol)
        if (nextvol == 1) {
                tapesread = 0;
                gettingfile = 0;
+               tpblksread = 0;
+               blksread = 0;
        }
        if (pipein) {
                if (nextvol != 1)
@@ -587,8 +589,6 @@ gethdr:
                goto again;
        }
        tapesread |= 1 << volno;
-       blksread = saved_blksread;
-       tpblksread = saved_tpblksread;
        /*
         * If continuing from the previous volume, skip over any
         * blocks read already at the end of the previous volume.
@@ -603,10 +603,10 @@ gethdr:
 #endif /* !HAVE_ZLIB && !HAVE_BZLIB */
        }
        Dprintf(stdout, "read %ld recs, tape starts with %ld\n",
-               tpblksread, (long)tmpbuf.c_firstrec);
+               tpblksread - 1, (long)tmpbuf.c_firstrec);
        if (tmpbuf.c_type == TS_TAPE && (tmpbuf.c_flags & DR_NEWHEADER)) {
                if (!wantnext) {
-                       tpblksread = tmpbuf.c_firstrec;
+                       tpblksread = tmpbuf.c_firstrec + 1;
                        for (i = tmpbuf.c_count; i > 0; i--)
                                readtape(buf);
                } else if (tmpbuf.c_firstrec > 0 &&