mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
sysctl: don't loop when EAGAIN is returned
When userland_sysctl() experiences EAGAIN, don't loop internally but leave retrying to the caller. Looping was a problem in case of using tcpsso(8) to switch a TCP stack where the acceptance check of the new TCP stack results in EAGAIN. Reviewed by: kib, glebius MFC after: 1 week MFC to: stable/15 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D60444
This commit is contained in:
1 parent
dd51cef583
commit
d39b12e903
1 file changed
+3
-8
@@ -2580,14 +2580,9 @@ userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
|
||||
}
|
||||
CURVNET_SET(TD_TO_VNET(td));
|
||||
|
||||
for (;;) {
|
||||
req.oldidx = 0;
|
||||
req.newidx = 0;
|
||||
error = sysctl_root(0, name, namelen, &req);
|
||||
if (error != EAGAIN)
|
||||
break;
|
||||
kern_yield(PRI_USER);
|
||||
}
|
||||
req.oldidx = 0;
|
||||
req.newidx = 0;
|
||||
error = sysctl_root(0, name, namelen, &req);
|
||||
|
||||
CURVNET_RESTORE();
|
||||
|
||||
|
||||
Reference in new issue
Block a user