ttydev_write: prevent stops while terminal is busied
Since busy state is checked by all blocked writes, stopping a process which waits in ttydisc_write() causes cascade. Utilize sigdeferstop() to avoid the issue. Submitted by: Jakub Piecuch <j.piecuch96@gmail.com> PR: 255816 MFC after: 1 week
This commit is contained in:
parent
cc6f46ac2f
commit
8cf912b017
@ -525,7 +525,7 @@ static int
|
||||
ttydev_write(struct cdev *dev, struct uio *uio, int ioflag)
|
||||
{
|
||||
struct tty *tp = dev->si_drv1;
|
||||
int error;
|
||||
int defer, error;
|
||||
|
||||
error = ttydev_enter(tp);
|
||||
if (error)
|
||||
@ -549,7 +549,9 @@ ttydev_write(struct cdev *dev, struct uio *uio, int ioflag)
|
||||
}
|
||||
|
||||
tp->t_flags |= TF_BUSY_OUT;
|
||||
defer = sigdeferstop(SIGDEFERSTOP_ERESTART);
|
||||
error = ttydisc_write(tp, uio, ioflag);
|
||||
sigallowstop(defer);
|
||||
tp->t_flags &= ~TF_BUSY_OUT;
|
||||
cv_signal(&tp->t_outserwait);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user