Skip to content

Commit 715d3ed

Browse files
committed
Merge branch 'rework/fixup-for-5.15' into for-linus
2 parents baa99c9 + 11e4b63 commit 715d3ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

kernel/printk/printk.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,6 +2533,7 @@ void console_unlock(void)
25332533
bool do_cond_resched, retry;
25342534
struct printk_info info;
25352535
struct printk_record r;
2536+
u64 __maybe_unused next_seq;
25362537

25372538
if (console_suspended) {
25382539
up_console_sem();
@@ -2642,8 +2643,10 @@ void console_unlock(void)
26422643
cond_resched();
26432644
}
26442645

2645-
console_locked = 0;
2646+
/* Get consistent value of the next-to-be-used sequence number. */
2647+
next_seq = console_seq;
26462648

2649+
console_locked = 0;
26472650
up_console_sem();
26482651

26492652
/*
@@ -2652,7 +2655,7 @@ void console_unlock(void)
26522655
* there's a new owner and the console_unlock() from them will do the
26532656
* flush, no worries.
26542657
*/
2655-
retry = prb_read_valid(prb, console_seq, NULL);
2658+
retry = prb_read_valid(prb, next_seq, NULL);
26562659
printk_safe_exit_irqrestore(flags);
26572660

26582661
if (retry && console_trylock())

0 commit comments

Comments
 (0)