summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iget.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2009-12-01 18:12:29 +0000
committerAlex Elder <aelder@sgi.com>2009-12-16 13:20:15 -0600
commitb44b1126279b60597f96bbe77507b1650f88a969 (patch)
tree220cb8d4903532c2551ee2bdffa03885cdc642ba /fs/xfs/xfs_iget.c
parent5ac4d630eb87656bd4dc313b910776d54d88ea28 (diff)
downloadlinux-b44b1126279b60597f96bbe77507b1650f88a969.tar.gz
linux-b44b1126279b60597f96bbe77507b1650f88a969.tar.bz2
linux-b44b1126279b60597f96bbe77507b1650f88a969.zip
xfs: check for not fully initialized inodes in xfs_ireclaim
Add an assert for inodes not added to the inode cache in xfs_ireclaim, to make sure we're not going to introduce something like the famous nfsd inode cache bug again. 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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index f5c904a10c11..0de36c2a46f1 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -478,17 +478,21 @@ xfs_ireclaim(
{
struct xfs_mount *mp = ip->i_mount;
struct xfs_perag *pag;
+ xfs_agino_t agino = XFS_INO_TO_AGINO(mp, ip->i_ino);
XFS_STATS_INC(xs_ig_reclaims);
/*
- * Remove the inode from the per-AG radix tree. It doesn't matter
- * if it was never added to it because radix_tree_delete can deal
- * with that case just fine.
+ * Remove the inode from the per-AG radix tree.
+ *
+ * Because radix_tree_delete won't complain even if the item was never
+ * added to the tree assert that it's been there before to catch
+ * problems with the inode life time early on.
*/
pag = xfs_get_perag(mp, ip->i_ino);
write_lock(&pag->pag_ici_lock);
- radix_tree_delete(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino));
+ if (!radix_tree_delete(&pag->pag_ici_root, agino))
+ ASSERT(0);
write_unlock(&pag->pag_ici_lock);
xfs_put_perag(mp, pag);