git: d39b12e9030b - main - sysctl: don't loop when EAGAIN is returned
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 08 Oct 2026 13:08:48 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=d39b12e9030b20410cecbcbb0c22847d7f8b5471
commit d39b12e9030b20410cecbcbb0c22847d7f8b5471
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-10-08 13:05:11 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-10-08 13:05:11 +0000
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
---
sys/kern/kern_sysctl.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index ad2d4ae22a77..8c63f8073cb4 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -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();