[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1399626665-29817-11-git-send-email-pmladek@suse.cz>
Date: Fri, 9 May 2014 11:11:04 +0200
From: Petr Mladek <pmladek@...e.cz>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Dave Anderson <anderson@...hat.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Kay Sievers <kay@...y.org>, Jiri Kosina <jkosina@...e.cz>,
Michal Hocko <mhocko@...e.cz>, Jan Kara <jack@...e.cz>,
linux-kernel@...r.kernel.org, Petr Mladek <pmladek@...e.cz>
Subject: [RFC PATCH 10/11] printk: survive rotation of sequence numbers
NMI log buffer uses half of "unsigned long" to store the sequence number.
The maximum value might be relatively small, especially on 32-bit systems.
This patch makes the check for free space more strict, so it does give
false results after the rotation.
Signed-off-by: Petr Mladek <pmladek@...e.cz>
---
kernel/printk/printk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 874ebab41ba3..9c97b6daccc3 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -540,7 +540,7 @@ static int log_make_free_space(struct printk_log *log, u32 msg_size)
int freed = 0;
int ret = 0;
- while (get_first_seq(log) < get_next_seq(log)) {
+ while (get_first_seq(log) != get_next_seq(log)) {
if (logbuf_has_space(log, msg_size, false))
goto out;
--
1.8.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists