From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752741AbbI1Uk3 (ORCPT ); Mon, 28 Sep 2015 16:40:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45476 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246AbbI1Uk0 (ORCPT ); Mon, 28 Sep 2015 16:40:26 -0400 From: Ulrich Obergfell To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, dzickus@redhat.com, atomlin@redhat.com, uobergfe@redhat.com Subject: [PATCH 1/5] watchdog: fix error handling in proc_watchdog_thresh() Date: Mon, 28 Sep 2015 22:44:08 +0200 Message-Id: <1443473052-3053-2-git-send-email-uobergfe@redhat.com> In-Reply-To: <1443473052-3053-1-git-send-email-uobergfe@redhat.com> References: <1443473052-3053-1-git-send-email-uobergfe@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Restore the previous value of watchdog_thresh _and_ sample_period if proc_watchdog_update() returns an error. The variables must be consistent to avoid false positives of the lockup detectors. Signed-off-by: Ulrich Obergfell --- kernel/watchdog.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 64ed1c3..cd9a504 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -914,13 +914,14 @@ int proc_watchdog_thresh(struct ctl_table *table, int write, goto out; /* - * Update the sample period. - * Restore 'watchdog_thresh' on failure. + * Update the sample period. Restore on failure. */ set_sample_period(); err = proc_watchdog_update(); - if (err) + if (err) { watchdog_thresh = old; + set_sample_period(); + } out: mutex_unlock(&watchdog_proc_mutex); return err; -- 1.7.11.7