diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2009-02-10 11:14:34 -0500 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 2009-02-10 11:14:34 -0500 |
commit | ba4439165f0f0d25b2fe065cf0c1ff8130b802eb (patch) | |
tree | 242f9aa5cc4fe0ca7d3062aa0a7ec713a4346bb8 | |
parent | 7be2baaa0322c59ba888aa5260a8c130666acd41 (diff) |
ext4: Fix lockdep warning
We should not call ext4_mb_add_n_trim while holding alloc_semp.
=============================================
[ INFO: possible recursive locking detected ]
2.6.29-rc4-git1-dirty #124
---------------------------------------------
ffsb/3116 is trying to acquire lock:
(&meta_group_info[i]->alloc_sem){----}, at: [<ffffffff8035a6e8>]
ext4_mb_load_buddy+0xd2/0x343
but task is already holding lock:
(&meta_group_info[i]->alloc_sem){----}, at: [<ffffffff8035a6e8>]
ext4_mb_load_buddy+0xd2/0x343
http://bugzilla.kernel.org/show_bug.cgi?id=12672
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | fs/ext4/mballoc.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index deba54f6cbed..c962d0690505 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -4476,23 +4476,26 @@ static int ext4_mb_release_context(struct ext4_allocation_context *ac) | |||
4476 | pa->pa_free -= ac->ac_b_ex.fe_len; | 4476 | pa->pa_free -= ac->ac_b_ex.fe_len; |
4477 | pa->pa_len -= ac->ac_b_ex.fe_len; | 4477 | pa->pa_len -= ac->ac_b_ex.fe_len; |
4478 | spin_unlock(&pa->pa_lock); | 4478 | spin_unlock(&pa->pa_lock); |
4479 | /* | ||
4480 | * We want to add the pa to the right bucket. | ||
4481 | * Remove it from the list and while adding | ||
4482 | * make sure the list to which we are adding | ||
4483 | * doesn't grow big. | ||
4484 | */ | ||
4485 | if (likely(pa->pa_free)) { | ||
4486 | spin_lock(pa->pa_obj_lock); | ||
4487 | list_del_rcu(&pa->pa_inode_list); | ||
4488 | spin_unlock(pa->pa_obj_lock); | ||
4489 | ext4_mb_add_n_trim(ac); | ||
4490 | } | ||
4491 | } | 4479 | } |
4492 | ext4_mb_put_pa(ac, ac->ac_sb, pa); | ||
4493 | } | 4480 | } |
4494 | if (ac->alloc_semp) | 4481 | if (ac->alloc_semp) |
4495 | up_read(ac->alloc_semp); | 4482 | up_read(ac->alloc_semp); |
4483 | if (pa) { | ||
4484 | /* | ||
4485 | * We want to add the pa to the right bucket. | ||
4486 | * Remove it from the list and while adding | ||
4487 | * make sure the list to which we are adding | ||
4488 | * doesn't grow big. We need to release | ||
4489 | * alloc_semp before calling ext4_mb_add_n_trim() | ||
4490 | */ | ||
4491 | if (pa->pa_linear && likely(pa->pa_free)) { | ||
4492 | spin_lock(pa->pa_obj_lock); | ||
4493 | list_del_rcu(&pa->pa_inode_list); | ||
4494 | spin_unlock(pa->pa_obj_lock); | ||
4495 | ext4_mb_add_n_trim(ac); | ||
4496 | } | ||
4497 | ext4_mb_put_pa(ac, ac->ac_sb, pa); | ||
4498 | } | ||
4496 | if (ac->ac_bitmap_page) | 4499 | if (ac->ac_bitmap_page) |
4497 | page_cache_release(ac->ac_bitmap_page); | 4500 | page_cache_release(ac->ac_bitmap_page); |
4498 | if (ac->ac_buddy_page) | 4501 | if (ac->ac_buddy_page) |