-$Id: CHANGES,v 1.110 2001/04/10 13:42:21 stelian Exp $
+$Id: CHANGES,v 1.111 2001/04/11 13:42:52 stelian Exp $
Changes between versions 0.4b21 and 0.4b22 (released ????????????????)
======================================================================
in a single invocation of dump. Thanks to Uwe Gohlke
<uwe@ugsoft.de> for implementing this option.
+9. Fixed the dumping and restoring of files with holes
+ (files ending with holes didn't get dumped or restored
+ correctly).
+
Changes between versions 0.4b20 and 0.4b21 (released January 13, 2001)
======================================================================
#ifndef lint
static const char rcsid[] =
- "$Id: traverse.c,v 1.32 2001/04/10 13:42:22 stelian Exp $";
+ "$Id: traverse.c,v 1.33 2001/04/11 13:42:52 stelian Exp $";
#endif /* not lint */
#include <config.h>
dumpino(struct dinode *dp, dump_ino_t ino)
{
unsigned long cnt;
- fsizeT size;
+ fsizeT size, remaining;
char buf[TP_BSIZE];
struct old_bsd_inode obi;
+ int i;
#ifdef __linux__
struct block_context bc;
#else
bc.next_block = NDADDR;
ext2fs_block_iterate2(fs, (ext2_ino_t)ino, 0, NULL, dumponeblock, (void *)&bc);
+ /* deal with holes at the end of the inode */
+ remaining = i_size - bc.next_block*sblock->fs_fsize;
+ if (remaining > 0)
+ for (i = 0; i < howmany(remaining, sblock->fs_fsize); i++) {
+ bc.buf[bc.cnt++] = 0;
+ if (bc.cnt == bc.max) {
+ blksout (bc.buf, bc.cnt, bc.ino);
+ bc.cnt = 0;
+ }
+ }
if (bc.cnt > 0) {
blksout (bc.buf, bc.cnt, bc.ino);
}
#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.32 2001/04/10 12:46:53 stelian Exp $";
+ "$Id: tape.c,v 1.33 2001/04/11 13:42:52 stelian Exp $";
#endif /* not lint */
#include <config.h>
(*fill)((char *)buf, (size_t)(curblk * TP_BSIZE) + size);
last_write_was_hole = 0;
}
+ if (size > 0) {
+ fprintf(stderr, "Missing blocks at the end of %s, assuming hole\n", curfile.name);
+ (*skip)(clearedbuf, size);
+ last_write_was_hole = 1;
+ }
if (last_write_was_hole) {
ftruncate(ofile, origsize);
}