Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/restore Add comment and sanity check about why we need ...



details:   https://anonhg.NetBSD.org/src/rev/f09abaaaa291
branches:  trunk
changeset: 486478:f09abaaaa291
user:      enami <enami%NetBSD.org@localhost>
date:      Tue May 23 02:27:33 2000 +0000

description:
Add comment and sanity check about why we need not to skip remaining
blocks if we are reading inode bitmaps.

diffstat:

 sbin/restore/tape.c |  17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 57ca3c1ccf3c -r f09abaaaa291 sbin/restore/tape.c
--- a/sbin/restore/tape.c       Tue May 23 02:19:20 2000 +0000
+++ b/sbin/restore/tape.c       Tue May 23 02:27:33 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tape.c,v 1.40 2000/05/19 09:22:55 enami Exp $  */
+/*     $NetBSD: tape.c,v 1.41 2000/05/23 02:27:33 enami Exp $  */
 
 /*
  * Copyright (c) 1983, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)tape.c     8.9 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: tape.c,v 1.40 2000/05/19 09:22:55 enami Exp $");
+__RCSID("$NetBSD: tape.c,v 1.41 2000/05/23 02:27:33 enami Exp $");
 #endif
 #endif /* not lint */
 
@@ -720,8 +720,17 @@
                                TP_BSIZE : size));
                }
                if ((size -= TP_BSIZE) <= 0) {
-                       if (!(spcl.c_type == TS_BITS ||
-                           spcl.c_type == TS_CLRI)) {
+                       if (spcl.c_type == TS_BITS || spcl.c_type == TS_CLRI) {
+                               /*
+                                * In this case, the following expression
+                                * should always be false since the size was
+                                * initially set to spcl.c_dinode.di_size and
+                                * it is initialized to spcl.c_count * TP_BSIZE
+                                * in gethead().
+                                */
+                               if (!(size == 0 && i == spcl.c_count - 1))
+                                       panic("inconsistent map size\n");
+                       } else {
                                for (i++; i < spcl.c_count; i++)
                                        if (spcl.c_addr[i])
                                                readtape(junk);



Home | Main Index | Thread Index | Old Index