selsocket: handle sopoll() errors correctly
Without this change, unmounting smbfs filesystems with an INVARIANTS kernel would panic after 10e64782ed59727e8c9fe4a5c7e17f497903c8eb. Found by: markj Reviewed by: markj, jhb Obtained from: CheriBSD MFC after: 3 days Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D32492
This commit is contained in:
parent
a524aaf683
commit
04c91ac48a
@ -1794,10 +1794,10 @@ selsocket(struct socket *so, int events, struct timeval *tvp, struct thread *td)
|
||||
*/
|
||||
for (;;) {
|
||||
selfdalloc(td, NULL);
|
||||
error = sopoll(so, events, NULL, td);
|
||||
/* error here is actually the ready events. */
|
||||
if (error)
|
||||
return (0);
|
||||
if (sopoll(so, events, NULL, td) != 0) {
|
||||
error = 0;
|
||||
break;
|
||||
}
|
||||
error = seltdwait(td, asbt, precision);
|
||||
if (error)
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user