summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorrumble <rumble@NetBSD.org>2007-07-04 20:20:30 +0000
committerrumble <rumble@NetBSD.org>2007-07-04 20:20:30 +0000
commit0bbb4e920d6c9fbda51f08e89dda22a1d8deabc4 (patch)
treee13778e3c5098daf89b11205429ddddd16fd1391 /sys
parent96deb6cebdc666550a998f13ceca6deff7679924 (diff)
Clamp down tigher on the bound around 'numextents'. Add a few comments
to make it clearer what we're tracking.
Diffstat (limited to 'sys')
-rw-r--r--sys/fs/efs/efs_subr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/fs/efs/efs_subr.c b/sys/fs/efs/efs_subr.c
index 4affba0407f..b0cfa0b2f15 100644
--- a/sys/fs/efs/efs_subr.c
+++ b/sys/fs/efs/efs_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: efs_subr.c,v 1.2 2007/07/04 19:24:09 rumble Exp $ */
+/* $NetBSD: efs_subr.c,v 1.3 2007/07/04 20:20:30 rumble Exp $ */
/*
* Copyright (c) 2006 Stephen M. Rumble <rumble@ephemeral.org>
@@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: efs_subr.c,v 1.2 2007/07/04 19:24:09 rumble Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efs_subr.c,v 1.3 2007/07/04 20:20:30 rumble Exp $");
#include <sys/param.h>
#include <sys/kauth.h>
@@ -496,10 +496,12 @@ efs_extent_iterator_init(struct efs_extent_iterator *exi, struct efs_inode *eip,
break;
}
+ /* number of extents prior to this indirect vector of extents */
next += numextents;
+ /* number of extents within this indirect vector of extents */
numextents = ex.ex_length * EFS_EXTENTS_PER_BB;
- numextents = MIN(numextents, eip->ei_numextents);
+ numextents = MIN(numextents, eip->ei_numextents - next);
}
/*