Subject: dump doesn't on large filesystems (with fix)
To: None <netbsd-bugs@NetBSD.ORG>
From: Don Winsor <don@eecs.umich.edu>
List: netbsd-bugs
Date: 03/27/1995 13:45:34
"dump" chokes on huge filesystems (I'm using an entire 9 GB disk
as one filesystem).  I tracked it down to an unnecessary and
destructive cast in "traverse.c" that truncates the 64 bit result
of lseek down to 32 bits; the obvious patch to fix it follows.
This is on the i386 architecture, but I suspect this problem
applies to all the platforms.

|  Don Winsor                                                 |
|  Senior Systems Research Programmer and                     |
|  Departmental Computing Organization Coordinator            |
|  Department of Electrical Engineering and Computer Science  |
|  The University of Michigan                                 |
|  1301 Beal Avenue                                           |
|  Ann Arbor, Michigan  48109-2122                            |
|  E-mail:  don@eecs.umich.edu            Fax:  313-763-5520  |



*** /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;