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
This commit is contained in:
Kirk McKusick 2008-05-22 22:18:38 +00:00
parent c448998d5b
commit 67dafe43c1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179218

View File

@ -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