Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Oct 1996 23:48:09 +0200 (MET DST)
From:      Tor Egge <tegge@itea.ntnu.no>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1789: dump estimates a negative number of tapes needed for huge dumps
Message-ID:  <199610132148.XAA02104@skarven.itea.ntnu.no>
Resent-Message-ID: <199610132150.OAA07681@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1789
>Category:       bin
>Synopsis:       dump estimates a negative number of tapes needed for huge dumps
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 13 14:50:01 PDT 1996
>Last-Modified:
>Originator:     Tor Egge
>Organization:
Norwegian University of Science and Technology, Trondheim, Norway

>Release:        FreeBSD 2.2-CURRENT i386
>Environment:

FreeBSD skarven.itea.ntnu.no 2.2-CURRENT FreeBSD 2.2-CURRENT #0: Fri Oct 11 23:58:42  1996     root@skarven.itea.ntnu.no:/usr/src/sys/compile/SKARVEN  i386

>Description:

skarven# df -k /export/ftpsearch1 
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/sd2a     4175707  3352892   697544    83%    /export/ftpsearch1
skarven# dump 0f /dev/null /dev/rsd2a
  DUMP: Date of this level 0 dump: Sun Oct 13 23:16:13 1996
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rsd2a (/export/ftpsearch1) to /dev/null
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 3355778 tape blocks on -10.93 tape(s).
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
[...]

>How-To-Repeat:

	dump a big filesystem (more than 2 GB used).

>Fix:
	
	cast tapesize to double in the expression that
	calculates fetapes to avoid wraparound.

Index: main.c
===================================================================
RCS file: /export/ftpsearch3/cvs/src/sbin/dump/main.c,v
retrieving revision 1.7
diff -u -r1.7 main.c
--- main.c	1996/09/14 02:57:39	1.7
+++ main.c	1996/10/13 21:40:12
@@ -368,7 +368,7 @@
 			   Assume no erroneous blocks; this can be compensated
 			   for with an artificially low tape size. */
 			fetapes =
-			(	  tapesize	/* blocks */
+			(	  (double) tapesize	/* blocks */
 				* TP_BSIZE	/* bytes/block */
 				* (1.0/density)	/* 0.1" / byte " */
 			  +
@@ -381,7 +381,7 @@
 			   tape */
 			int tenthsperirg = (density == 625) ? 3 : 7;
 			fetapes =
-			(	  tapesize	/* blocks */
+			(	  (double) tapesize	/* blocks */
 				* TP_BSIZE	/* bytes / block */
 				* (1.0/density)	/* 0.1" / byte " */
 			  +


>Audit-Trail:
>Unformatted:



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