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:
Peter Hurley
2013-06-15 09:36:10 -04:00
committed by Greg Kroah-Hartman
parent e8437d7ecb
commit e9975fdec0
3 changed files with 22 additions and 22 deletions

View File

@@ -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 */