Whamcloud - gitweb
LU-18383 ksocklnd: Avoid TCP socket orphans in racy LNet 37/56737/5
authorJosh Samuelson <josh@1up.unl.edu>
Sat, 26 Oct 2024 20:06:37 +0000 (15:06 -0500)
committerOleg Drokin <green@whamcloud.com>
Sun, 24 Nov 2024 06:02:24 +0000 (06:02 +0000)
commit25e1da07d70c7748be14a8a096aa0da9c3aa9644
treef167d6d9ba651d20e8eae55dc323d62204e2386e
parent6ddf46420826cc66263599ba430c5144eabf766e
LU-18383 ksocklnd: Avoid TCP socket orphans in racy LNet

LU-18137 3367ef3eb2 introduced code to handle upstream kernel changes
with regards to releasing kernel sockets.  Under heavy/racy LNet
hello transactions between servers and clients, client TCP sockets
can transition to a orphan state that is never reaped.  This commit
moves LU-18137's fix closer to the kernel socket allocation to
avoid this racy connection setup condition.

This commit also provides a backport of the kernel's socket
accounting function sock_inuse_add() for compatibility when vendor
kernels lack the static function definition in their kernel headers.
The lnet_compat.h file has been introduced for a place to put such
compatibility code.

Fixes: 3367ef3eb2 ("LU-18137 ksocklnd: Fix TCP socket cleanup")
Signed-off-by: Josh Samuelson <josh@1up.unl.edu>
Change-Id: I11fc0b53e051871da26c079e9aeb50976b20bbd3
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56737
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Mark Roper <ropermar@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/autoconf/lustre-lnet.m4
lnet/include/lnet/Makefile.am
lnet/include/lnet/lnet_compat.h [new file with mode: 0644]
lnet/klnds/socklnd/socklnd.h
lnet/klnds/socklnd/socklnd_lib.c
lnet/lnet/lib-socket.c