From owner-freebsd-bugs Mon Feb 4 15:50:28 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A3F6637B41E for ; Mon, 4 Feb 2002 15:50:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g14No2X24029; Mon, 4 Feb 2002 15:50:02 -0800 (PST) (envelope-from gnats) Date: Mon, 4 Feb 2002 15:50:02 -0800 (PST) Message-Id: <200202042350.g14No2X24029@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ian Dowse Subject: Re: bin/34604: restore fails with "Changing volumes on pipe input?" Reply-To: Ian Dowse Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/34604; it has been noted by GNATS. From: Ian Dowse To: "Georg-W. Koltermann" 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