From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932551AbbI2GkH (ORCPT ); Tue, 29 Sep 2015 02:40:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44710 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755461AbbI2Gj7 (ORCPT ); Tue, 29 Sep 2015 02:39:59 -0400 Date: Tue, 29 Sep 2015 07:39:55 +0100 From: Aaron Tomlin To: Ulrich Obergfell Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, dzickus@redhat.com Subject: Re: [PATCH 1/5] watchdog: fix error handling in proc_watchdog_thresh() Message-ID: <20150929063955.GG25024@atomlin.usersys.redhat.com> References: <1443473052-3053-1-git-send-email-uobergfe@redhat.com> <1443473052-3053-2-git-send-email-uobergfe@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6Nae48J/T25AfBN4" Content-Disposition: inline In-Reply-To: <1443473052-3053-2-git-send-email-uobergfe@redhat.com> X-PGP-Key: http://pgp.mit.edu/pks/lookup?search=atomlin%40redhat.com X-PGP-Fingerprint: 7906 84EB FA8A 9638 8D1E 6E9B E2DE 9658 19CC 77D6 User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --6Nae48J/T25AfBN4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon 2015-09-28 22:44 +0200, Ulrich Obergfell wrote: > 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. >=20 > Signed-off-by: Ulrich Obergfell > --- > kernel/watchdog.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > 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, i= nt write, > goto out; > =20 > /* > - * Update the sample period. > - * Restore 'watchdog_thresh' on failure. > + * Update the sample period. Restore on failure. > */ > set_sample_period(); > err =3D proc_watchdog_update(); > - if (err) > + if (err) { > watchdog_thresh =3D old; > + set_sample_period(); > + } > out: > mutex_unlock(&watchdog_proc_mutex); > return err; Reviewed-by: Aaron Tomlin --6Nae48J/T25AfBN4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWCjI7AAoJEOLellgZzHfWcJ8QAIG3nX1YQaweXSxG5PfVi9IL bo2d99olLYBY5Pe1o4SrXt1oSmFXNwrNgH/E85c3Jj18VlC0vFCEK7WR2eOhKohL ygAbUt2wBhPqw+TqMjPw/UX+i7fj8Jhvv5epyGgr3AglqTFpDiP5tPMHMC8Z0yy/ KEGlNpmUe53OGTiLgGeatHLdrmthFDjraYUMX4SbJj/Tt/rieI4eOYq6Q9RJsdPS A1ki6GZ3FFlJ9AYmDay4frj7DkjMGUe6dhAm3unrNeekTl8PQgnx7h55Ny348icy 9PM1vnf/lb3wwMq4QccAD8cxLvWAsArznJIQxw9PsHRLK6zSSwZ0XxJPn0+D5VRi KkXXbqmtBpzTcj24vfxcnYm9jDUS9Q6nmGO9YG0cAjtmSGnBSdxTHEb/w6XFf5UC j/eDBJ7PujbwLY4KVEhEvj/VfSzd8SLXLaLelOVUalAbw8oPRLPigxQ9kNjEOK/l gJA0YFRiS6urKriVoWV2n7QxeHRI5Xo0/7mlcra2LrOVupcO/WIV7xd2HFFMbrVQ fN3H/5PbpEtJE018DTo5hRHOCG56UmOwvi1AVhJCwo/6tO90QZIFd8R9buMMV6Mm pFrjjknK0RN6cU4v7POdb9U8qkxZDC41C7aPg9wrQXoEWA6dVlqlup3JYpE8c5B8 YglYSpIT+nU+CXG0o7tB =IPbP -----END PGP SIGNATURE----- --6Nae48J/T25AfBN4--