diff mbox

[RFC,-V3,9/9] ext4: Fix lockdep recursive locking warning

Message ID 20081107162211.GN25194@skywalker
State Superseded, archived
Headers show

Commit Message

Aneesh Kumar K.V Nov. 7, 2008, 4:22 p.m. UTC
On Fri, Nov 07, 2008 at 04:04:40PM +0800, Li Zefan wrote:
> I got compile error on IA64:
> 
> fs/ext4/mballoc.c: In function ‘ext4_mb_add_groupinfo’:
> fs/ext4/mballoc.c:2482: error: implicit declaration of function ‘__init_rwsem’
> 
> 

Can you try this patch. I guess IA64 doesn't support lockdep

ext4: Fix lockdep recursive locking warning

From: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Indicate that the group locks can be taken in loop.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 fs/ext4/mballoc.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Li Zefan Nov. 8, 2008, 1:21 a.m. UTC | #1
Aneesh Kumar K.V wrote:
> On Fri, Nov 07, 2008 at 04:04:40PM +0800, Li Zefan wrote:
>> I got compile error on IA64:
>>
>> fs/ext4/mballoc.c: In function ‘ext4_mb_add_groupinfo’:
>> fs/ext4/mballoc.c:2482: error: implicit declaration of function ‘__init_rwsem’
>>
>>
> 
> Can you try this patch. I guess IA64 doesn't support lockdep
> 

Yes, it's not supported on IA64.

> ext4: Fix lockdep recursive locking warning
> 

I manually did the same as this patch yesterday, and I've confirmed the
patch past compile.

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index f58de20..cb0ccbe 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2413,6 +2413,9 @@  ext4_mb_store_history(struct ext4_allocation_context *ac)
 #define ext4_mb_history_init(sb)
 #endif
 
+#ifdef CONFIG_LOCKDEP
+static struct lock_class_key alloc_sem_key[NR_BG_LOCKS];
+#endif
 
 /* Create and initialize ext4_group_info data for the given group. */
 int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group,
@@ -2473,8 +2476,14 @@  int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group,
 	}
 
 	INIT_LIST_HEAD(&meta_group_info[i]->bb_prealloc_list);
-	init_rwsem(&meta_group_info[i]->alloc_sem);
+#ifdef CONFIG_LOCKDEP
+	__init_rwsem(&meta_group_info[i]->alloc_sem,
+			"&meta_group_info[i]->alloc_sem",
+			&alloc_sem_key[i]);
 	meta_group_info[i]->bb_free_root.rb_node = NULL;;
+#else
+	init_rwsem(&meta_group_info[i]->alloc_sem);
+#endif
 
 #ifdef DOUBLE_CHECK
 	{