-$Id: CHANGES,v 1.250 2004/06/17 09:01:13 stelian Exp $
+$Id: CHANGES,v 1.251 2004/07/01 09:14:48 stelian Exp $
Changes between versions 0.4b36 and 0.4b37 (released ??????????????)
====================================================================
preventing dump from crashing when the dumpdates file has
been modified by hand.
+4. Fixed some offset calculations in dump code which could
+ lead to "bread lseek errors" on large filesystems. Thanks
+ to Bruce Lowekamp <lowekamp@users.sourceforge.net> for
+ reporting this bug and debugging the issue.
+
Changes between versions 0.4b35 and 0.4b36 (released April 21, 2004)
====================================================================
-$Id: THANKS,v 1.84 2004/03/29 13:57:28 stelian Exp $
+$Id: THANKS,v 1.85 2004/07/01 09:14:48 stelian Exp $
Dump and restore were written by the people of the CSRG at the University
of California, Berkeley.
Ambrose Li acli@mingpaoxpress.com
Georg Lippold g_lippold@sourceforge.net
Patrick J. LoPresti patl@cag.lcs.mit.edu
+Bruce Lowekamp lowekamp@users.sourceforge.net
Greg Lutz greglutz@ix.netcom.com
Eric Maisonobe virnet@nat.fr
Kai Makisara Kai.Makisara@kolumbus.fi
* Stelian Pop <stelian@popies.net>, 1999-2000
* Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
*
- * $Id: bsdcompat.h,v 1.22 2004/01/27 10:15:37 stelian Exp $
+ * $Id: bsdcompat.h,v 1.23 2004/07/01 09:14:48 stelian Exp $
*/
#include <config.h>
#include <sys/time.h>
#include <dirent.h>
+#include <ext2fs/ext2fs.h>
#define __dead volatile
#define UNUSED(x) x __attribute__ ((unused))
#define powerof2(x) ((((x)-1)&(x))==0)
#endif
-#define fsbtodb(sb,b) ((int)(((long long)(b) * EXT2_BLOCK_SIZE((sb)->super)) / DEV_BSIZE))
+#define fsbtodb(sb,b) ((ext2_loff_t)(((long long)(b) * EXT2_BLOCK_SIZE((sb)->super)) / DEV_BSIZE))
#define dbtofsb(sb,b) ((int)(((long long)(b) * DEV_BSIZE) / EXT2_BLOCK_SIZE((sb)->super)))
#define sblock fs
__u32 di_blocks;
__u32 di_flags;
__u32 di_reserved1;
- daddr_t di_db[NDADDR];
- daddr_t di_ib[NIADDR];
+ __u32 di_db[NDADDR];
+ __u32 di_ib[NIADDR];
__u32 di_gen;
__u32 di_file_acl;
__u32 di_dir_acl;
char di_usymlink[MAXFASTLINK + 1];
} di_un;
#else
- daddr_t di_db[NDADDR];
- daddr_t di_ib[NIADDR];
+ __u32 di_db[NDADDR];
+ __u32 di_ib[NIADDR];
#endif
__s32 di_flags;
__s32 di_blocks;
struct bsdtimeval di_atime;
struct bsdtimeval di_mtime;
struct bsdtimeval di_ctime;
- daddr_t di_db[NDADDR];
- daddr_t di_ib[NIADDR];
+ __u32 di_db[NDADDR];
+ __u32 di_ib[NIADDR];
__u32 di_flags;
__s32 di_blocks;
__s32 di_gen;
* Stelian Pop <stelian@popies.net>, 1999-2000
* Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
*
- * $Id: dumprestore.h,v 1.21 2004/04/13 13:03:55 stelian Exp $
+ * $Id: dumprestore.h,v 1.22 2004/07/01 09:14:49 stelian Exp $
*/
/*
int32_t c_date; /* date of this dump */
int32_t c_ddate; /* date of previous dump */
int32_t c_volume; /* dump volume number */
- daddr_t c_tapea; /* logical block of this record */
+ u_int32_t c_tapea; /* logical block of this record */
dump_ino_t c_inumber; /* number of inode */
int32_t c_magic; /* magic number (see above) */
int32_t c_checksum; /* record checksum */
* Stelian Pop <stelian@popies.net>, 1999-2000
* Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
*
- * $Id: dump.h,v 1.48 2004/04/21 08:55:51 stelian Exp $
+ * $Id: dump.h,v 1.49 2004/07/01 09:14:49 stelian Exp $
*/
/*-
#include <compatlfs.h>
#define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
-#define MAXNINDIR (MAXBSIZE / sizeof(daddr_t))
+#define MAXNINDIR (MAXBSIZE / sizeof(blk_t))
#define NUM_STR_SIZE 32 /* a generic number buffer size */
/*
int mapdirs __P((dump_ino_t maxino, long *tapesize));
/* file dumping routines */
-void blksout __P((daddr_t *blkp, int frags, dump_ino_t ino));
-void bread __P((daddr_t blkno, char *buf, int size));
+void blksout __P((blk_t *blkp, int frags, dump_ino_t ino));
+void bread __P((ext2_loff_t blkno, char *buf, int size));
void dumpino __P((struct dinode *dp, dump_ino_t ino, int metaonly));
#ifdef __linux__
void dumpdirino __P((struct dinode *dp, dump_ino_t ino));
/* tape writing routines */
int alloctape __P((void));
void close_rewind __P((void));
-void dumpblock __P((daddr_t blkno, int size));
+void dumpblock __P((blk_t blkno, int size));
void startnewtape __P((int top));
time_t trewind __P((void));
void writerec __P((const void *dp, int isspcl));
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.84 2004/05/25 10:39:29 stelian Exp $";
+ "$Id: tape.c,v 1.85 2004/07/01 09:14:49 stelian Exp $";
#endif /* not lint */
#include <config.h>
* The following structure defines the instruction packets sent to slaves.
*/
struct req {
- daddr_t dblk;
+ ext2_loff_t dblk;
int count;
};
int reqsiz;
writerec(const void *dp, int isspcl)
{
- slp->req[trecno].dblk = (daddr_t)0;
+ slp->req[trecno].dblk = (ext2_loff_t)0;
slp->req[trecno].count = 1;
/* XXX post increment triggers an egcs-1.1.2-12 bug on alpha/sparc */
*(union u_spcl *)(*(nextblock)) = *(union u_spcl *)dp;
}
void
-dumpblock(daddr_t blkno, int size)
+dumpblock(blk_t blkno, int size)
{
- int avail, tpblks, dblkno;
+ int avail, tpblks;
+ ext2_loff_t dblkno;
dblkno = fsbtodb(sblock, blkno);
tpblks = size >> tp_bshift;
#ifndef lint
static const char rcsid[] =
- "$Id: traverse.c,v 1.60 2004/03/10 16:26:30 stelian Exp $";
+ "$Id: traverse.c,v 1.61 2004/07/01 09:14:49 stelian Exp $";
#endif /* not lint */
#include <config.h>
UNUSED(blk_t ref_block), UNUSED(int ref_offset), void * private)
{
struct block_context *p;
- int i;
+ e2_blkcnt_t i;
if (blockcnt < NDADDR)
return 0;
* Collect up the data into tape record sized buffers and output them.
*/
void
-blksout(daddr_t *blkp, int frags, dump_ino_t ino)
+blksout(blk_t *blkp, int frags, dump_ino_t ino)
{
- daddr_t *bp;
+ blk_t *bp;
int i, j, count, blks, tbperdb;
blks = howmany(frags * sblock->fs_fsize, TP_BSIZE);
int breaderrors = 0;
void
-bread(daddr_t blkno, char *buf, int size)
+bread(ext2_loff_t blkno, char *buf, int size)
{
int cnt, i;
loop:
#ifdef __linux__
- if (ext2fs_llseek(diskfd, (((ext2_loff_t)blkno) << dev_bshift), 0) !=
- (((ext2_loff_t)blkno) << dev_bshift))
+ if (ext2fs_llseek(diskfd, (blkno << dev_bshift), 0) !=
+ (blkno << dev_bshift))
#else
if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) !=
((off_t)blkno << dev_bshift))
memset(buf, 0, size);
for (i = 0; i < size; i += dev_bsize, buf += dev_bsize, blkno++) {
#ifdef __linux__
- if (ext2fs_llseek(diskfd, (((ext2_loff_t)blkno) << dev_bshift), 0) !=
- (((ext2_loff_t)blkno) << dev_bshift))
+ if (ext2fs_llseek(diskfd, (blkno << dev_bshift), 0) !=
+ (blkno << dev_bshift))
#else
if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) !=
((off_t)blkno << dev_bshift))