CVS commit: [netbsd-9] src/sbin/dump

2021-06-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  8 12:55:40 UTC 2021

Modified Files:
src/sbin/dump [netbsd-9]: tape.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1283):

sbin/dump/tape.c: revision 1.56

Bitmaps (TS_BITS and TS_CLRI) dont use the "c_addr" array as they
cannot have holes.  As bitmaps are written without TS_ADDR records
"c_count" may be larger than the "c_addr" size resulting in a
segmentation violation reading "c_addr" beyond its end.

Compute "blks" for TS_INODE and TS_ADDR only -- its used for multi
volume dumps and the bitmaps must both be on the first volume.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.2.1 src/sbin/dump/tape.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/dump/tape.c
diff -u src/sbin/dump/tape.c:1.55 src/sbin/dump/tape.c:1.55.2.1
--- src/sbin/dump/tape.c:1.55	Fri Mar  1 16:42:11 2019
+++ src/sbin/dump/tape.c	Tue Jun  8 12:55:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tape.c,v 1.55 2019/03/01 16:42:11 christos Exp $	*/
+/*	$NetBSD: tape.c,v 1.55.2.1 2021/06/08 12:55:40 martin Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)tape.c	8.4 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: tape.c,v 1.55 2019/03/01 16:42:11 christos Exp $");
+__RCSID("$NetBSD: tape.c,v 1.55.2.1 2021/06/08 12:55:40 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -328,7 +328,8 @@ flushtape(void)
 	}
 
 	blks = 0;
-	if (iswap32(spcl.c_type) != TS_END) {
+	if (iswap32(spcl.c_type) == TS_INODE ||
+	iswap32(spcl.c_type) == TS_ADDR) {
 		for (i = 0; i < iswap32(spcl.c_count); i++)
 			if (spcl.c_addr[i] != 0)
 blks++;



CVS commit: [netbsd-9] src/sbin/dump

2020-12-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Dec  6 10:31:02 UTC 2020

Modified Files:
src/sbin/dump [netbsd-9]: dump.h main.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1139):

sbin/dump/dump.h: revision 1.59
sbin/dump/main.c: revision 1.78

PR bin/55834

count blocks written in unsigned 64 bit counter
rather than signed int which overflows after 2^31-1
blocks (2TiB) after which neither the 5 minute
status updates or SIGINFO (^T) reports are issued
until the negative numbers increase past 0 and
wildly inaccurate reports would be written.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.57.2.1 src/sbin/dump/dump.h
cvs rdiff -u -r1.75 -r1.75.2.1 src/sbin/dump/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/dump/dump.h
diff -u src/sbin/dump/dump.h:1.57 src/sbin/dump/dump.h:1.57.2.1
--- src/sbin/dump/dump.h:1.57	Mon Mar 25 02:13:01 2019
+++ src/sbin/dump/dump.h	Sun Dec  6 10:31:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dump.h,v 1.57 2019/03/25 02:13:01 manu Exp $	*/
+/*	$NetBSD: dump.h,v 1.57.2.1 2020/12/06 10:31:02 martin Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1993
@@ -134,7 +134,7 @@ int	unlimited;	/* if set, write to end o
 extern int	density;	/* density in 0.1" units */
 extern int	notify;		/* notify operator flag */
 extern int	timestamp;	/* timestamp messages */
-extern int	blockswritten;	/* number of blocks written on current tape */
+extern u_int64_t	blockswritten;	/* blocks written on current tape */
 extern int	tapeno;		/* current tape number */
 extern int	is_ufs2;
 

Index: src/sbin/dump/main.c
diff -u src/sbin/dump/main.c:1.75 src/sbin/dump/main.c:1.75.2.1
--- src/sbin/dump/main.c:1.75	Mon Mar 25 02:13:01 2019
+++ src/sbin/dump/main.c	Sun Dec  6 10:31:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $	*/
+/*	$NetBSD: main.c,v 1.75.2.1 2020/12/06 10:31:02 martin Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.6 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $");
+__RCSID("$NetBSD: main.c,v 1.75.2.1 2020/12/06 10:31:02 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -71,7 +71,7 @@ __RCSID("$NetBSD: main.c,v 1.75 2019/03/
 
 int	timestamp;		/* print message timestamps */
 int	notify;			/* notify operator flag */
-int	blockswritten;		/* number of blocks written on current tape */
+u_int64_t	blockswritten;	/* number of blocks written on current tape */
 int	tapeno;			/* current tape number */
 int	density;		/* density in bytes/0.1" */
 int	ntrec = NTREC;		/* # tape blocks in each tape record */