]> git.karo-electronics.de Git - karo-tx-linux.git/commit
printk: split code for making free space in the log buffer
authorPetr Mladek <pmladek@suse.cz>
Thu, 22 May 2014 00:43:33 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:33 +0000 (10:43 +1000)
commitbef0a8087dc56bd4e1892ff7eecb3e53690e3207
tree027b2ba55343e850530add451a4ad3d00adb9e17
parenteb8a133782a4f09b086e611c88eba65b73ff9a68
printk: split code for making free space in the log buffer

The check for free space in the log buffer always passes when "first_seq"
and "next_seq" are equal.  In theory, it might cause writing outside of
the log buffer.

Fortunately, the current usage looks safe because the used "text" and
"dict" buffers are quite limited.  See the second patch for more details.

Anyway, it is better to be on the safe side and add a check.  An easy
solution is done in the 2nd patch and it is improved in the 4th patch.

5th patch fixes the computation of the printed message length.

1st and 3rd patches just do some code refactoring to make the other
patches easier.

This patch (of 5):

There will be needed some fixes in the check for free space.  They will be
easier if the code is moved outside of the quite long log_store()
function.

This patch does not change the existing behavior.

Signed-off-by: Petr Mladek <pmladek@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/printk/printk.c