public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: fix bogus m_maxagi check in xfs_iget
@ 2010-10-06 18:31 Christoph Hellwig
  2010-10-07 19:22 ` Alex Elder
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2010-10-06 18:31 UTC (permalink / raw)
  To: xfs

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>

Index: xfs/fs/xfs/xfs_iget.c
===================================================================
--- xfs.orig/fs/xfs/xfs_iget.c	2010-10-05 10:56:05.749253507 +0200
+++ xfs/fs/xfs/xfs_iget.c	2010-10-06 20:22:36.189003262 +0200
@@ -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 */

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-07 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-06 18:31 [PATCH] xfs: fix bogus m_maxagi check in xfs_iget Christoph Hellwig
2010-10-07 19:22 ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox