File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2533,6 +2533,7 @@ void console_unlock(void)
2533
2533
bool do_cond_resched , retry ;
2534
2534
struct printk_info info ;
2535
2535
struct printk_record r ;
2536
+ u64 __maybe_unused next_seq ;
2536
2537
2537
2538
if (console_suspended ) {
2538
2539
up_console_sem ();
@@ -2642,8 +2643,10 @@ void console_unlock(void)
2642
2643
cond_resched ();
2643
2644
}
2644
2645
2645
- console_locked = 0 ;
2646
+ /* Get consistent value of the next-to-be-used sequence number. */
2647
+ next_seq = console_seq ;
2646
2648
2649
+ console_locked = 0 ;
2647
2650
up_console_sem ();
2648
2651
2649
2652
/*
@@ -2652,7 +2655,7 @@ void console_unlock(void)
2652
2655
* there's a new owner and the console_unlock() from them will do the
2653
2656
* flush, no worries.
2654
2657
*/
2655
- retry = prb_read_valid (prb , console_seq , NULL );
2658
+ retry = prb_read_valid (prb , next_seq , NULL );
2656
2659
printk_safe_exit_irqrestore (flags );
2657
2660
2658
2661
if (retry && console_trylock ())
You can’t perform that action at this time.
0 commit comments