Re: [REGRESSION 2.6-git] possible circular locking dependency detected with XFS

Previous thread: [PATCH] x86-64: disable the GART before allocate aperture by Yinghai Lu on Friday, June 22, 2007 - 12:19 pm. (41 messages)

Next thread: [PATCH 1/7] ICH Force HPET: Make generic time capable of switching broadcast timer by Venki Pallipadi on Friday, June 22, 2007 - 1:38 pm. (15 messages)
From: Oliver Pinter
Date: Friday, June 22, 2007 - 1:40 pm

Hi all!

I found this info:

=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.22-rc5-wifi1 #2
-------------------------------------------------------
mount/2209 is trying to acquire lock:
 (&(&ip->i_lock)->mr_lock/1){--..}, at: [<c022b62d>] xfs_ilock+0x66/0x90

but task is already holding lock:
 (&(&ip->i_lock)->mr_lock){----}, at: [<c022b62d>] xfs_ilock+0x66/0x90

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&(&ip->i_lock)->mr_lock){----}:
       [<c013c078>] __lock_acquire+0xe6d/0x1016
       [<c022b62d>] xfs_ilock+0x66/0x90
       [<c013acf7>] trace_hardirqs_on+0xb6/0x156
       [<c013c289>] lock_acquire+0x68/0x82
       [<c022b62d>] xfs_ilock+0x66/0x90
       [<c0133087>] down_write_nested+0x3b/0x55
       [<c022b62d>] xfs_ilock+0x66/0x90
       [<c022b62d>] xfs_ilock+0x66/0x90
       [<c022c0aa>] xfs_iget_core+0x401/0x6d9
       [<c022c456>] xfs_iget+0xd4/0x15e
       [<c024598e>] xfs_trans_iget+0xf5/0x167
       [<c023018f>] xfs_ialloc+0xb5/0x53f
       [<c0246425>] xfs_dir_ialloc+0x79/0x2c4
       [<c0133087>] down_write_nested+0x3b/0x55
       [<c024c91e>] xfs_create+0x376/0x690
       [<c0257796>] xfs_vn_mknod+0x210/0x339
       [<c017694f>] vfs_create+0xbd/0x140
       [<c0179b2a>] open_namei+0x640/0x693
       [<c016e2c4>] do_filp_open+0x25/0x40
       [<c052e4f7>] _spin_unlock+0x14/0x1c
       [<c016e0a4>] get_unused_fd+0xaa/0xbb
       [<c016e31d>] do_sys_open+0x3e/0xc2
       [<c016e3dc>] sys_open+0x1c/0x20
       [<c01026ce>] sysenter_past_esp+0x5f/0x99
       [<ffffffff>] 0xffffffff

-> #0 (&(&ip->i_lock)->mr_lock/1){--..}:
       [<c013963f>] print_circular_bug_entry+0x40/0x47
       [<c013beca>] __lock_acquire+0xcbf/0x1016
       [<c0238745>] xlog_grant_log_space+0x21e/0x243
       [<c013c289>] lock_acquire+0x68/0x82
       [<c022b62d>] xfs_ilock+0x66/0x90
       [<c0133087>] down_write_nested+0x3b/0x55
       ...
From: Oliver Pinter
Date: Friday, June 22, 2007 - 1:47 pm

oh, the version is: 2.6.22-rc5-0864a4e
-

From: Michal Piotrowski
Date: Friday, June 22, 2007 - 3:53 pm

Hi Oliver,


AFAIR it is not a regression. It is a known bug (harmless).

Regards,
Michal

-- 
LOG
http://www.stardust.webpages.pl/log/
-

From: David Chinner
Date: Sunday, June 24, 2007 - 4:22 pm

FWIW, it's not even a bug. The bug (if any) is due to the fact we
can't properly express the XFS locking rules with lockdep. We
recently added a bunch of notations that fixed the common false
positives we were seeing, but as a result, it appears we now have a
whole new set of false positive reports coming in that are even
harder to fix.

As Christoph Hellwig has previously noted, the correct way to fix
this in XFS is to completely change the locking within XFS directory
operations to do strict parent/child locking like the VFS does.
Unfortunately, that's not as simple as it sounds, because inode
flushing and log tail pushing rely on inodes being locked in
ascending inode order to prevent deadlocks within XFS. 

That means when we lock multiple inodes in link, rename, etc, we
have to lock them in ascending order. The exception to this is
create, mkdir, mknod because the newly created inode will not be
locked by definition so it is always safe to lock it.

Hence if the new inode's number is less than the parent inode's
number we can get lockdep warning about circular locking
dependencies which don't actually exist. That is where this warning
is coming from....

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group
-

Previous thread: [PATCH] x86-64: disable the GART before allocate aperture by Yinghai Lu on Friday, June 22, 2007 - 12:19 pm. (41 messages)

Next thread: [PATCH 1/7] ICH Force HPET: Make generic time capable of switching broadcast timer by Venki Pallipadi on Friday, June 22, 2007 - 1:38 pm. (15 messages)