aboutsummaryrefslogtreecommitdiff
path: root/sbin/restore
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2008-05-22 22:19:33 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2008-05-22 22:19:33 +0000
commit4e5867d27ebba21deb369d91101e5db4793ff582 (patch)
tree7e316fdd2570da782df47d3e223ffc08f8e6502d /sbin/restore
parent67dafe43c133eb1c91aec152630f40fce734ce46 (diff)
downloadsrc-4e5867d27ebba21deb369d91101e5db4793ff582.tar.gz
src-4e5867d27ebba21deb369d91101e5db4793ff582.zip
This fixes the "getfile: lost data" panic when restoring dumps
on a 7.0 or later system that were created on a pre-5.0 system. We must ensure that restore zeros out the previously undefined birthtime and external attribute size fields when reading dump tapes made by the UFS1 dump program. The problem is that UFS2 dump carefully zeros out the unused birthtime and external attribute size fields in the dump header when dumping UFS1 filesystems, but the UFS1 dump didn't know about those fields (they were spares) so just left whatever random junk was in them. So, when restoring one of these pre-UFS2 dumps, the new restore would eventually trip across a header that had a non-zero external attribute size and try to extract it. That consumed several tape blocks which left it totally out of sync and very unhappy (i.e., the panic). The fix is in the gethead() function which modernizes old headers by copying old fields to their new location (and with this fix) zeroing out previously undefined fields. PR: bin/120881 Review by: David Malone & Scott Lambert MFC after: 1 week
Notes
Notes: svn path=/head/; revision=179219
Diffstat (limited to 'sbin/restore')
-rw-r--r--sbin/restore/tape.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 138699573522..debed5ff4111 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -1424,6 +1424,9 @@ gethead(struct s_spcl *buf)
buf->c_ddate = _time32_to_time(buf->c_old_ddate);
buf->c_atime = _time32_to_time(buf->c_old_atime);
buf->c_mtime = _time32_to_time(buf->c_old_mtime);
+ buf->c_birthtime = 0;
+ buf->c_birthtimensec = 0;
+ buf->c_extsize = 0;
}
break;