chardev: add a per-channel mutex (TEMPORARY)
This is a temporary solution to race conditions between user space programs acting on the same channel. The code serializes all operations on a channel, to prevern chan->user_block to disappear while being used by another process. We keep the mutex when going to sleep, which means that only one process at a time can be sleeping on a cahnnel -- other processes will be sleeping on the semaphore, thus not obeying O_NONBLOCK. We'll try to do it more cleanly in master, but this al least fixes possible oopses in the currently installed systems. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Federico Vaga <federico.vaga@gmail.com>
Showing
Please
register
or
sign in
to comment