Return-Path: Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id o3MJPaw4227411 for ; Thu, 22 Apr 2010 14:25:36 -0500 Received: from coco.kroah.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D8DDB1057B62 for ; Thu, 22 Apr 2010 12:27:36 -0700 (PDT) Received: from coco.kroah.org (kroah.org [198.145.64.141]) by cuda.sgi.com with ESMTP id IMsBBtlPQcPeEqjn for ; Thu, 22 Apr 2010 12:27:36 -0700 (PDT) Message-Id: <20100422190908.664726284@kvm.kroah.org> Date: Thu, 22 Apr 2010 12:07:45 -0700 From: Greg KH Subject: [014/197] xfs: check for not fully initialized inodes in xfs_ireclaim In-Reply-To: <20100422191857.GA13268@kroah.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, Alex Elder , akpm@linux-foundation.org, xfs@oss.sgi.com, torvalds@linux-foundation.org, Christoph Hellwig , alan@lxorguk.ukuu.org.uk 2.6.32-stable review patch. If anyone has any objections, please let us know. ------------------ From: Christoph Hellwig commit b44b1126279b60597f96bbe77507b1650f88a969 upstream 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 Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_iget.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -511,17 +511,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); _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs