diff mbox

suspend regression in 4.1-rc1

Message ID 20150519071259.GA6847@dhcp22.suse.cz (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Michal Hocko May 19, 2015, 7:12 a.m. UTC
On Mon 18-05-15 10:10:50, Linus Torvalds wrote:
> On Mon, May 18, 2015 at 2:31 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> > Subject: watchdog: Fix merge 'conflict'
> >
> > Two watchdog changes that came through different trees had a non
> > conflicting conflict, that is, one changed the semantics of a variable
> > but no actual code conflict happened. So the merge appeared fine, but
> > the resulting code did not behave as expected.
> 
> Ok, I see that people are still discussing this, but I'll apply it
> as-is since I want to get rc4 out the door, and I guess people can
> tweak this if there's anything else we want to do longer-term.

The final patch from Peter has a typo. Without the following the system
deadlocks obviously:
---
From 215266efd5e14938d14f0f4258a70fb32f6a455b Mon Sep 17 00:00:00 2001
From: Michal Hocko <mhocko@suse.cz>
Date: Tue, 19 May 2015 09:07:27 +0200
Subject: [PATCH] watchdog: fix double lock in watchdog_nmi_enable_all

ab992dc38f9a ("watchdog: Fix merge 'conflict'") has introduced an
obvious deadlock because of a typo. watchdog_proc_mutex should be
unlocked on exit.

Thanks to Miroslav Benes who was staring at the code with me and noticed
this.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
---
 kernel/watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Zijlstra May 19, 2015, 7:39 a.m. UTC | #1
On Tue, May 19, 2015 at 09:12:59AM +0200, Michal Hocko wrote:
> On Mon 18-05-15 10:10:50, Linus Torvalds wrote:
> > On Mon, May 18, 2015 at 2:31 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> > > Subject: watchdog: Fix merge 'conflict'
> > >
> > > Two watchdog changes that came through different trees had a non
> > > conflicting conflict, that is, one changed the semantics of a variable
> > > but no actual code conflict happened. So the merge appeared fine, but
> > > the resulting code did not behave as expected.
> > 
> > Ok, I see that people are still discussing this, but I'll apply it
> > as-is since I want to get rc4 out the door, and I guess people can
> > tweak this if there's anything else we want to do longer-term.
> 
> The final patch from Peter has a typo. Without the following the system
> deadlocks obviously:

Duh, sorry about that. :/
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" 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/kernel/watchdog.c b/kernel/watchdog.c
index 506edcc500c4..581a68a04c64 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -621,7 +621,7 @@  void watchdog_nmi_enable_all(void)
 	put_online_cpus();
 
 unlock:
-	mutex_lock(&watchdog_proc_mutex);
+	mutex_unlock(&watchdog_proc_mutex);
 }
 
 void watchdog_nmi_disable_all(void)