summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2008-05-22 22:18:38 +0000
committermckusick <mckusick@FreeBSD.org>2008-05-22 22:18:38 +0000
commit6905fbb12e273fa138d6afc6ad6a64b9c4c267d5 (patch)
treea0539cad3a1c159a2bf28d8099bdb9a8217084e6 /sbin
parentbcc592e44da8c6f2e2631730f3de1bcda47f5e17 (diff)
downloadFreeBSD-src-6905fbb12e273fa138d6afc6ad6a64b9c4c267d5.zip
FreeBSD-src-6905fbb12e273fa138d6afc6ad6a64b9c4c267d5.tar.gz
Follow on to fix 1.51 for "Header with wrong dumpdate" message.
Must ensure that dump tapes from UFS1 filesystems properly copy old fields of dump headers to new locations. Move check of dumpdate to follow the code which ensures that the appropriate fields have been copied. PR: bin/118087 Help from: David Malone, Scott Lambert, Javier Martín Rueda MFC after: 2 weeks
Diffstat (limited to 'sbin')
-rw-r--r--sbin/restore/tape.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 074d1b1..1386995 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -1379,8 +1379,6 @@ gethead(struct s_spcl *buf)
}
if (checksum((int *)buf) == FAIL)
return (FAIL);
- if (dumpdate != 0 && _time64_to_time(buf->c_date) != dumpdate)
- fprintf(stderr, "Header with wrong dumpdate.\n");
if (Bcvt) {
swabst((u_char *)"8l4s1q8l2q17l", (u_char *)buf);
swabst((u_char *)"l",(u_char *) &buf->c_level);
@@ -1395,28 +1393,25 @@ gethead(struct s_spcl *buf)
/*
* Have to patch up missing information in bit map headers
*/
- buf->c_inumber = 0;
buf->c_size = buf->c_count * TP_BSIZE;
if (buf->c_count > TP_NINDIR)
readmapflag = 1;
else
for (i = 0; i < buf->c_count; i++)
buf->c_addr[i]++;
- break;
+ /* FALL THROUGH */
case TS_TAPE:
- if (buf->c_magic == NFS_MAGIC) {
- if ((buf->c_flags & NFS_DR_NEWINODEFMT) == 0)
- oldinofmt = 1;
- buf->c_date = _time32_to_time(buf->c_old_date);
- buf->c_ddate = _time32_to_time(buf->c_old_ddate);
- buf->c_tapea = buf->c_old_tapea;
- buf->c_firstrec = buf->c_old_firstrec;
- }
+ if (buf->c_magic == NFS_MAGIC &&
+ (buf->c_flags & NFS_DR_NEWINODEFMT) == 0)
+ oldinofmt = 1;
+ /* FALL THROUGH */
+
case TS_END:
buf->c_inumber = 0;
- break;
+ /* FALL THROUGH */
+ case TS_ADDR:
case TS_INODE:
/*
* For old dump tapes, have to copy up old fields to
@@ -1432,13 +1427,12 @@ gethead(struct s_spcl *buf)
}
break;
- case TS_ADDR:
- break;
-
default:
panic("gethead: unknown inode type %d\n", buf->c_type);
break;
}
+ if (dumpdate != 0 && _time64_to_time(buf->c_date) != dumpdate)
+ fprintf(stderr, "Header with wrong dumpdate.\n");
/*
* If we're restoring a filesystem with the old (FreeBSD 1)
* format inodes, copy the uid/gid to the new location
OpenPOWER on IntegriCloud