tty: Ensure single-threaded flip buffer consumer with mutex
The buffer work may race with parallel tty_buffer_flush. Use a mutex to guarantee exclusive modify access to the head flip buffer. Remove the unneeded spin lock. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
e8437d7ecb
commit
e9975fdec0
@@ -66,7 +66,7 @@ static inline char *flag_buf_ptr(struct tty_buffer *b, int ofs)
|
||||
|
||||
struct tty_bufhead {
|
||||
struct work_struct work;
|
||||
spinlock_t lock;
|
||||
struct mutex flush_mutex;
|
||||
struct tty_buffer sentinel;
|
||||
struct tty_buffer *head; /* Queue head */
|
||||
struct tty_buffer *tail; /* Active buffer */
|
||||
|
Reference in New Issue
Block a user