OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_1-494-g0182dbd
Gerrit Code Review
gerrit@openafs.org
Fri, 13 Sep 2024 12:29:48 -0400
The following commit has been merged in the master branch:
commit 0182dbd13b39ba6bf6105123ed233bc8d138c0cd
Author: Andrew Deason <adeason@sinenomine.net>
Date: Sat Jul 6 15:06:48 2024 -0500
bozo: Make bozo_isrestricted atomic
The bosserver global bozo_isrestricted is often accessed without any
locks. It's a simple boolean that doesn't need coordination with
anything else, but on pthreads, accessing this from different threads is
technically undefined behavior. To avoid this, convert bozo_isrestricted
to be an rx_atomic_t, which can be accessed safely from different
threads.
Access this global through the new functions bozo_IsRestricted() and
bozo_SetRestricted(), to make it easier to change how we access this
global in the future, if we need to. Change the name of the global to
bozo_restricted and declare it 'static', to try to make sure we haven't
left behind any old users.
Do the same thing for the bozo_restdisable global, too (renamed to
bozo_restricted_disabled), except don't add accessor functions, since
this is only used in a small number of places.
While we could instead make these globals be protected by a lock (such
as BNODE_LOCK()), using atomics is a little simpler, since we don't need
to worry about whether we have obtained the relevant lock.
Change-Id: If8d8dcc2103b084bebb152440ddd52b85cfa26b0
Reviewed-on: https://gerrit.openafs.org/15779
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/bozo/bosoprocs.c | 21 ++++++++++-----------
src/bozo/bosprototypes.h | 2 ++
src/bozo/bosserver.c | 36 ++++++++++++++++++++++++++----------
3 files changed, 38 insertions(+), 21 deletions(-)
--
OpenAFS Master Repository