From gwk@mscsoftware.com  Mon Feb  4 01:36:19 2002
Return-Path: <gwk@mscsoftware.com>
Received: from draco.macsch.com (draco.macsch.com [192.73.8.1])
	by hub.freebsd.org (Postfix) with ESMTP id 2FC8637B41C
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  4 Feb 2002 01:36:19 -0800 (PST)
Received: from mailmuc.muc.eu.mscsoftware.com (mailmuc.muc.macsch.com [161.34.37.20])
	by draco.macsch.com (8.9.3/8.9.3) with ESMTP id BAA16051
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 4 Feb 2002 01:31:32 -0800 (PST)
Received: from hunter.muc.macsch.com (hunter.muc.macsch.com [172.17.22.32])
	by mailmuc.muc.eu.mscsoftware.com (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) with ESMTP id g149ZZv08665
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 4 Feb 2002 10:35:35 +0100
Received: (from gwk@localhost)
	by hunter.muc.macsch.com (8.11.6/8.11.6) id g149aJg01133;
	Mon, 4 Feb 2002 10:36:19 +0100 (CET)
	(envelope-from gwk)
Message-Id: <200202040936.g149aJg01133@hunter.muc.macsch.com>
Date: Mon, 4 Feb 2002 10:36:19 +0100 (CET)
From: "Georg-W. Koltermann" <Georg.Koltermann@mscsoftware.com>
Reply-To: "Georg-W. Koltermann" <gwk@mscsoftware.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: restore fails with "Changing volumes on pipe input?"
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         34604
>Category:       bin
>Synopsis:       restore fails with "Changing volumes on pipe input?"
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 04 01:40:01 PST 2002
>Closed-Date:    Thu Feb 14 09:47:49 PST 2002
>Last-Modified:  Thu Feb 14 09:56:45 PST 2002
>Originator:     Georg-W. Koltermann
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
MSC Software
>Environment:
System: FreeBSD hunter.muc.macsch.com 5.0-CURRENT FreeBSD 5.0-CURRENT #46: Mon Jan 28 03:33:12 CET 2002 root@hunter.muc.macsch.com:/usr/obj/usr/src/sys/HUNTER i386
CVSupped 7-JAN-2002 10:44 CET

>Description:
hunter#	mount /dev/ad2s5e /mnt
hunter#	cd /mnt
hunter#	dump 0uaf - /home/hunter | restore -xf -
  DUMP: Date of this level 0 dump: Mon Feb  4 09:54:45 2002
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/ad0s5e (/home/hunter) to standard output
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 2969635 tape blocks.
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: 10.47% done, finished in 0:43
  DUMP: 30.29% done, finished in 0:23
  DUMP: 75.81% done, finished in 0:04
  DUMP: 92.47% done, finished in 0:01
  DUMP: DUMP: 2969723 tape blocks
  DUMP: finished in 1484 seconds, throughput 2001 KBytes/sec
  DUMP: level 0 dump on Mon Feb  4 09:54:45 2002
  DUMP: DUMP IS DONE
Changing volumes on pipe input?
abort? [yn] n
Changing volumes on pipe input?
abort? [yn] y
dump core? [yn] n

>How-To-Repeat:
Try to copy a live filesystem to a scratch partition, using dump/restore
over a pipe.
>Fix:

	


>Release-Note:
>Audit-Trail:

From: Ian Dowse <iedowse@maths.tcd.ie>
To: "Georg-W. Koltermann" <gwk@mscsoftware.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/34604: restore fails with "Changing volumes on pipe input?" 
Date: Mon, 04 Feb 2002 23:46:43 +0000

 In message <200202040936.g149aJg01133@hunter.muc.macsch.com>, "Georg-W. Kolterm
 ann" writes:
 >  DUMP: level 0 dump on Mon Feb  4 09:54:45 2002
 >  DUMP: DUMP IS DONE
 >Changing volumes on pipe input?
 >abort? [yn] n
 
 >>How-To-Repeat:
 >Try to copy a live filesystem to a scratch partition, using dump/restore
 >over a pipe.
 
 Could you try applying the following patch in /usr/src/sbin/restore
 and then doing a "make; make install" there? I've been sitting on
 it for a while because I haven't had a chance to clean it up and
 check that it doesn't break multi-volume restores.
 
 Ian
 
 Index: restore.c
 ===================================================================
 RCS file: /home/iedowse/CVS/src/sbin/restore/restore.c,v
 retrieving revision 1.7
 diff -u -r1.7 restore.c
 --- restore.c	28 Aug 1999 00:14:08 -0000	1.7
 +++ restore.c	4 Feb 2002 23:43:46 -0000
 @@ -689,6 +689,7 @@
  
  	vprintf(stdout, "Extract requested files\n");
  	curfile.action = SKIP;
 +	curvol = -1;
  	getvol((long)1);
  	skipmaps();
  	skipdirs();
 @@ -702,35 +703,40 @@
  		 */
  		if (first > last)
  			return;
 -		/*
 -		 * Reject any volumes with inodes greater
 -		 * than the last one needed
 -		 */
 -		while (curfile.ino > last) {
 -			curfile.action = SKIP;
 -			getvol((long)0);
 -			skipmaps();
 -			skipdirs();
 +		if (curvol != volno) {
 +			/*
 +			 * If at the beginning of a volume, reject any
 +			 * volumes with inodes greater than the last one
 +			 * needed
 +			 */
 +			while (curfile.ino > last) {
 +				curfile.action = SKIP;
 +				getvol((long)0);
 +				skipmaps();
 +				skipdirs();
 +			}
 +		}
 +		if (curfile.ino <= last) {
 +			/*
 +			 * Decide on the next inode needed.
 +			 * Skip across the inodes until it is found
 +			 * or an out of order volume change is encountered
 +			 */
 +			next = lowerbnd(curfile.ino);
 +			do	{
 +				curvol = volno;
 +				while (next > curfile.ino && volno == curvol)
 +					skipfile();
 +				skipmaps();
 +				skipdirs();
 +			} while (volno == curvol + 1);
 +			/*
 +			 * If volume change out of order occurred the
 +			 * current state must be recalculated
 +			 */
 +			if (volno != curvol)
 +				continue;
  		}
 -		/*
 -		 * Decide on the next inode needed.
 -		 * Skip across the inodes until it is found
 -		 * or an out of order volume change is encountered
 -		 */
 -		next = lowerbnd(curfile.ino);
 -		do	{
 -			curvol = volno;
 -			while (next > curfile.ino && volno == curvol)
 -				skipfile();
 -			skipmaps();
 -			skipdirs();
 -		} while (volno == curvol + 1);
 -		/*
 -		 * If volume change out of order occurred the
 -		 * current state must be recalculated
 -		 */
 -		if (volno != curvol)
 -			continue;
  		/*
  		 * If the current inode is greater than the one we were
  		 * looking for then we missed the one we were looking for.
 @@ -762,6 +768,7 @@
  			if (volno != curvol)
  				skipmaps();
  		}
 +		curvol = volno;
  	}
  }
  
State-Changed-From-To: open->closed 
State-Changed-By: iedowse 
State-Changed-When: Thu Feb 14 09:47:49 PST 2002 
State-Changed-Why:  

Duplicate of bin/4176. This has been fixed in -CURRENT, and it 
should be merged into -STABLE within a few weeks. 

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