summaryrefslogtreecommitdiffstats
path: root/sys/gnu/ext2fs/ext2_vfsops.c
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-05-18 21:33:07 +0000
committeriedowse <iedowse@FreeBSD.org>2002-05-18 21:33:07 +0000
commit798b0bf42f105e35c6f8eaf7e21a8be6b93fcf09 (patch)
treee759febcd03c2fd4fe7bedecf61f54b915fb5221 /sys/gnu/ext2fs/ext2_vfsops.c
parent75e563ada224bec951cc2c9e71bfa07f63977cb6 (diff)
downloadFreeBSD-src-798b0bf42f105e35c6f8eaf7e21a8be6b93fcf09.zip
FreeBSD-src-798b0bf42f105e35c6f8eaf7e21a8be6b93fcf09.tar.gz
Fix two off-by-one errors when sanity-checking inode numbers. In
ext2fs, inode numbers start at 1, so the maximum valid inode number is (s_inodes_per_group * s_groups_count), not one less. This is just a minimal change to avoid unnecessary panics and errors; some other related bugs that Bruce Evans mentioned to me are not addressed. Reviewed by: bde (ages ago)
Diffstat (limited to 'sys/gnu/ext2fs/ext2_vfsops.c')
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index c506bae..a5cbefc 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -1116,7 +1116,7 @@ ext2_fhtovp(mp, fhp, vpp)
ufhp = (struct ufid *)fhp;
fs = VFSTOEXT2(mp)->um_e2fs;
if (ufhp->ufid_ino < ROOTINO ||
- ufhp->ufid_ino >= fs->s_groups_count * fs->s_es->s_inodes_per_group)
+ ufhp->ufid_ino > fs->s_groups_count * fs->s_es->s_inodes_per_group)
return (ESTALE);
error = VFS_VGET(mp, ufhp->ufid_ino, LK_EXCLUSIVE, &nvp);
OpenPOWER on IntegriCloud