summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorkensmith <kensmith@FreeBSD.org>2007-12-01 13:12:43 +0000
committerkensmith <kensmith@FreeBSD.org>2007-12-01 13:12:43 +0000
commit66cb6fd44ff21e07a7d299fd9bd7f12a2eda783d (patch)
tree84e71e8a2d59820fa8f85089c4aac768766bd662 /sys/ufs
parenta99deb6b596413f30323f0774863ec96fc17db71 (diff)
downloadFreeBSD-src-66cb6fd44ff21e07a7d299fd9bd7f12a2eda783d.zip
FreeBSD-src-66cb6fd44ff21e07a7d299fd9bd7f12a2eda783d.tar.gz
Fix a broken check that recently became more annoying because it now
gets enabled when INVARIANTS is on instead of DIAGNOSTIC (which apparently nobody uses). From Tor's description: This happens when the block range spans two block maps, the first in the inode (mapping up to NDADDR direct blocks) and the second being the first indirect block. The current check assumes that both block maps are indirect blocks. Work done by: tegge Tested by: kris, kensmith
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 4e51d79..2c9fdd6 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -553,7 +553,8 @@ ffs_reallocblks_ufs1(ap)
ssize = len;
} else {
#ifdef INVARIANTS
- if (start_ap[start_lvl-1].in_lbn == idp->in_lbn)
+ if (start_lvl > 0 &&
+ start_ap[start_lvl - 1].in_lbn == idp->in_lbn)
panic("ffs_reallocblk: start == end");
#endif
ssize = len - (idp->in_off + 1);
@@ -760,7 +761,8 @@ ffs_reallocblks_ufs2(ap)
ssize = len;
} else {
#ifdef INVARIANTS
- if (start_ap[start_lvl-1].in_lbn == idp->in_lbn)
+ if (start_lvl > 0 &&
+ start_ap[start_lvl - 1].in_lbn == idp->in_lbn)
panic("ffs_reallocblk: start == end");
#endif
ssize = len - (idp->in_off + 1);
OpenPOWER on IntegriCloud