Description: blocks estimate fix, filesys len fix
Author: Tim Woodall <debianbugs@woodall.me.uk>
--- a/dump/traverse.c
+++ b/dump/traverse.c
@@ -189,7 +189,15 @@ blockest(struct dinode const *dp)
 	 *	dump blocks (sizeest vs. blkest in the indirect block
 	 *	calculation).
 	 */
-	blkest = howmany((uint64_t)dp->di_blocks * 512, fs->blocksize) * (fs->blocksize / TP_BSIZE);
+  uint64_t blocks = dp->di_blocks;
+  if (ext2fs_has_feature_huge_file(fs->super)) {
+     blocks += ((long long) dp->osd2.linux2.l_i_blocks_hi) << 32;
+     if (dp->di_flags & EXT4_HUGE_FILE_FL) {
+        blocks *= fs->blocksize / 512;
+     }
+  }
+
+  blkest = howmany(blocks * 512, fs->blocksize) * (fs->blocksize / TP_BSIZE);
 	i_size = dp->di_size + ((uint64_t) dp->di_size_high << 32);
 	sizeest = howmany(i_size, fs->blocksize) * (fs->blocksize / TP_BSIZE);
 	if (blkest > sizeest)
--- a/restore/main.c
+++ b/restore/main.c
@@ -104,7 +104,7 @@ FILE 	*terminal;
 char	*tmpdir;
 int	compare_ignore_not_found;
 int	compare_errors;
-char	filesys[NAMELEN];
+char	filesys[PATH_MAX];
 static const char *stdin_opt = NULL;
 char	*bot_script = NULL;
 dump_ino_t volinfo[TP_NINOS];
@@ -216,8 +216,8 @@ main(int argc, char *argv[])
 			cvtflag = 1;
 			break;
 		case 'D':
-			strncpy(filesys, optarg, NAMELEN);
-			filesys[NAMELEN - 1] = '\0';
+      strncpy(filesys, optarg, sizeof(filesys));
+      filesys[sizeof(filesys) - 1] = '\0';
 			break;
 #ifdef TRANSSELINUX			/*GAN6May06 SELinux MLS */
 		case 'e':
--- a/restore/restore.h
+++ b/restore/restore.h
@@ -88,7 +88,7 @@ extern int	compare_ignore_not_found;
 				/* so messages about "not found" files */
 				/* isn't seen. */
 extern int	compare_errors;	/* did we encounter any compare errors? */
-extern char	filesys[NAMELEN];/* name of dumped filesystem */
+extern char	filesys[PATH_MAX];/* name of dumped filesystem */
 extern dump_ino_t volinfo[];	/* which inode on which volume archive info */
 extern int	wdfd;		/* original working directory */
 extern int	dirhash_size;	/* size of the directory hash table */
