
TTY has no way of keeping track of multiple readers for a tty minor device. Instead, it stores a read request for the last reader only. Consequently, the first ("overwritten") reader gets stuck on a read request that's never going to be finished. Also, the overwriting causes a grant mismatch in VFS when TTY returns a reply for the second reader. This patch is a work around for the actual problem (i.e., keeping track of multiple readers). It checks whether there is a read operation in progress and returns an error if it is --preventing that reader from getting overwritten and stuck. It fixes a bug triggered by executing 'top | more' and pressing the space bar for a while (easily reproducable in a VM, not on hardware).
Description
Languages
C
78.2%
Roff
10.2%
Assembly
4.6%
Shell
3.7%
Makefile
1.6%
Other
1.2%