OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_1-497-g6e5cbd7
Gerrit Code Review
gerrit@openafs.org
Fri, 13 Sep 2024 17:43:30 -0400
The following commit has been merged in the master branch:
commit 6e5cbd7ccbbeb1c71e76ada1a25a53a101d52fd5
Author: Andrew Deason <adeason@sinenomine.net>
Date: Mon Aug 19 18:18:36 2024 -0500
bozo: Require BNODE_LOCK for DirAccessOK
DirAccessOK() currently uses two static vars (lastTime, lastResult) to
cache the result of the function to avoid overly-frequent stat()s. These
are not documented as being protected by any locks. Currently they
cannot be accessed by two different threads at the same time; the only
callers are:
- SBOZO_GetInstanceInfo(), which calls it with BNODE_LOCK held
- main(), which calls it before our rx service threads are started
But this is fragile and not documented. To avoid potential issues in the
future, document DirAccessOK() as requiring BNODE_LOCK, assert that we
have BNODE_LOCK in DirAccessOK(), and acquire BNODE_LOCK before calling
DirAccessOK() from main().
While we're here, move the declarations for the two static vars so
they're next to each other, so it's a little more obvious that we have
some static variables here.
Change-Id: I4e0e55cd8a7ebbb681e4da937efcc9c37633e3ab
Reviewed-on: https://gerrit.openafs.org/15837
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
src/bozo/bosoprocs.c | 13 +++++++++----
src/bozo/bosserver.c | 4 ++--
2 files changed, 11 insertions(+), 6 deletions(-)
--
OpenAFS Master Repository