Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Feb 2002 15:50:02 -0800 (PST)
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/34604: restore fails with "Changing volumes on pipe input?" 
Message-ID:  <200202042350.g14No2X24029@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/34604; it has been noted by GNATS.

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;
  	}
  }
  

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202042350.g14No2X24029>