Re: XFS reclaim lock order bug

Peter Zijlstra
2010-11-25T10:34:51Z

On Thu, 2010-11-25 at 21:29 +1100, Dave Chinner wrote:

> > In that case though, it would suggest the inode got re-used instead of
> > destroyed and re-created using xfs_alloc_inode(), is that at all
> > possible?
>
> Yes, actually it is - see the XFS_IRECLAIMABLE case in
> xfs_iget_cache_hit(). I guess we haven't seen the original lock
> inversion false positives that this was supposed to fix because the
> reclaim warnings trip first...
>
> I think that means we also need to reinitialise the lock when we recycle
> the inode out of the XFS_IRECLAIMABLE state.

Right, in which case you probably want an explicit lock class and use
that one class in both xfs_alloc_inode() and the reclaim case.

See my earlier suggestion wrt lockdep_set_class*() on how to do that.