]> err.no Git - linux-2.6/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)
commitf9114eba1eb08ee75fd0f1eee780f0290fb3c043
treecfdb27e38eb600f84a4278744b19e1576ca5e7d3
parentb5b8c9acd547244eb2b7d0280ba38b9dd01971cc
[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