Re: [PATCH] tty: hold lock across tty buffer finding and buffer filling

From: Jiri Slaby
Date: Fri Mar 16 2012 - 06:04:15 EST


On 03/16/2012 11:01 AM, Du, Alek wrote:
> We prepared the buffer, and use it. And during this, we don't release the spinlock of buf.lock, how the flush could happen?
>
> A
> spin_lock
> prepare the buffer
> user the buffer
> spin unlock
>
>
> B
> Spin_lock
> Flush
> Free the buffer
> Put buf.tail = NULL
> Spin unlock

Well, you do. Not all drivers use tty_insert_flip_string. Take a look at
tty_prepare_flip_string and its users.

thanks,
--
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/