Module Name: src
Committed By: dholland
Date: Sat Aug 29 05:33:20 UTC 2015
Modified Files:
src/usr.sbin/dumplfs: dumplfs.c
Log Message:
Bypass the ifile's double indirect block if the ifile size in blocks
is less than or equal to NDADDR + NINDIR, the number of blocks mapped
without getting to the double indirect block.
The code here was instead using NINDIR * ifpb (ifile entries per
block); this gives the number of ifile entries the indirect block can
map, but that isn't a useful number.
Caught by mlelstv.
To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.sbin/dumplfs/dumplfs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/dumplfs/dumplfs.c
diff -u src/usr.sbin/dumplfs/dumplfs.c:1.54 src/usr.sbin/dumplfs/dumplfs.c:1.55
--- src/usr.sbin/dumplfs/dumplfs.c:1.54 Wed Aug 12 18:28:01 2015
+++ src/usr.sbin/dumplfs/dumplfs.c Sat Aug 29 05:33:20 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: dumplfs.c,v 1.54 2015/08/12 18:28:01 dholland Exp $ */
+/* $NetBSD: dumplfs.c,v 1.55 2015/08/29 05:33:20 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
#if 0
static char sccsid[] = "@(#)dumplfs.c 8.5 (Berkeley) 5/24/95";
#else
-__RCSID("$NetBSD: dumplfs.c,v 1.54 2015/08/12 18:28:01 dholland Exp $");
+__RCSID("$NetBSD: dumplfs.c,v 1.55 2015/08/29 05:33:20 dholland Exp $");
#endif
#endif /* not lint */
@@ -371,7 +371,7 @@ dump_ifile(int fd, struct lfs *lfsp, int
inum = dump_ipage_ifile(lfsp, inum, ipage, lfs_sb_getifpb(lfsp));
}
- if (nblocks <= lfs_sb_getnindir(lfsp) * lfs_sb_getifpb(lfsp))
+ if (nblocks <= ULFS_NDADDR + lfs_sb_getnindir(lfsp))
goto e1;
/* Get the double indirect block */