From madler@tapil.com  Tue May  8 17:39:33 2001
Return-Path: <madler@tapil.com>
Received: from tapil.com (tapil.ne.mediaone.net [24.218.124.99])
	by hub.freebsd.org (Postfix) with ESMTP id EB3D637B422
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  8 May 2001 17:39:32 -0700 (PDT)
	(envelope-from madler@tapil.com)
Received: (from madler@localhost)
	by tapil.com (8.11.3/8.11.3) id f490dKH64314;
	Tue, 8 May 2001 20:39:20 -0400 (EDT)
	(envelope-from madler)
Message-Id: <200105090039.f490dKH64314@tapil.com>
Date: Tue, 8 May 2001 20:39:20 -0400 (EDT)
From: mad1@tapil.com
Reply-To: mad1@tapil.com
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: fix included -- restore drops files on tape transitions in -N mode
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         27218
>Category:       bin
>Synopsis:       fix included -- restore drops files on tape transitions in -N mode
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    mjacob
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 08 17:40:01 PDT 2001
>Closed-Date:    Tue Jul 3 21:57:28 PDT 2001
>Last-Modified:  Tue Jul 03 21:57:50 PDT 2001
>Originator:     
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
>Environment:
System: FreeBSD grumpy.tapil.com 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Tue Apr 24 15:05:58 EDT 2001 madler@grumpy.tapil.com:/usr/obj/usr/src/sys/GRUMPY i386


	
>Description:

When verifying a multi-tape dump using restore -N, files at the start of
each new tape are incorrectly listed as missing.  This is due to a bug
in getvol().  At the end of the routine it returns if curfile.action is
USING.  Otherwise, it acts as though the tape is the start of a dump.
When -N is set, curfile.action is always SKIP.  I believe that the test
should return and not reinitialize when curfile.action is either USING
or SKIP.

>How-To-Repeat:

Make a multi-tape or multi-file dump set and try "restore -N -r".  Note the
reported failure at the start of each tape other than the first.

>Fix:

Patch /usr/src/sbin/restore/tape.c:

*** tape.c	Tue May  8 20:23:55 2001
--- tape.c.~1~	Mon Apr 23 12:26:52 2001
***************
*** 439,445 ****
   				readtape(buf);
   		}
   	}
! 	if (curfile.action == USING || curfile.action == SKIP) {
  		if (volno == 1)
  			panic("active file into volume 1\n");
  		return;
--- 439,445 ----
   				readtape(buf);
   		}
   	}
! 	if (curfile.action == USING) {
  		if (volno == 1)
  			panic("active file into volume 1\n");
  		return;

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mjacob 
Responsible-Changed-By: kris 
Responsible-Changed-When: Mon May 28 17:03:53 PDT 2001 
Responsible-Changed-Why:  
mjacob has agreed to look at this 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27218 
State-Changed-From-To: open->closed 
State-Changed-By: mjacob 
State-Changed-When: Tue Jul 3 21:57:28 PDT 2001 
State-Changed-Why:  
Fix present in both -current and RELENG_4. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27218 
>Unformatted:

Thanks! I tested it, and it looks good.
I've checked in the fix to -current, and set an MFC timer for 3 weeks
when I'll move it back to RELENG_4 and close the PR.
