OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-572-g31e8bc1
Gerrit Code Review
gerrit@openafs.org
Tue, 25 Aug 2026 16:19:28 -0400
The following commit has been merged in the master branch:
commit 331725a8ac65490d833ab629ff8759a693efe62f
Author: Andrew Deason <adeason@sinenomine.net>
Date: Tue Jan 25 16:19:41 2022 -0600
afs: Check afs_initState for failure after waiting
In afs_CheckInit, we normally wait for afs_initState to reach at least
200 (which indicates that the AFS daemon has gone through its init),
and check if it ends up with the value 200 (we failed to find the root
volume) or 300 (everything is fine).
If afs_initState is already 200 when we run this function, we
correctly return ETIMEDOUT to indicate an error. But if we need to
wait for afs_initState, we never do the final check for 200 and always
return success.
If afs_initState is 200, that means that afs_CheckRootVolume() was not
able to find the root volume, and afs_rootFid has not been set. So if
afs_CheckInit() returns success, that means that afs_root() (the
caller of afs_CheckInit()) will not know anything is wrong, and will
continue to run with an afs_rootFid full of zeroes. This will
generally fail pretty quickly anyway, because we'll try and fail to
lookup a volume id of 0 (which likely doesn't exist). But the behavior
is confusing, and is a bit nondeterministic since it depends on
whether afs_initState needs to wait or not.
Fix afs_CheckInit() to check the value of afs_initState after waiting,
so this doesn't happen. Also change afs_GetVolume() to avoid looking
up volume id 0, to avoid an extra useless call to the vlserver during
mistakes like these, and avoid potential confusing behavior when volid
0 somehow exists.
Change-Id: Id731be566a3565221beccf2609b6045c89696b74
Reviewed-on: https://gerrit.openafs.org/14884
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
src/afs/afs_call.c | 3 ++-
src/afs/afs_volume.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
--
OpenAFS Master Repository