]> git.baikalelectronics.ru Git - kernel.git/commit
[XFS] Prevent lockdep false positives when locking two inodes.
authorDavid Chinner <david@fromorbit.com>
Wed, 17 Sep 2008 06:51:21 +0000 (16:51 +1000)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Wed, 17 Sep 2008 06:51:21 +0000 (16:51 +1000)
commit7508ab40e9e35c4b7c3a5ea60ef88cd06851eda5
treecfdb27e38eb600f84a4278744b19e1576ca5e7d3
parentcf957b9b5ba09dd372334b5c3c5d2845ee4c593a
[XFS] Prevent lockdep false positives when locking two inodes.

If we call xfs_lock_two_inodes() to grab both the iolock and the ilock,
then drop the ilocks on both inodes, then grab them again (as
xfs_swap_extents() does) then lockdep will report a locking order problem.
This is a false positive.

To avoid this, disallow xfs_lock_two_inodes() fom locking both inode locks
at once - force calers to make two separate calls. This means that nested
dropping and regaining of the ilocks will retain the same lockdep subclass
and so lockdep will not see anything wrong with this code.

SGI-PV: 986238

SGI-Modid: xfs-linux-melb:xfs-kern:31999a

Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Peter Leckie <pleckie@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/xfs_dfrag.c
fs/xfs/xfs_vnodeops.c