From: Davidlohr Bueso <dave@stgolabs.net>
To: Huang Ying <ying.huang@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Borislav Petkov <bp@suse.de>, Tony Luck <tony.luck@intel.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] GHES: Fix cached error-status
Date: Mon, 19 Oct 2015 10:55:54 -0700 [thread overview]
Message-ID: <20151019175554.GB3367@linux-uzut.site> (raw)
In ghes_estatus_cached() we currently have a situation where
we can break out of the loop before examining all the possible
estatus_caches. Move the 'break' statement inside of the 'if',
such that an otherwise possibly missed cache is acknowledged
and the function returns the proper value.
Introduced by 152cef40a808d (ACPI, APEI, GHES, Error records
content based throttle).
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
Hi,
I found this accidentally and have no idea if it is correct, but
seems to be a case of a misplaced break. If this is not the case,
then it is a very weird way of using a for-loop, and should probably
be rewritten -- and there are other funky places in this file...
100% untested.
Thanks,
Davidlohr
drivers/acpi/apei/ghes.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 3dd9c46..3fda4a2 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -541,9 +541,10 @@ static int ghes_estatus_cached(struct acpi_hest_generic_status *estatus)
continue;
atomic_inc(&cache->count);
now = sched_clock();
- if (now - cache->time_in < GHES_ESTATUS_IN_CACHE_MAX_NSEC)
+ if (now - cache->time_in < GHES_ESTATUS_IN_CACHE_MAX_NSEC) {
cached = 1;
- break;
+ break;
+ }
}
rcu_read_unlock();
return cached;
--
2.1.4
next reply other threads:[~2015-10-19 17:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 17:55 Davidlohr Bueso [this message]
2015-10-23 22:50 ` [PATCH] GHES: Fix cached error-status Davidlohr Bueso
2015-10-23 23:05 ` Luck, Tony
2015-10-26 3:20 ` Huang, Ying
2015-10-26 4:30 ` Borislav Petkov
2015-10-26 5:43 ` Huang, Ying
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151019175554.GB3367@linux-uzut.site \
--to=dave@stgolabs.net \
--cc=bp@suse.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tony.luck@intel.com \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).