From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Subject: [PATCH] xfs: fix bogus m_maxagi check in xfs_iget
Date: Wed, 6 Oct 2010 14:31:23 -0400 [thread overview]
Message-ID: <20101006183123.GA2166@lst.de> (raw)
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
next reply other threads:[~2010-10-06 18:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-06 18:31 Christoph Hellwig [this message]
2010-10-07 19:22 ` [PATCH] xfs: fix bogus m_maxagi check in xfs_iget Alex Elder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101006183123.GA2166@lst.de \
--to=hch@lst.de \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox