From owner-cvs-all Wed Feb 13 4: 7: 9 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7166137B405; Wed, 13 Feb 2002 04:06:58 -0800 (PST) Received: (from iedowse@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1DC6wp06177; Wed, 13 Feb 2002 04:06:58 -0800 (PST) (envelope-from iedowse) Message-Id: <200202131206.g1DC6wp06177@freefall.freebsd.org> From: Ian Dowse Date: Wed, 13 Feb 2002 04:06:58 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sbin/restore tape.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG iedowse 2002/02/13 04:06:58 PST Modified files: sbin/restore tape.c Log: Fix a number of long-standing restore bugs in tape.c, mainly relating to multi-volume restores: - In findinode(), keep a copy of header->c_type so that we don't exit the do-while loop until we have processed the current header. Exiting too early leaves curfile.ino set to 0, which confuses the logic in createfiles(), so multi-volume restores with the 'x' command don't work if you follow the instructions and supply the tapes in reverse order. This appears to have been broken by CSRG revision 5.33 tape.c (Oct 1992). - The logic in getvol() for deciding how many records to skip after the volume header was confused; sometimes it would skip too few records and sometimes too many, leading to "resync restore" warnings and missing files. Skip to the next header only when the current action is not `USING'. Work around a dump bug that sets c_count incorrectly in the volume header of the first tape. Some of the problems here date back to at least 1991. - Back out revision 1.23. This appeared to avoid warnings about missing files in the 'rN' verification case, but it made the problems with the 'x' command worse by stopping getvol() from even attempting to find the first inode number on the newly inserted tape. The bug it addressed is fixed by correcting the skipping logic as described above. - Save the value of `tpblksread' in case the wrong volume is supplied, because it is incremented each time we read a volume header. We already saved `blksread' for the same reson. Revision Changes Path 1.27 +19 -18 src/sbin/restore/tape.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message