From dds@icarian.dmst.aueb.gr  Wed Feb 20 12:56:18 2008
Return-Path: <dds@icarian.dmst.aueb.gr>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA35716A402
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Feb 2008 12:56:18 +0000 (UTC)
	(envelope-from dds@icarian.dmst.aueb.gr)
Received: from icarian.dmst.aueb.gr (icarian.dmst.aueb.gr [195.251.249.166])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D12213C4E9
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Feb 2008 12:56:17 +0000 (UTC)
	(envelope-from dds@icarian.dmst.aueb.gr)
Received: from icarian.dmst.aueb.gr (localhost [127.0.0.1])
	by icarian.dmst.aueb.gr (8.14.2/8.14.2) with ESMTP id m1KCuGNS022014
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Feb 2008 14:56:16 +0200 (EET)
	(envelope-from dds@icarian.dmst.aueb.gr)
Received: (from dds@localhost)
	by icarian.dmst.aueb.gr (8.14.2/8.14.2/Submit) id m1KCuGmc022013;
	Wed, 20 Feb 2008 14:56:16 +0200 (EET)
	(envelope-from dds)
Message-Id: <200802201256.m1KCuGmc022013@icarian.dmst.aueb.gr>
Date: Wed, 20 Feb 2008 14:56:16 +0200 (EET)
From: Diomidis Spinellis <dds@aueb.gr>
Reply-To: Diomidis Spinellis <dds@aueb.gr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: 4.11 dumps cause restore to panic with "lost data"
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         120881
>Category:       bin
>Synopsis:       4.11 dumps cause restore(8) to panic with "lost data"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 20 13:00:04 UTC 2008
>Closed-Date:    Mon Jun 09 07:59:28 UTC 2008
>Last-Modified:  Tue Jul 10 03:39:51 UTC 2012
>Originator:     Diomidis Spinellis
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
AUEB
>Environment:
System: FreeBSD icarian.dmst.aueb.gr 8.0-CURRENT FreeBSD 8.0-CURRENT #13: Thu Jan 24 14:21:33 EET 2008 dds@icarian.dmst.aueb.gr:/usr/obj/usr/home/dds/src/fbsd-head/src/sys/ICARIAN i386


>Description:
	Restoring a level-0 dump generated on a 4.11 system with
	dump -h 0 -au -f - /vol
	on a CURRENT system with
	restore -dv -rN -f -
	causes restore to panic on tape.c line 1025 with curblk having the
	value of 1.  Previous files verify OK.

	Here is the excerpted output of restore:

	Verify tape and initialize maps
	Dump   date: Fri Jan 11 21:36:29 2008
	Dumped from: the epoch
	Level 0 dump of /vol on [...]:/dev/ad2c
	Label: none
	Begin level 0 restore
	Initialize symbol table.
	Extract directories from tape
	[...]
	Extract new leaves.
	Check pointing the restore
	extract file ./du.out
	skipping 1 junk block(s)
	File header, ino 3
	extract file ./errors
	skipping 1 junk block(s)
	File header, ino 4
	extract file ./music/[...]
	skipping 1 junk block(s)
	File header, ino 540672
	extract file ./music/...
	File header, ino 540676
	File continuation header, ino 540676
	[... 16 identical lines]
	File continuation header, ino 540676
	Missing address (header) block for ./[...] at 0 blocks
	extract file ./music/[...]
	File header, ino 540677
	File continuation header, ino 540677
	[... 18 identical lines]
	File continuation header, ino 540677
	Missing address (header) block for ./[...] at 0 blocks
	getfile: lost data
	abort? [yn]

>How-To-Repeat:
	See above.  The dump in question is 190GB, but I could work on
	creating a subset, if needed.
>Fix:

	It seems that the culprit is the following sequence in tape.c
	if (curblk > 0)
		panic("getfile: lost data\n");
	This was introduced in version 1.48
	Version 1.44.2.1 of tape.c shipped with FreeBSD 6.2 has a different
	handler:
	if (curblk > 0)
		(*fill)((char *)buf, (long)((curblk * TP_BSIZE) + size));
	which doesn't panic.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Wed Feb 20 13:04:05 UTC 2008 
State-Changed-Why:  
Duplicate of 118087 (which was forwared to dwmalone today). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120881 
State-Changed-From-To: closed->open 
State-Changed-By: dds 
State-Changed-When: Wed Feb 20 13:07:49 UTC 2008 
State-Changed-Why:  
This problem is different from 118087, and occurs with restore patched 
as proposed in 118087. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120881 
Responsible-Changed-From-To: freebsd-bugs->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Fri May 2 14:29:48 UTC 2008 
Responsible-Changed-Why:  
I'll have a look at this. 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120881 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/120881: commit references a PR
Date: Thu, 22 May 2008 22:19:38 +0000 (UTC)

 mckusick    2008-05-22 22:19:33 UTC
 
   FreeBSD src repository
 
   Modified files:
     sbin/restore         tape.c 
   Log:
   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
   
   Revision  Changes    Path
   1.53      +3 -0      src/sbin/restore/tape.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: dwmalone 
State-Changed-When: Mon Jun 9 07:58:39 UTC 2008 
State-Changed-Why:  
This should be fixed in RELENG_6, RELENG_7 and -current now. 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120881 
Responsible-Changed-From-To: dwmalone->freebsd-bugs 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Tue Jul 10 03:39:50 UTC 2012 
Responsible-Changed-Why:  
over to the pool (approved by bugmeister) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120881 
>Unformatted:
