Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e89a5e1 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Linus Torvalds
Browse files

lockdep: fixup the inode dir annotation



A slight oversight tripped lockdep debugging code, each lockdep
class should have but a single init site.

Rearange the code to make this true.

Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e744fdea
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -568,16 +568,16 @@ EXPORT_SYMBOL(new_inode);
void unlock_new_inode(struct inode *inode)
{
#ifdef CONFIG_DEBUG_LOCK_ALLOC
	if (inode->i_mode & S_IFDIR) {
		struct file_system_type *type = inode->i_sb->s_type;

		/*
		 * ensure nobody is actually holding i_mutex
		 */
		mutex_destroy(&inode->i_mutex);
		mutex_init(&inode->i_mutex);
	if (inode->i_mode & S_IFDIR)
		lockdep_set_class(&inode->i_mutex, &type->i_mutex_dir_key);
	else
		lockdep_set_class(&inode->i_mutex, &type->i_mutex_key);
	}
#endif
	/*
	 * This is special!  We do not need the spinlock