[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080412164215.GC29599@tull.net>
Date: Sun, 13 Apr 2008 02:42:16 +1000
From: Nick Andrew <nick@...k-andrew.net>
To: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] printk: Remember the message level for multi-line output
On Sun, Apr 13, 2008 at 02:18:54AM +1000, Nick Andrew wrote:
> - static int log_level_unknown = 1;
> + static int new_text_line = 1;
Further to the previous patch, maintaining the state of being in the
middle of an output line across calls to printk() opens up the
possibility of log corruption when calling code uses printk() to
output fragments of a line. This seems to happen a lot in the
codebase, for example (from arch/blackfin/kernel/traps.c):
printk(KERN_NOTICE "Stack from %08lx:", (unsigned long)stack);
for (i = 0; i < kstack_depth_to_print; i++) {
if (stack + 1 > endstack)
break;
if (i % 8 == 0)
printk("\n" KERN_NOTICE " ");
printk(" %08lx", *stack++);
}
printk("\n");
The caller should be building complete output lines, at a minimum.
Or, to maintain the convenient coding, there would need to be an
intermediate function which buffers the partial lines until the
caller issues a flush call.
Nick.
--
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