Fixed the way dump reports the remaining percent/time, if the number of blocks actually dumped exceeds the estimated number of blocks.
-$Id: CHANGES,v 1.41 2000/02/08 12:22:42 stelian Exp $
+$Id: CHANGES,v 1.42 2000/02/10 09:42:32 stelian Exp $
Changes between versions 0.4b13 and 0.4b14 (released ????????????????)
======================================================================
having the immutable or append-only attribute set. Thanks to
Ambrose Li <acli@mingpaoxpress.com> for submitting the patch.
+7. Fixed a compatibility problem between dumps made on little
+ endian machines (the format was correct) and big endian
+ machines (the format was incorrect). This fix break the
+ compatibility with the older dumps made on big endian
+ machines (sparc, m86k, ppc etc). For the first time in
+ linux dump's history (I believe), the dumps made by *BSD,
+ Linux/alpha, Linux/sparc and Linux/x86 are compatible,
+ so interchangeable. Thanks to Rob Cermak
+ <cermak@ahab.rutgers.edu> for submitting the bug and
+ helping me test the fix.
+
+8. Fixed the way dump reports the remaining percent/time, if
+ the number of blocks actually dumped exceeds the estimated
+ number of blocks. Thanks to Jean-Paul van der Jagt
+ <jeanpaul@dutepp0.et.tudelft.nl> for reporting the bug.
+
Changes between versions 0.4b12 and 0.4b13 (released January 21, 2000)
======================================================================
-$Id: THANKS,v 1.20 2000/02/08 12:35:07 stelian Exp $
+$Id: THANKS,v 1.21 2000/02/10 09:42:32 stelian Exp $
Dump and restore were written by the people of the CSRG at the University
of California, Berkeley.
Jason Fearon jasonf@netrider.org.au
Jeremy Fitzhardinge jeremy@goop.org
Eirik Fuller eirik@netcom.com
+Jean-Paul van der Jagt jeanpaul@dutepp0.et.tudelft.nl
Eric Jergensen eric@dvns.com
Henry Katz hkatz@hkatz.dialup.access.net
Klaus Kudielka kkudielk@cacofonix.nt.tuwien.ac.at
* Remy Card <card@Linux.EU.Org>, 1994-1997
* Stelian Pop <pop@cybercable.fr>, 1999-2000
*
- * $Id: bsdcompat.h,v 1.9 2000/01/21 10:17:41 stelian Exp $
+ * $Id: bsdcompat.h,v 1.10 2000/02/10 09:42:32 stelian Exp $
*/
#include <config.h>
#define d_fileno d_ino
#endif
-struct direct {
+/*
+ * This is the direct structure used by dump. In needs to be
+ * different from direct because linux dump generates only
+ * 'old inode format' dumps. And BSD supposes that the old
+ * inode dumps have the d_namelen field written in machine byte
+ * order...
+ */
+struct olddirect {
__u32 d_ino;
__u16 d_reclen;
-#if 1
- __u8 d_namlen;
- __u8 d_type;
-#else
__u16 d_namlen;
-#endif
- char d_name[MAXNAMLEN + 1];
+ char d_name[MAXNAMLEN + 1];
};
+/*
+ * The direct structure used by restore.
+ */
+struct direct {
+ __u32 d_ino;
+ __u16 d_reclen;
+ __u8 d_type;
+ __u8 d_namlen;
+ char d_name[MAXNAMLEN + 1];
+};
/*
* Convert between stat structure types and directory types.
*/
#ifndef lint
static const char rcsid[] =
- "$Id: optr.c,v 1.9 2000/01/26 11:38:08 stelian Exp $";
+ "$Id: optr.c,v 1.10 2000/02/10 09:42:32 stelian Exp $";
#endif /* not lint */
#include <sys/param.h>
tschedule = tnow + 300;
if (blockswritten < 500)
return;
+ if (blockswritten > tapesize)
+ tapesize = blockswritten;
deltat = tstart_writing - tnow +
(1.0 * (tnow - tstart_writing))
/ blockswritten * tapesize;
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.11 2000/01/21 10:17:41 stelian Exp $";
+ "$Id: tape.c,v 1.12 2000/02/10 09:42:32 stelian Exp $";
#endif /* not lint */
#ifdef __linux__
#else
(void) time((time_t *) &tnow);
#endif
+ if (blockswritten > tapesize)
+ tapesize = blockswritten;
deltat = tstart_writing - tnow + (1.0 * (tnow - tstart_writing))
/ blockswritten * tapesize;
(void)snprintf(msgbuf, sizeof(msgbuf),
#ifndef lint
static const char rcsid[] =
- "$Id: traverse.c,v 1.15 2000/02/04 20:22:21 stelian Exp $";
+ "$Id: traverse.c,v 1.16 2000/02/10 09:42:32 stelian Exp $";
#endif /* not lint */
#include <sys/param.h>
convert_dir(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, void *private)
{
struct convert_dir_context *p;
- struct direct *dp;
+ struct olddirect *dp;
int reclen;
p = (struct convert_dir_context *)private;
reclen = EXT2_DIR_REC_LEN((dirent->name_len & 0xFF) + 1);
if (((p->offset + reclen - 1) / p->bs) != (p->offset / p->bs)) {
- dp = (struct direct *)(p->buf + p->prev_offset);
+ dp = (struct olddirect *)(p->buf + p->prev_offset);
dp->d_reclen += p->bs - (p->offset % p->bs);
p->offset += p->bs - (p->offset % p->bs);
}
- dp = (struct direct *)(p->buf + p->offset);
+ dp = (struct olddirect *)(p->buf + p->offset);
dp->d_ino = dirent->inode;
dp->d_reclen = reclen;
- dp->d_type = 0;
dp->d_namlen = dirent->name_len & 0xFF;
strncpy(dp->d_name, dirent->name, dp->d_namlen);
dp->d_name[dp->d_namlen] = '\0';
#ifndef lint
static const char rcsid[] =
- "$Id: dirs.c,v 1.7 2000/01/21 10:17:41 stelian Exp $";
+ "$Id: dirs.c,v 1.8 2000/02/10 09:42:32 stelian Exp $";
#endif /* not lint */
#include <sys/param.h>
if (Bcvt)
swabst((u_char *)"is", (u_char *) dp);
if (oldinofmt && dp->d_ino != 0) {
-#ifdef __linux__
- if (Bcvt)
- swabst((u_char *)"s", (u_char *)&dp->d_namlen);
-#else
# if BYTE_ORDER == BIG_ENDIAN
if (Bcvt)
dp->d_namlen = dp->d_type;
if (!Bcvt)
dp->d_namlen = dp->d_type;
# endif
-#endif /* __linux__ */
dp->d_type = DT_UNKNOWN;
}
-#ifdef __linux__
- /*
- * Horrible hack to read FreeBSD 2.0 dumps
- */
- if (!oldinofmt)
- swabst((u_char *)"6bs", (u_char *) dp);
-#endif /* __linux__ */
#ifdef DIRDEBUG
printf ("reclen = %d, namlen = %d, type = %d\n",
dp->d_reclen, dp->d_namlen, dp->d_type);