]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: only take the ILOCK in xfs_reclaim_inode()
authorAlex Elder <elder@dreamhost.com>
Thu, 16 Feb 2012 22:01:00 +0000 (22:01 +0000)
committerBen Myers <bpm@sgi.com>
Sat, 25 Feb 2012 19:55:49 +0000 (13:55 -0600)
commit96b49c25f7afc4324ac0af0d9b3b3e43ec2a6fdd
treec4512d9553696d9d5e36e40a909c3f7dabdcb1fb
parent46856c5987c8e2fde4f74e2afa2c177c87a2e3d5
xfs: only take the ILOCK in xfs_reclaim_inode()

At the end of xfs_reclaim_inode(), the inode is locked in order to
we wait for a possible concurrent lookup to complete before the
inode is freed.  This synchronization step was taking both the ILOCK
and the IOLOCK, but the latter was causing lockdep to produce
reports of the possibility of deadlock.

It turns out that there's no need to acquire the IOLOCK at this
point anyway.  It may have been required in some earlier version of
the code, but there should be no need to take the IOLOCK in
xfs_iget(), so there's no (longer) any need to get it here for
synchronization.  Add an assertion in xfs_iget() as a reminder
of this assumption.

Dave Chinner diagnosed this on IRC, and Christoph Hellwig suggested
no longer including the IOLOCK.  I just put together the patch.

Signed-off-by: Alex Elder <elder@dreamhost.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_iget.c
fs/xfs/xfs_sync.c