NetBSD Problem Report #927
From gnats Thu Mar 30 06:06:57 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.10/8.6.10) with ESMTP id GAA02398 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Thu, 30 Mar 1995 06:06:56 -0800
Message-Id: <9503301407.AA19219@leidecker.gsfc.nasa.gov>
Date: Thu, 30 Mar 95 09:07:04 -0500
From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>
To: gnats-bugs@NetBSD.ORG
Subject: "dump" chokes on huge filesystems
X-Send-Pr-Version: 3.2
>Number: 927
>Category: bin
>Synopsis: "dump" chokes on huge filesystems
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 30 06:20:02 +0000 1995
>Closed-Date: Thu Mar 30 15:30:17 +0000 1995
>Last-Modified:
>Originator: Kenneth Stailey
>Release: NetBSD 1.0A March 18 1995
>Organization:
self
>Environment:
System: NetBSD pluto 1.0A NetBSD 1.0A (PLUTO) #25: Tue Mar 28 13:17:39 EST 1995 ken@pluto:/usr/src/sys/arch/i386/compile/PLUTO i386
>Description:
If you cast a large "long long" into an int you can get a
negative result.
#include <stdio.h>
main()
{
long long ll;
int i;
ll = 5000000000 * 10;
i = (int)ll;
printf("%d\n", i);
}
A comparison in /usr/src/sbin/dump/traverse.c is wreck by this.
>How-To-Repeat:
Run dump on huge filesystem (>8GB?)
>Fix:
*** /usr/src/sbin/dump/traverse.c.orig Tue Jun 14 18:49:57 1994
--- /usr/src/sbin/dump/traverse.c Mon Mar 27 13:10:32 1995
***************
*** 562,568 ****
extern int errno;
loop:
! if ((int)lseek(diskfd, ((off_t)blkno << dev_bshift), 0) < 0)
msg("bread: lseek fails\n");
if ((cnt = read(diskfd, buf, size)) == size)
return;
--- 562,568 ----
extern int errno;
loop:
! if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) < 0)
msg("bread: lseek fails\n");
if ((cnt = read(diskfd, buf, size)) == size)
return;
--JAA00346.796572210/pluto.spacenet.com--
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: mycroft
State-Changed-When: Thu Mar 30 07:30:17 PST 1995
State-Changed-Why:
Already fixed.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.