]> git.ipfire.org Git - thirdparty/linux.git/commit
printk: use seqcount_latch for clear_seq
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 3 Mar 2021 10:15:21 +0000 (11:15 +0100)
committerPetr Mladek <pmladek@suse.com>
Mon, 8 Mar 2021 10:43:15 +0000 (11:43 +0100)
commit7d7a23a91c915f6a90b2a636b130c53e0fe5154c
treef588998ccde75f23e1044f5fc636d134d9718c05
parentcf5b0208fda4602d0ef383a86e942fb3dcb8852b
printk: use seqcount_latch for clear_seq

kmsg_dump_rewind_nolock() locklessly reads @clear_seq. However,
this is not done atomically. Since @clear_seq is 64-bit, this
cannot be an atomic operation for all platforms. Therefore, use
a seqcount_latch to allow readers to always read a consistent
value.

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-9-john.ogness@linutronix.de
kernel/printk/printk.c