Re: [PATCH] xfs: provide a inode iolock lockdep class

Christoph Hellwig
2010-12-15T12:16:19Z

On Mon, Dec 13, 2010 at 12:07:11PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> The XFS iolock needs to be re-initialised to a new lock class before
> it enters reclaim to prevent lockdep false positives. Unfortunately,
> this is not sufficient protection as inodes in the XFS_IRECLAIMABLE
> state can be recycled and not re-initialised before being reused.
>
> We need to re-initialise the lock state when transfering out of
> XFS_IRECLAIMABLE state to XFS_INEW, but we need to keep the same
> class as if the inode was just allocated. Hence we need a specific
> lockdep class variable for the iolock so that both initialisations
> use the same class.
>
> While there, add a specific class for inodes in the reclaim state so
> that it is easy to tell from lockdep reports what state the inode
> was in that generated the report.

Looks good to me. As long as we have the mrlock abstraction we might as
well hide this behind it, but as I plan on killing the abstraction
that's probably not worth the effort.

Reviewed-by: Christoph Hellwig <hch@lst.de>