linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -V4] ext4: Fix lockdep recursive locking warning
@ 2008-11-21 16:40 Aneesh Kumar K.V
  2008-11-21 16:48 ` patchqueue update Aneesh Kumar K.V
  2008-11-22 20:46 ` [PATCH -V4] ext4: Fix lockdep recursive locking warning Theodore Tso
  0 siblings, 2 replies; 7+ messages in thread
From: Aneesh Kumar K.V @ 2008-11-21 16:40 UTC (permalink / raw)
  To: cmm, tytso, sandeen; +Cc: linux-ext4, Aneesh Kumar K.V

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(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 7293209..1fa311c 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
 	{
-- 
1.6.0.4.735.gea4f


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-11-24  5:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-21 16:40 [PATCH -V4] ext4: Fix lockdep recursive locking warning Aneesh Kumar K.V
2008-11-21 16:48 ` patchqueue update Aneesh Kumar K.V
2008-11-22 20:46 ` [PATCH -V4] ext4: Fix lockdep recursive locking warning Theodore Tso
2008-11-23  2:49   ` Theodore Tso
2008-11-23 16:33     ` Aneesh Kumar K.V
2008-11-23 18:32       ` Theodore Tso
2008-11-24  5:02       ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).