]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: validate inumber in xfs_iget
authorDarrick J. Wong <djwong@kernel.org>
Tue, 9 Jul 2024 14:17:56 +0000 (07:17 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 31 Jul 2024 01:46:45 +0000 (18:46 -0700)
Actually use the inumber validator to check the argument passed in here.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/inode.c

index 2062ecf54486cffcbd84818b0faeee53f26500b4..9230ad24a5cb6c00a7773b8c53f10ad9527e827b 100644 (file)
@@ -143,7 +143,7 @@ libxfs_iget(
        int                     error = 0;
 
        /* reject inode numbers outside existing AGs */
-       if (!ino || XFS_INO_TO_AGNO(mp, ino) >= mp->m_sb.sb_agcount)
+       if (!xfs_verify_ino(mp, ino))
                return -EINVAL;
 
        ip = kmem_cache_zalloc(xfs_inode_cache, 0);