OpenAFS Master Repository branch, master, updated. BP-openafs-stable-1_8_x-433-g1effc35
Gerrit Code Review
gerrit@openafs.org
Sun, 25 Aug 2019 18:52:46 -0400
The following commit has been merged in the master branch:
commit 1effc3517fdb4b4653d47c59bf67076567209324
Author: Tim Creech <tcreech@tcreech.com>
Date: Sun Mar 5 18:18:01 2017 -0500
FBSD: Call CURVNET_SET/CURVNET_RESTORE for VIMAGE
In commit 9703b023 (FBSD: VIMAGE support), we changed a couple of our
variable references to their V_* equivalents, to accommodate kernels
with VIMAGE turned on. This allows us to build, but causes us to crash
whenever we hit that code when VIMAGE is enabled, because the relevant
macros reference 'curvnet', which is NULL outside of networking code.
What we're supposed to do is to set 'curvnet' before entering
networking code by calling 'CURVNET_SET(xxx)', and reset it afterwards
by calling 'CURVNET_RESTORE()'. We must make exactly one _RESTORE call
for each _SET, and they are supposed to be run at the same level of
scope.
So to avoid the crashes, make the relevant CURVNET_* calls whenever we
look at networking info. We currently only do this in a few places:
- In afs_SetServerPrefs, to try to detect if a given server address is
in the same network as one our local interfaces (V_in_ifaddrhead)
- In rxi_GetIFInfo, for some MTU-related info (V_ifnet)
- In rxi_FindIfnet, for some MTU-related info (ifa_ifwithnet)
As for what vnet we actually set 'curvnet' to, we could set it to the
vnet of the current thread (TD_TO_VNET(curthread)), or we could set it
to the vnet of an associated network object (a socket, an interface,
etc). Since all of our network-related code goes through Rx, in this
commit we set curvnet to the vnet of the Rx socket
(rx_socket->so_vnet).
Note that VIMAGE is optional in 11-RELEASE, but is turned on by
default in 12.0-RELEASE. For more information, see:
https://wiki.freebsd.org/VIMAGE/porting-to-vimage
[adeason@dson.org: Reworded commit message; moved some code around.]
Change-Id: If631b8942d7ee5cfe38a8f0c32b282d015f0bf35
Reviewed-on: https://gerrit.openafs.org/12580
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/afs_server.c | 18 ++++++++++++------
src/rx/rx_kcommon.c | 20 +++++++++++++++++++-
2 files changed, 31 insertions(+), 7 deletions(-)
--
OpenAFS Master Repository