summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iget.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-10-06 18:31:23 +0000
committerAlex Elder <aelder@sgi.com>2010-10-18 15:08:01 -0500
commitd276734d937a649ff43fd197d0df7a747bd55b7e (patch)
tree37bfbeb8e20805be02a3770f68232798ba687d3c /fs/xfs/xfs_iget.c
parent1b0407125f9a5be63e861eb27c8af9e32f20619c (diff)
downloadop-kernel-dev-d276734d937a649ff43fd197d0df7a747bd55b7e.zip
op-kernel-dev-d276734d937a649ff43fd197d0df7a747bd55b7e.tar.gz
xfs: fix bogus m_maxagi check in xfs_iget
These days inode64 should only control which AGs we allocate new inodes from, while we still try to support reading all existing inodes. To make this actually work the check ontop of xfs_iget needs to be relaxed to allow inodes in all allocation groups instead of just those that we allow allocating inodes from. Note that we can't simply remove the check - it prevents us from accessing invalid data when fed invalid inode numbers from NFS or bulkstat. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_iget.c')
-rw-r--r--fs/xfs/xfs_iget.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index b1ecc6f..0cdd269 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -365,8 +365,8 @@ xfs_iget(
xfs_perag_t *pag;
xfs_agino_t agino;
- /* the radix tree exists only in inode capable AGs */
- if (XFS_INO_TO_AGNO(mp, ino) >= mp->m_maxagi)
+ /* reject inode numbers outside existing AGs */
+ if (XFS_INO_TO_AGNO(mp, ino) >= mp->m_sb.sb_agcount)
return EINVAL;
/* get the perag structure and ensure that it's inode capable */
OpenPOWER on IntegriCloud