[Top] [All Lists]

Re: assertion failed in xfs_reclaim_inodes_ag()

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: assertion failed in xfs_reclaim_inodes_ag()
From: Lachlan McIlroy <lachlan@xxxxxxx>
Date: Wed, 19 Nov 2008 13:18:37 +1100
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <20081118135356.GA21792@xxxxxxxxxxxxx>
References: <49221D83.6030406@xxxxxxx> <20081118133844.GA17894@xxxxxxxxxxxxx> <20081118135356.GA21792@xxxxxxxxxxxxx>
Reply-to: lachlan@xxxxxxx
User-agent: Thunderbird (X11/20080914)
Christoph Hellwig wrote:
On Tue, Nov 18, 2008 at 08:38:44AM -0500, Christoph Hellwig wrote:
On Tue, Nov 18, 2008 at 12:42:27PM +1100, Lachlan McIlroy wrote:
Hit this while running stress tests.  Looks like an inode is tagged with
how that can happen.
Looks it's xfs_iget_cache_hit when the inode is marked XFS_IRECLAIMABLE,
in that case we first clear XFS_IRECLAIMABLE and then call
__xfs_inode_clear_reclaim_tag, and all that under
read_lock(&pag->pag_ici_lock) only, so no protection against the assert
in xfs_reclaim_inodes_ag.
Oh, of course.  I thought I found the problem but then saw the pag_ici_lock
was held in xfs_iget_cache_hit - I didn't realise it was only in read mode.
I assumed that if we are changing the state of the inode we would at least
have some lock exclusive.

And the easiest fix is to just remove the assert, xfs_reclaim_inode does
the right thing (bail out) if XFS_IRECLAIMABLE is not set, and it does
so with the correct locks.  The more complicated fix would be to take
the pag_ici_lock in write more from the very beginning in
xfs_reclaim_inodes_ag, and open-code a variant of xfs_reclaim_inode

Thanks.  I'll just remove the assert.

<Prev in Thread] Current Thread [Next in Thread>