Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/dumplfs Bypass the ifile's double indirect block if...



details:   https://anonhg.NetBSD.org/src/rev/83ab38105e97
branches:  trunk
changeset: 810393:83ab38105e97
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat Aug 29 05:33:20 2015 +0000

description:
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.

diffstat:

 usr.sbin/dumplfs/dumplfs.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r c2ad6782c06a -r 83ab38105e97 usr.sbin/dumplfs/dumplfs.c
--- a/usr.sbin/dumplfs/dumplfs.c        Sat Aug 29 05:03:36 2015 +0000
+++ b/usr.sbin/dumplfs/dumplfs.c        Sat Aug 29 05:33:20 2015 +0000
@@ -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 @@
 #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 @@
                        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 */



Home | Main Index | Thread Index | Old Index