[git pull] lockdep for v2.6.24

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Tuesday, October 16, 2007 - 12:23 pm

Linus,

please re-pull

  git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git v2.6.24-lockdep

[ I just commited the two new patches to the end of the branch you
  pulled before, and assumed git will be smart enough to not try and
  again merge the patches you pulled before ]

in order to receive:

Peter Zijlstra (2):
      lockdep: fixup the inode dir annotation
      lockdep: fix fault vs irq tracing

 arch/x86/mm/fault_32.c |   10 ++++++++++
 arch/x86/mm/fault_64.c |   10 ++++++++++
 fs/inode.c             |   18 +++++++++---------
 3 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c
index fcb38e7..c0cba93 100644
--- a/arch/x86/mm/fault_32.c
+++ b/arch/x86/mm/fault_32.c
@@ -308,6 +308,16 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs,
 	int write, si_code;
 	int fault;
 
+#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
+	/*
+	 * We can fault from pretty much anywhere, fix up the IRQ state.
+	 */
+	if (raw_irqs_disabled())
+		trace_hardirqs_off();
+	else
+		trace_hardirqs_on();
+#endif
+
 	/* get the address */
         address = read_cr2();
 
diff --git a/arch/x86/mm/fault_64.c b/arch/x86/mm/fault_64.c
index 54816ad..162bddd 100644
--- a/arch/x86/mm/fault_64.c
+++ b/arch/x86/mm/fault_64.c
@@ -311,6 +311,16 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
 	unsigned long flags;
 	siginfo_t info;
 
+#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
+	/*
+	 * We can fault from pretty much anywhere, fix up the IRQ state.
+	 */
+	if (raw_irqs_disabled())
+		trace_hardirqs_off();
+	else
+		trace_hardirqs_on();
+#endif
+
 	tsk = current;
 	mm = tsk->mm;
 	prefetchw(&mm->mmap_sem);
diff --git a/fs/inode.c b/fs/inode.c
index f97de0a..21dab18 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -568,16 +568,16 @@ EXPORT_SYMBOL(new_inode);
 void unlock_new_inode(struct inode *inode)
 {
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
-	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)
+	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);
 		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


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[git pull] lockdep for v2.6.24, Peter Zijlstra, (Mon Oct 15, 10:30 am)
Re: [git pull] lockdep for v2.6.24, Linus Torvalds, (Mon Oct 15, 6:14 pm)
[patch] lockdep: fixup the inode dir annotation, Ingo Molnar, (Mon Oct 15, 9:47 pm)
Re: [git pull] lockdep for v2.6.24, Peter Zijlstra, (Tue Oct 16, 12:46 am)
[git pull] lockdep for v2.6.24, Peter Zijlstra, (Tue Oct 16, 12:23 pm)