um: synchronize kmsg_dumper
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 3 Mar 2021 10:15:14 +0000 (11:15 +0100)
committerPetr Mladek <pmladek@suse.com>
Mon, 8 Mar 2021 10:42:37 +0000 (11:42 +0100)
commitfdd2c1f4e2c2e2fee1d95d18b4b06bc0d15c368a
tree675cb1c8dbc8fb10b73f5d7e3eb3218c515e3f2d
parentb2bec7d8a42a3885d525e821d9354b6b08fd6adf
um: synchronize kmsg_dumper

The kmsg_dumper can be called from any context and CPU, possibly
from multiple CPUs simultaneously. Since a static buffer is used
to retrieve the kernel logs, this buffer must be protected against
simultaneous dumping. Skip dumping if another context is already
dumping.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210303101528.29901-2-john.ogness@linutronix.de
arch/um/kernel/kmsg_dump.c