summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2010-12-23 00:38:57 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2010-12-23 00:38:57 +0000
commit84ad0a66d0161562bb8fbce70be7e36f7a74520e (patch)
treeb24395d6bffe994adf1d87eb09f4b5af7465f9ce /sys/ufs
parentf49f3df86a639c46cedbebd7e9218d2c8fbf38f8 (diff)
downloadsrc-test2-84ad0a66d0161562bb8fbce70be7e36f7a74520e.tar.gz
src-test2-84ad0a66d0161562bb8fbce70be7e36f7a74520e.zip
Notes
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 8ed68c329524..3278d6c7b8e3 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -6153,7 +6153,8 @@ indir_trunc(freework, dbn, lbn)
if (jnewblk->jn_lbn > 0)
i = (jnewblk->jn_lbn - -lbn) / lbnadd;
else
- i = (jnewblk->jn_lbn - (lbn + 1)) / lbnadd;
+ i = (-(jnewblk->jn_lbn + level - 1) - -(lbn + level)) /
+ lbnadd;
KASSERT(i >= 0 && i < NINDIR(fs),
("indir_trunc: Index out of range %d parent %jd lbn %jd",
i, lbn, jnewblk->jn_lbn));