OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-355-gb2a30c4
Gerrit Code Review
gerrit@openafs.org
Thu, 30 Oct 2025 11:24:23 -0400
The following commit has been merged in the master branch:
commit b2a30c4e0989a93d3b0b53f2435a352ca0c0c100
Author: Andrew Deason <adeason@sinenomine.net>
Date: Tue Oct 28 17:19:36 2025 +0000
libafscp: Use afscp_errno more consistently
libafscp currently has the (unfortunate) convention of using the
afscp_errno global to indicate error codes. But some code paths in
some of its functions don't set an afscp_errno value on error, and
some callers just look at the return value, instead of afscp_errno.
This causes afsio to print misleading error messages in many cases,
since most functions return -1 on error and set afscp_errno to the
actual reason for failure. So if we attempt to access a file and fail,
afsio will report:
afsio: server or network not responding (stat failed with code -1)
Even if the real reason for the failure is due to a permissions issue,
I/O errors, or anything else.
Fix the libafscp functions to set afscp_errno on error in a few places
that are not currently doing so, and fix callers to look at
afscp_errno instead of the returned value.
This commit does not ensure that all afscp functions set afscp_errno on
error; this commit is just fixing some of the easier cases. For some
functions, it is not obvious what error codes to set (afscp_Init()), or
some functions are effectively never actually used
(afscp_FindCallBack()), so don't bother fixing those for now.
Change-Id: I7f8bef3d4632ee73b8d1b575b486d11ec81ea74a
Reviewed-on: https://gerrit.openafs.org/15320
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
src/libafscp/afscp_callback.c | 3 +++
src/libafscp/afscp_dirops.c | 1 +
src/libafscp/afscp_fid.c | 3 +++
src/libafscp/afscp_server.c | 10 ++++++++++
src/libafscp/afscp_volume.c | 1 +
src/venus/afsio.c | 18 +++++++++---------
6 files changed, 27 insertions(+), 9 deletions(-)
--
OpenAFS Master Repository