NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/57259: ucom serial ports cannot be re-opened "too quickly" with O_NONBLOCK
The following reply was made to PR kern/57259; it has been noted by GNATS.
From: Jason Thorpe <thorpej%me.com@localhost>
To: Taylor Campbell <riastradh%NetBSD.org@localhost>
Cc: "gnats-bugs%netbsd.org@localhost" <gnats-bugs%NetBSD.org@localhost>
Subject: Re: kern/57259: ucom serial ports cannot be re-opened "too quickly"
with O_NONBLOCK
Date: Sun, 5 Mar 2023 04:46:26 -0800
> On Mar 5, 2023, at 4:39 AM, Taylor R Campbell <riastradh%NetBSD.org@localhost> =
wrote:
>=20
>> - Even suppressing EWOULDBLOCK (resulting in an ERESTART), it would
>> simply fail with a spurious EINTR that I couldn't determine where
>> that was coming from (clearly from some higher-up layer).
>=20
> EINTR should only happen if a signal is delivered. If you're not sure
> where that was coming from it bears further investigation. I don't
> think tty(9) or condvar(9) will fabricate EINTR when there's no signal
> pending.
Nope, you=E2=80=99re wrong. I found where it=E2=80=99s coming from:
error =3D vn_open(dvp, pb, TRYEMULROOT, flags, cmode,
&vp, &dupfd_move, &dupfd);
if (error !=3D 0) {
fd_abort(p, fp, indx);
if (error =3D=3D ERESTART)
error =3D EINTR;
return error;
}
That=E2=80=99s in do_open(). So the logic to return ERESTART here is =
just wrong, and it could have never worked as written.
-- thorpej
Home |
Main Index |
Thread Index |
Old Index