git: 18905fc31b31 - main - sysctl net.inet.tcp.ktcplist: try to handle EDEADLK
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Jul 2025 14:42:48 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=18905fc31b31fd72a1a1918b26ebbf6c4f0fb5aa
commit 18905fc31b31fd72a1a1918b26ebbf6c4f0fb5aa
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-07-03 17:59:30 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-07-10 14:42:27 +0000
sysctl net.inet.tcp.ktcplist: try to handle EDEADLK
If EDEADLK is returned from the locked handler, restart it. Do it
limited number of times. Catch signals between tries.
Reviewed by: glebius, markj
Sponsored by: Nvidia networking
Differential revision: https://reviews.freebsd.org/D51143
---
sys/netinet/tcp_subr.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index f8811649fe19..45048fb3848d 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2869,21 +2869,28 @@ tcp_ktlslist_locked(SYSCTL_HANDLER_ARGS, bool export_keys)
zfree(buf, M_TEMP);
return (error);
-
-again_reset:
- req->oldidx = 0;
- goto again;
}
static int
tcp_ktlslist1(SYSCTL_HANDLER_ARGS, bool export_keys)
{
- int res;
-
- sx_xlock(&ktlslist_lock);
- res = tcp_ktlslist_locked(oidp, arg1, arg2, req, export_keys);
- sx_xunlock(&ktlslist_lock);
- return (res);
+ int repeats, error;
+
+ for (repeats = 0; repeats < 100; repeats++) {
+ if (sx_xlock_sig(&ktlslist_lock))
+ return (EINTR);
+ error = tcp_ktlslist_locked(oidp, arg1, arg2, req,
+ export_keys);
+ sx_xunlock(&ktlslist_lock);
+ if (error != EDEADLK)
+ break;
+ if (sig_intr() != 0) {
+ error = EINTR;
+ break;
+ }
+ req->oldidx = 0;
+ }
+ return (error);
}
static int