Several locations within vos use strcpy without verifying the length
of the source string which could lead to potential string buffer
overflows.
There are 2 cases where the string buffer can be replace with a pointer
to the string that was being copied.
Replace the string buffers with pointers where possible.
Replace the remaining uses of strcpy with strlcpy and and where
appropriate add checks to detect and report on possible string
truncations.
Change-Id: I4189f0ad1858065acf5bac7dfa83ce662e11fa4b
Reviewed-on: https://gerrit.openafs.org/15478
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
The afs_Analyze() function can lead to excessive retries in cases where
a recoverable error cannot be resolved, or when a process is signaled to
terminate (e.g., with SIGKILL). This can cause unnecessary floods of
kernel messages or RPC requests.
afs_Analyze() analyzes RPC results, indicating if a retry is appropriate
for "recoverable" errors. Some recoverable errors may persist for an
extended period of time (e.g., a busy volume that may require time to
recover or an unavailable service). A user may desire to cancel the
request in these cases. Normally when retrying an operation there is a
sleep between retries (using VSleep() or similar functions). On Linux
systems when there is pending SIGKILL, sleep will return immediately,
so the operation is retried immediately without any delay.
For most recoverable errors, there is a limit on the number of times the
request is retried; for instance, VBUSY errors are retried 100 times
before giving up. But for network errors when hardmount is enabled,
there is no limit on the number of retries, so it is possible that
retries will be done immediately forever, possibly making the machine
slow or even unusable until the error goes away or hardmount is
disabled.
In afs_Analyze() add a call to afs_kill_pending() to check if the
process is being terminated. If the process is pending termination,
return a status indicating that the RPC request should not be retried.
Change-Id: I972931790bf680a181f1ebc45dfe7d355f7641cd
Reviewed-on: https://gerrit.openafs.org/15747
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The kernel module build can be disabled with the configure option
--disable-kernel-module ever since commit 62994d919d (allow-disabling-
kernel-module-compilation-20010705). That commit also added a feature
to automatically disable the Linux kernel module build when the Linux
kernel headers are not found.
Unfortunately, even when --enable-kernel-module is specified, configure
will disable the Linux kernel module build when the Linux headers are
not found, instead of failing configure. The build will complete
successfully, but the kernel module will be missing. When installing
from a source build, the build and install will complete without errors,
but the client will fail to start due to the missing kernel module.
Change the --enable-kernel-module to be an autodetect option by default.
When --enable-kernel-module is specified and no Linux kernel headers are
found, configure will fail (AC_MSG_ERROR), instead of disabling the
kernel module build.
This change makes --enable-kernel-module to be more consistent with the
other --enable-feature options which do probing, keeps the build system
behavior the same by default, and allows builders to specify
--enable-kernel-module to indicate the build must result in a kernel
module.
This commit keeps the check to fail configure when a path to the Linux
kernel header files are specified with the --with-linux-kernel-headers
but the headers were not found. Change the error message to avoid
printing the old /usr/src/linux path, since that was incorrect.
Add a check to fail configure when a path to the Linux kernel build
directory is specified with --with-linux-kernel-build but the Linux
kernel build files are not found. This check was probably missed when
the --with-linux-kernel-build option was added.
Move the OPENAFS_LINUX_KERNEL_PATH macro to be after the AC_MSG_RESULT
so the "checking your OS" is resolved before checking the Linux kernel
header and build paths. This cleans up the output when there is a
warning or error and will make it possible to add AC_MSG_CHECKING() in
OPENAFS_LINUX_KERNEL_PATH in the future.
Rename the existing OPENAFS_LINUX_KERNEL_PATH to the internal macro
_OPENAFS_LINUX_KERNEL_PATH, and add a new OPENAFS_LINUX_KERNEL_PATH
macro which checks and resolves the --enable-kernel-module option. The
_OPENAFS_LINUX_KERNEL_PATH macro can be improved in a future change.
Change the configure summary to check the ENABLE_KERNEL_MODULE (upper
case) variable instead of the enable_kernel_module (lower case) to
indicate when the kernel module build is enabled. This avoids the need
to change enable_kernel_module on non-Linux platforms.
Change-Id: Ieebc98425e0dea5de36f213b0c168db3202af644
Reviewed-on: https://gerrit.openafs.org/15050
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Introduce a function that checks to see if the current kernel task has
a pending kill (e.g. SIGKILL) that will terminate the process when it
returns to userspace.
Add afs_kill_pending() that uses an osi level function,
osi_kill_pending() to determine if the process has a pending
termination. If the osi level function has not been implemented, just
return 0.
Add a Linux implementation of osi_kill_pending() that calls Linux's
fatal_signal_pending() (if it's available).
Update Linux's "filter_enoent()" function in osi_vnodeops.c to use
afs_kill_pending().
A future commit will expand the use of afs_kill_pending().
Fix minor white space in an adjacent lines.
Change-Id: Ib215639d36f4baa7a1dffda3cc314d2d447c6e96
Reviewed-on: https://gerrit.openafs.org/15746
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The function afs_Analyze() currently has a common exit label `out` that
is not used consistently.
Refactor afs_Analyze() to branch to `out` instead of returning. Update
the code at `out` to only call afs_PutConn() if aconn is not NULL.
Move the call to afs_FinalizeReq() so it's earlier in the code path to
simplify early returns.
Replace a cast of 0 as a pointer with NULL.
Minor white space cleanup.
Change-Id: I552d84dd653a483774551dad1c05d7a692ac9d14
Reviewed-on: https://gerrit.openafs.org/15745
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
In order to eliminate the following warnings:
warning: initializer does not fit or is out of range: ...
change the test uuids to unsigned chars.
Change-Id: Ic75d4d8d292b309a25713979935f8e82985590b6
Reviewed-on: https://gerrit.openafs.org/15355
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Currently our perl tests use Test::More, which sends diag() messages
to stderr, including when reporting why a test failed.
Our 'runtests' harness from c-tap-harness discards stderr from test
programs, unless we run in single-test mode (-o). As a result, when we
run tests with 'runtests -v' and a test fails, we can't see any
diagnostic information if the test was using perl's Test::More,
including why a test failed. If the test is written in C using
c-tap-harness bindings, diag() goes to stdout, and this problem
doesn't happen.
To make sure we can see diag() messages from perl tests, change the
default behavior for Test::More to print diag() messages to stdout,
where they will be read by 'runtests' and shown by 'runtests -v'. The
diag messages are still discarded when running in non-v (and non-o)
mode.
Change-Id: I971a61cb9c83e85949ba6adf9af0ee54b0b23680
Reviewed-on: https://gerrit.openafs.org/15734
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
To mitigate potential build problems in the future due to redundant
inclusion of the roken header, add include guards to the generated
roken.h file, just like the real roken.h has. The addition of these
guards ensures that the header is included only once, safeguarding
against potential future build issues.
Change-Id: Ia22076038d22e60aaaa8e20ab0265d5288c54f2d
Reviewed-on: https://gerrit.openafs.org/15678
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Each C-TAP test is statically linked with libafstest_common as well as
any libaries under test. However, not all tests have these libraries
listed as dependencies in their respective make rules. Thus when
development changes are made to the c-tap harness, the OpenAFS common
code (tests/common/*), or the libraries under test, these tests may not
be rebuilt. This results in unexpected test output and confusion.
Add the libafstest_common library (and other OpenAFS libraries as
needed) as dependencies for all the test targets that require them.
[mmeffie: remove MODULE_LIBS from auth/Makefile.in]
Change-Id: If14d27237cc6d18a424c88b0594e8c6cde1888e4
Reviewed-on: https://gerrit.openafs.org/15725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Commit cbc5c4b51f 'tests: Modernize writekeyfile.c' introduced
writeoldkey-t and specified CLEANUP for its afs_XXXXX temporary work
directory. However, Perl will not perform CLEANUP if the script is
still in that directory at exit. Therefore writeoldkey-t leaves behind
an afs_XXXXX temp directory for each run.
Modify writeoldkey-t to cd back into 'tests' before exit, so that
CLEANUP will work as intended.
[mmeffie: save the cwd before cd to the temp dir]
Change-Id: Ida723f9bfca05cc96acf189156d13c8607d210f4
Reviewed-on: https://gerrit.openafs.org/15724
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Commit 71acc392a3 'tests: Generalize temp dir management' introduced
afstest_mkdtemp and afstest_rmdtemp. In afstest_rmdtemp, we invoke rm
with option --one-file-system for Linux and Solaris only.
However, this rm option is new for Solaris 11.4; older Solaris versions
of rm do not support --one-file-system. This causes afstest_rmdtemp to
always silently fail on Solaris 11.3 or older, due to the invalid rm
option.
Correct the #ifdef so ihe --one-file-system option is specified only for
Linux. An autoconfig test could be added in a future commit.
Change-Id: Idfe8a018698b128463aaa9679dfef4e55deef805
Reviewed-on: https://gerrit.openafs.org/15723
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Since the original IBM import, the 'vos dump' command has logic to
adjust the rx dead time for the rx_service of our client conns. But
client conns by definition do not have an rx_service associated with
them, only a service id. Therefore this code has "always" been
harmlessly superfluous (at least, "it was like that when we got it").
Later, with commit 1f3990e5ea vos-getsize-20030619, this logic was
cargo-culted into the then-new 'vos size' command as well.
Remove both instances of trying to update a non-existent service.
No functional change should be incurred by this commit.
(This was discovered during an audit of rx_service timeouts and
rx_ServiceOf usage.)
[mmeffie: update commit message]
Change-Id: Icffd5860be3c38c78cc16d7606d760364c5fa3b4
Reviewed-on: https://gerrit.openafs.org/15726
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
The comment proceeding the block of defines for the static_inline
is incorrect. In addition the indentation is missing for the
preprocessor statements within this block.
The commits:
"printf-sanity-20090317" (3553442536)
"printf-sanity-20090318" (be4d4076f2)
introduced the functions afs_cast_int32() and afs_cast_uint32() and the
associated comment for these functions.
Later the commits:
"static-inline-macros-20090319" (101399171b)
"Rename printf cast helpers and clean up format string warnings"
(ac3e0ed031)
moved afs_cast_int32() and afs_cast_uint32() and later renamed them, but
failed to relocate the associated comment.
Relocate the existing comment for the casting functions and add
an appropriate comment for the "static_inline" macro.
Fix the preprocessor indentation for this block.
There are no functional changes with this commit
Change-Id: Ie49f2dd4a8f18c7855e400f32aa39f49e1a15fb1
Reviewed-on: https://gerrit.openafs.org/15767
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
AFSBackgrounder function executeTask will execute a shell command
specified by its caller. If the command fails for any reason, the
following error message is logged:
"Task failed."
I think we can do better. Add the name of the command, the arguments,
and the status (code) to the log message:
"Task failed: <command> <args> status:<status>."
Change-Id: I41db8d1cd82c8e46ad447bc46fd3cd641e6294fb
Reviewed-on: https://gerrit.openafs.org/14588
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
With Linux 6.10 commit:
"kbuild: turn on -Wextra by default" (f5982cceb3)
there are additional compiler warnings that can turn
into build errors when --enable-checking is used.
"error: ‘inline’ is not at beginning of declaration
[-Werror=old-style-declaration]"
The error is due to the return type preceding the "inline" keyword
in function declarations.
Fix the declarations for file_can_read_pages() and
afs_linux_readpage_fastpath() to have the proper ordering of the
static/inline keywords attributes so they precede the return type.
Just a note that the `static` and `inline` keywords must precede a
function's return type.
Change-Id: I3ff9d45c119e70a90faf18fbf6d49fb6b9adcf33
Reviewed-on: https://gerrit.openafs.org/15768
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
With Linux 6.10 commit:
"kbuild: turn on -Wextra by default" (f5982cceb3)
there are additional compiler warnings that can turn
into build errors when --enable-checking is used.
"error: suggest braces around empty body in an ‘if’
statement [-Werror=empty-body]"
when there is an empty body, e.g.
if (foo)
;
Most cases are due to the macros afs_PutCell and afs_PutServer which are
"empty" macros.
Update the afs_PutCell and afs_PutServer macros so they expand to
do {} while(0)
Add a comment at the definitions for afs_PutCell and afs_PutServer to
document the reason for keeping them.
Add braces to conditionals that have an empty body.
There are no functional changes with this commit.
Change-Id: I359723eb6a19d1c78449902b4f477da131b0fa18
Reviewed-on: https://gerrit.openafs.org/15766
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
The Linux 6.10 commit:
"x86/syscall/compat: Remove ia32_unistd.h" (e2d168328e)
Removed the header ia32_unistd.h since it was just a wrapper for the
unistd_32_ia32.h.
The commit:
"linux-afs-translator-xen-20060731" (29dd792381)
added an ia32_unistd.h include to several files; all were not needed
(as they didn't reference any of the contents from the header file, e.g
_NR_ia32_*).
The commit:
"amd64-hook-ia32-table-20030519" (831e172463)
added an include for ia32_unistd.h to osi_module.c.
A later commit:
"osi-probe-syscall-20050129" (f126dbdbe2)
removed many of the references to defines from ia32_unistd.h, but did
not remove the include for the header.
Currently the only remaining files (linux-kernel-syscall-probe.m4,
LINUX/osi_probe.c and LINUX/osi_syscall.c) continue to reference the
items from ia32_unistd.h, but only when building older kernels that
either don't have LINUX_KEYRING_SUPPORT or when
ENABLE_LINUX_SYSCALL_PROBING is enabled (in both cases, these are only
applicable for older kernels where the asm/ia32_unistd.h file would be
present).
For the files that don't have references (i.e. _NR_ia32_*), we can
simply remove the include for asm/ia32_unistd.h. For the remaining set
of files, we can leave the include for asm/ia32_unistd.h since the code
already has preprocessor conditionals so it's only included for older
Linux kernels where the header file will be present.
We noted above, the include for asm/ia32_unistd.h is already conditional
on the checks for LINUX_KEYRING_SUPPORT and ENABLE_LINUX_SYSCALL_PROBING
so we do not need to add any additional configure checks.
Change-Id: I901b5c0f0ff86272b02f898f3951325533d22f4f
Reviewed-on: https://gerrit.openafs.org/15763
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
The Linux 6.10 commit:
"mm: vmalloc: enable memory allocation profiling" (88ae5fb755)
changed vmalloc from a function to a wrapper macro.
This change results in build errors:
"error: implicit declaration of function ‘vmalloc’; did you mean
‘kmalloc’? [-Werror=implicit-function-declaration]"
when vmalloc is passed as a parameter to the afs_atomlist_create() and
afs_lhash_create() functions.
Add a little wrapper function around vmalloc() to use for the parameter
to afs_atomlist_create() and afs_lhash_create().
Note: A configure test was not needed for this change since the name
and functionality of Linux's vmalloc did not change.
Change-Id: I69c1da9eea5d1de11c1628bbcef427f81f5c01e1
Reviewed-on: https://gerrit.openafs.org/15765
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
The Linux 6.10 commit:
"mm: remove page_cache_alloc()" (3f2ae4ebd5)
removed the page_cache_alloc(), with a note that callers would be using
filemap_alloc_folio instead.
The function filemap_alloc_folio() was introduced in Linux 5.15 commit:
"mm/filemap: Add filemap_alloc_folio" (bb3c579e25)
Add a configure check for filemap_alloc_folio and update the function
afs_linux_read_cache() to use a wrapper that calls filemap_alloc_folio()
if available otherwise calls page_cache_alloc().
Minor whitespace/style cleanup
Note: The function filemap_alloc_folio() was introduced in Linux 5.15,
so this change affects builds using the Linux kernel 5.15 and later.
Change-Id: Ia17aefc38fe9787e54b315c864da726d610b8bb9
Reviewed-on: https://gerrit.openafs.org/15764
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
The afsweb component is marked as obsolete. The last substantial change
other than global changes was in 2002 to add build support for netscape
(afsweb-add-netscape-config-script-20020213 0e04c507b). The
documentation and build configuration implies support for Apache 1.3.6
which was released in 1999; and the Apache 1.3 series as a whole was EOL
in 2010.
By default the afsweb component isn't built.
Clean out the source and references for the afsweb component
(src/afsweb).
Change-Id: Ibb3f91260d4e8d703619fafbad70cd3f7e4da7bc
Reviewed-on: https://gerrit.openafs.org/14849
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
The Java (libjafs) component has been marked as obsolete. Other than
a minor update in 2007 (java-admin-interface-updates-20071214 f72145f79)
there have been no substantial changes since 2003
(java-jafs-update-20030619 af1a0ea03). Changes since then have been
mostly related to source cleanups and a commit in 2012 (Make libjafs
buildable again 967d7201ee).
By default the Java component isn't built and an attempt to build fails
with an error in the src/JAVA/libjafs/Makefile:
make[1]: Entering directory '.../src/JAVA/libjafs'
Makefile:34: *** Recursive variable 'CC' references itself (eventually).
Stop.
Clean out the source and references for the obsolete JAVA component
(src/JAVA).
Change-Id: Idc241e08f62a1b9384a5ce4d0f2fdb13e2f96904
Reviewed-on: https://gerrit.openafs.org/14839
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The CellServDB pathname is dynamically allocated, however the ThisCell
and CellAlias pathnames are constructed with stack allocated buffers,
which limit the supported pathname lengths and makes this code path
susceptible to stack smashing.
Instead, use asprintf() to dynamically allocate the ThisCell and
CellAlias pathnames in order to support long configuration directory
paths.
Change-Id: I117a4109856ce58d875d7104a6b1805789fa55de
Reviewed-on: https://gerrit.openafs.org/15530
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Commit b967654434 (rxdebug-print-values-unsigned-20090512) changed the
output of rxdebug to print counters as unsigned values. However, that
commit missed changing the format of the "free" and "allocated" packets
counters.
Change the printf format specifiers of the "free" and "allocated" packet
counters to print them as unsigned values.
The free packets counter is stored as an afs_int32, which maybe a long
on some platforms. This counter was previously cast to an int type in
commit 1d93f2da22 (rx-warnings-and-prototyping-20010623) to avoid a
format specifier warning. Update the cast to an unsigned int to be
clear this is an unsigned value.
Change-Id: I22eecd0ca8533778bc6459c6ede8694575d20273
Reviewed-on: https://gerrit.openafs.org/15608
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Try to normalize the use of top-level (==) and second-level (--)
heading markers, and make the length of the header marker match
the length of the preceding line.
Wrap some long lines.
Document the existing practice of using braces for one-line conditional
bodies when other branches of the conditional need braces.
Update list of build-dependencies for Debian.
Update size of the git repository.
Mention the Stable Release Manager for backports.
Clarify that --enable-checking=all is not generally useful.
Promote the guidance to document new warning inhibitions into a
full directive (i.e., remove "please").
Add some more line breaks in the section on inhibited warnings to
try to have things line up better in the designated columns.
Change-Id: Ibfb7f3a2ad0ec82a401b4b028ab108f87a9b2b03
Reviewed-on: https://gerrit.openafs.org/15610
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Currently, the userspace rxi_ReadPacket() allocates additional space
for the incoming packet (if needed) with the RX_PACKET_CLASS_SEND_CBUF
class. But we are allocating buffers for receiving packets, and so we
should be using the RX_PACKET_CLASS_RECV_CBUF class.
This is clearly a mistake from OpenAFS 1.0, since all other
packet-receiving code uses RX_PACKET_CLASS_RECV_CBUF, and all other
users of RX_PACKET_CLASS_SEND_CBUF are for sending packets.
This mistake doesn't actually matter for most cases, since the packet
class given to rxi_AllocDataBuf() is ignored for non-KERNEL, and this
code is userspace only. The only time this is actually used is for
UKERNEL. For UKERNEL, this mistake could possibly cause us to
prematurely restrict how much space we allocate here (since the
_SEND_CBUF packet quota is larger than the _RECV_CBUF quota), and
trigger a sendCbufPktAllocFailures event.
To fix this, use the proper RX_PACKET_CLASS_RECV_CBUF class instead,
to match other packet-receiving code paths.
Change-Id: I94077d595102560375d12c766d176b87d427b735
Reviewed-on: https://gerrit.openafs.org/15336
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Our simple.example is not built by default, and currenly does not build
for a couple of reasons:
There are undefined references to symbols in "lib/libafsrpc.a". For
example, there is an undefined reference to "hc_RAND_bytes" in
"rx_InitHost" in libafsrpc.a (rx.o). Modify the rules in
simple.example's Makefile.in to link the object files with hcrypto and
roken to fix this.
Running rxgen fails on objdir builds, because we weren't specifying a
srcdir path for sample.xg. Specify ${srcdir}/sample.xg instead.
Also change simple.example to be built by default to improve its
maintainability. Add it to the "rx_test" top-level make target, since it
depends on libafsrpc and libafsauthent.
[adeason@sinenomine.net: Use the existing rx_test target, slight commit
message edits.]
Change-Id: I9196ab170c594e9b5567e8f299625e4ff07f00eb
Reviewed-on: https://gerrit.openafs.org/15754
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Commit aed4a0c4b9 "afs: avoid panic in
DNew when afs_WriteDCache fails" introduced Doxygen comments for DNew().
However, due to a cut-and-paste error, the name of the second parameter
is incorrect.
Correct the Doxygen comments.
No functional change is incurred by this commit; it is just
documentation.
Change-Id: Ia6183d4aac0946f78982626f195e4a305fe9a481
Reviewed-on: https://gerrit.openafs.org/15757
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
We have several programs in src/rx/test that are not built, and have
bitrotted as a result. Clean them up so they can build again, and
make them all build by default.
Some pieces depend on higher-level libraries (libafsrpc) that depend
on rx, so we cannot build all of these during 'make rx'. So create a
new top-level make target, 'rx_test', that just builds the test
programs.
Remove testqueue.c instead of fixing it, since it just tests the old
rx queue implementation, and we already have tests for the newer
opr_queue.
Remove some obsolete references to rxperf/th_rxperf in here; rxperf
has lived in src/tools/ for quite some time.
Change-Id: I8b8b2c0813531ef185d95f4d6fdce6bc69320b80
Reviewed-on: https://gerrit.openafs.org/14749
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
gcc 4.4.7 (used on RHEL6) throws a warning that 'iterations' is used
uninitialized:
.../src/rxgk/rxgk_crypto_rfc3961.c: In function 'PRFplus':
.../src/rxgk/rxgk_crypto_rfc3961.c:621: error: 'iterations' may be used uninitialized in this function [-Wuninitialized]
It's not actually possible for 'iterations' to be used uninitialized;
we only use it in the 'done' destructor if 'pre_key' is set. But
initialize 'iterations' to 0 to avoid the warning.
Change-Id: I7ec3d033847a8804899f4d9fe163a56586812d4d
Reviewed-on: https://gerrit.openafs.org/15750
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
This reverts commit 432ac5810e (afs:
Remove DFlushDCache()). This also re-adds the caller of DFlushDCache()
removed by commit 4045f3d535
(disconnected-shadow-directory-fixes-20090121), and the prototype
removed by commit 5ad1e6cb90 (dir:
Prototype and function name cleanup).
The removal of the DFlushDCache() call in commit 4045f3d535 seems like
a mistake. If the directory in question has dirty pages in memory, we
need to flush those to the cache before making a copy of the
directory's data, because we read the existing dir's data from the
cache. If we don't flush, afs_MakeShadowDir() might make a copy of the
dcache that is missing updates to the directory blob.
Change-Id: I4f26103b3db5e1ebdbe3324d2d9f67b39ab22e09
Reviewed-on: https://gerrit.openafs.org/15740
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Check for utilities to create both MD5 and SHA256 message digest files.
Search the PATH plus some common directories for the message digest
utilities.
Exit with an error at the end of make-release when one or more message
digest files are not generated.
In addition, omit the path component in the generated files by running
the message digest utilities in the directory containing the files being
checked.
Before:
$ make dist
...
$ cat packages/openafs-1.9.1-333-g4bf33-doc.tar.gz.md5
920793bcd7bd9bc8fbff9016ed2cc8bb packages/openafs-1.9.1-333-g4bf33-doc.tar.gz
After:
$ make dist
...
$ cat packages/openafs-1.9.1-333-g4bf33-doc.tar.gz.md5
920793bcd7bd9bc8fbff9016ed2cc8bb openafs-1.9.1-333-g4bf33-doc.tar.gz
[mmeffie: Add change directories, search PATH, update commit message.]
Change-Id: I0deddc0318846a5000aec9e6b4e189d166b8a539
Reviewed-on: https://gerrit.openafs.org/14566
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This utility has never been built by default, currently does not build
(because RXAFSCB_GetDE doesn't exist), and generates many warnings.
Remove the dead code.
Change-Id: I4c91eb44b3b3c265f0741b9918601abf338b492a
Reviewed-on: https://gerrit.openafs.org/15738
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
In the Linux 6.9 commit:
'filelock: split common fields into struct file_lock_core' (a69ce85ec9)
several fields were relocated into a new structure, file_lock_core,
which was added as a member the file_lock structure. The names where
changed (fl_x to flc_x).
Add a configure test to determine if the new members (flc_type, flc_pid,
and flc_flags) are available as part of the file_lock_core structure.
Add static inline getter/setter routines to handle accessing the
flc_type or flc_pid members in the file_lock_core structure, or the
fl_type, fl_pid members in the file_lock structure as appropriate. Add
static inline function to clear FL_SLEEP in the flc_flag in the
file_lock_core structure or the fl_flag in the file_lock structure as
appropriate.
Minor surrounding white space cleanup.
Change-Id: Idfc66db34bab4d5c764647fefda1b9eebb7af0b0
Reviewed-on: https://gerrit.openafs.org/15708
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Commit 444a971edc (afs: Remove SRXAFSCB_GetDE) removed our
SRXAFSCB_GetDE stub from src/afs, but the same thing also exists in
fsprobe and xstat. Remove those, too.
Change-Id: I8cfbe8524f16be645e50274d3690442965bcc9e5
Reviewed-on: https://gerrit.openafs.org/15737
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The rx/perf test can occasionally fail due to the rxperf server not
being fully initialized before the client started. This can cause test
errors, even without changes to the rx code.
C_TAP_VERBOSE=1 make check TESTS="rx/perf"
...
rx/perf
1..4
ok 1 - Started rxperf server
not ok 2 - single threaded client ran successfully
RPC: threads 30, times 1, write bytes 1048576, read bytes...
ok 3 - multi threaded client ran succesfully
ok 4 - Server exited succesfully
FAILED 2 (exit status 1)
Add a routine that waits for the rx_perf server to become available.
Loop several times trying the connection via the rx_perf client, with
a short delay between retries. If the connection cannot be established,
fail the test.
Clean up trailing whitespace on a couple of lines.
Note: This failure was observed in an OpenAFS buildbot worker that
included a make tests, and which would occasionally fail when there was
no rx related code changes. The intermittent failure could be duplicated
on a slower virtual test system, but would not fail on a faster system.
Thanks to mmeffie@sinenomine.net for the 'wait_for_server' contribution.
Change-Id: Ie11e0d726ce287c45a677f3bb799388121aafc1e
Reviewed-on: https://gerrit.openafs.org/15676
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Add the -o (output) option to the rxperf client specify the output file.
If not specified, the output is written to stdout, as before.
Change-Id: Ibcb375c65a0ff67afea9aba4ba7da7308a273e2d
Reviewed-on: https://gerrit.openafs.org/15731
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Commit 'Cleanup usage of LINUX_VERSION_CODE for older kernels'
(91a576142e) removed the last references to the Linux symbol
'tasklist_lock' in osi_gcpags.c, but did not remove the declaration for
the symbol.
Remove the unused declaration for the tasklist_lock symbol.
Change-Id: I14103397d0cc0f2c15a283c2572bed07090f1a73
Reviewed-on: https://gerrit.openafs.org/15670
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The reference to the Linux symbol key_type_keyring uses a weak
attribute to assist in determining if the symbol is exported. This
method was introduced in commit: 'keyring-updated-20080310' (b7fb842b1c)
as a way to detect if the symbol was exported by the Linux kernel. A
later commit: 'linux-keyring-export-check-20090701' (4ca66112c2)
introduced an autoconf test that eliminated the need for using the weak
attribute, but the commit did not remove the attribute.
On a Debian-12 system on ARM64 the use of the weak attribute in this
case causes an error when loading the kernel module:
"ERROR: could not insert 'openafs': Exec format error".
The error is due to the Linux module loader not supporting the
relocation entry type in the openafs kernel module for the
key_type_keyring. Further investigation showed that this problem could
occur with gcc-12 on a ARM64 system (see below for additional
information).
The code in osi_groups.c uses a pointer, __key_type_keyring, to the
key_type_keyring. When this symbol is exported by the Linux kernel, the
loader would resolve the address and __key_type_keyring would contain
the address. If the key_type_keyring symbol was not exported,
__key_type_keyring would be set to NULL (due to the weak attribute
associated with key_type_keyring).
Remove the weak attribute for key_type_keyring when the configure
test, introduced in the 4ca66112c2 commit, determines that the symbol
is exported (EXPORTED_KEY_TYPE_KEYRING is defined). When the symbol
isn't exported (pre Linux 2.6.22), just set the pointer,
__key_type_keyring to NULL.
NOTE:
The load error was reported on the openafs IRC channel by "clarkb"
The problem of loading the openafs kernel module was also observed
on a NixOS system as well, and is described in the NixOS ticket
https://github.com/NixOS/nixpkgs/issues/284501
A Debian-11 system did not have a problem loading the openafs kernel
module. Investigation of the differences between Debian-11 and Debian-12
showed that the problem is due to a series of fixes in the toolchain
(in particular gcc-12) to address 'Cortex-A53 erratum #843419', which
deals with how the ARM64 ADRP instruction is used. With gcc-12, the
code generated uses a R_AARCH64_ADR_GOT for this particular case (which
isn't supported by the Linux kernel module loader). Gcc-11 created a
R_AARCH64_ABS64 relocation entry type for the symbol.
Change-Id: I3160175c82b47e244c8cedf5ef79fdb0d0dd0002
Reviewed-on: https://gerrit.openafs.org/15668
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Currently, our kernel module on AIX uses the strlcpy and strlcat from
roken, built into strlcat-kernel.o and strlcpy-kernel.o. However, we
don't declare a prototype for strlcat or strlcpy for roken's version
of these (except on LINUX).
To fix this, declare prototypes for strlcpy and strlcat in our
kernel-only roken.h for all platforms that don't define
HAVE_STRLCAT/HAVE_STRLCPY, and redefine them to rk_* variants to make
sure callers are actually using our prototypes and avoid potential
symbol conflicts. Set HAVE_STRLCAT/HAVE_STRLCPY properly to actually
reflect whether a native strlcat/strlcpy is available, and check
HAVE_STRLCAT/HAVE_STRLCPY to control whether we build our own
implementation of the strlcpy/strlcat functions. Always build
strlcat-kernel.o and strlcpy-kernel.o, instead of needing to specify
them in the platform-specific AFS_OS_OBJS; they'll just be empty if
HAVE_STRLCAT/HAVE_STRLCPY are set.
Add roken.h to afsincludes.h, so most KERNEL files will automatically
include it. Since it's now in the OS-independent afsincludes.h, we don't
need it in LINUX/osi_machdep.h, so remove that inclusion of roken.h
Fix a few files that were not properly including
afsincludes.h/sysincludes.h so all files using strlcpy/strlcat will
get roken.h and see the proper prototypes.
Change-Id: I051dbdf3b688835ffe10d278c96f0fb7451ab298
Reviewed-on: https://gerrit.openafs.org/15651
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Since aa76c8f670 'rx: Make struct rx_connection private', the fields
in struct rx_connection have been non-public.
In preparation for a future commit, implement new 'getter' routines for
the three rx_connection timeout values. Each one is fashioned after the
pre-existing 'setters':
- rx_GetConnDeadTime()
- rx_GetConnIdleDeadTime()
- rx_GetConnHardDeadTime()
Change-Id: I0c6f5370dc992316a49f7c8bff36ccf859c2c908
Reviewed-on: https://gerrit.openafs.org/15555
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Since the original IBM code import, rx_NewConnection allocates a new
rx_connection on each call by invoking rxi_AllocConnection -> rxi_Alloc.
rxi_Alloc will panic if no memory is available; therefore
rxi_AllocConnection and rx_NewConnection can never return NULL.
Remove the superfluous checks of the return from rx_NewConnection.
Add equivalent asserts to guard against future breakage.
While here, reorder operations in ubeacon_ReInitServer so we can
eliminate some temporary variables.
Change-Id: I6d00195277d689d80cc6cd7963d8b0a5e5630229
Reviewed-on: https://gerrit.openafs.org/14607
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The Linux 6.8 commit 'string: Remove strlcpy()' (d26270061a) removed the
the strlcpy function from the Linux kernel. The replacement function,
strscpy(), cannot be used as a drop-in replacement as its currently a
Linux kernel specific function and there are differences in the returned
value.
We can use roken's strlcpy() (provided in roken/strlcpy.c).
Create a configure test to that defines its own strlcpy() to test
if the kernel doesn't provide one itself. Note, we need to use a
different function signature for strlcpy() from what the kernel might
have otherwise the test build succeeds when the kernel does provide a
strlcpy().
Update the OpenAFS kernel specific roken.h to define the prototype for
strlcpy when it's not present in the Linux kernel. We need to match the
defines used in the 'real' roken.h so the roken/strlcpy.c can build
properly. Add defines for ROKEN_LIB_FUNCTION, ROKEN_LIB_CALL and
ROKEN_LIB_VARIABLE to the kernel roken.h
Update Linux's osi_machdep.h to include roken.h so the strlcpy protoype
is available.
Update the Linux MakefileProto to include the strcpy-kernel object
when building the kernel module.
Change-Id: I64a5743ba94134538853f51cd6e7a8df19127624
Reviewed-on: https://gerrit.openafs.org/15646
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Ubik invariants (see src/ubik/ubik.p.h) document that for proper quorum
elections, the VOTE service requires:
"#SMALLTIME and #BIGTIME must be larger than
#RPCTIMEOUT+max(#RPCTIMEOUT, #POLLTIME)"
Solving this for VOTE connection Rx dead timeout yields:
Rx dead timeout < 30s
However, setting rx dead time only protects the election if a db host
goes down. If a db server is still alive (responding with acks and
pings) but the VOTE_Beacon reply is delayed for some reason, the entire
election can still take too long and cause a loss of quorum.
Specify a hard dead time in ubeacon_NewVOTEConnection. This ensures
that all VOTE RPCs for all ubik servers (and thus, all elections) will
end within the hard dead time,
Change-Id: I90d0cd2ec9ecd001d448068960592067e6d8dc77
Reviewed-on: https://gerrit.openafs.org/15553
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Ubik invariants (see src/ubik/ubik.p.h) document that for proper quorum
elections, the VOTE service requires:
"#SMALLTIME and #BIGTIME must be larger than
#RPCTIMEOUT+max(#RPCTIMEOUT, #POLLTIME)"
Solving this for VOTE connection Rx dead timeout yields:
Rx dead timeout < 30s
The current default rx_connDeadTime is 12s; if this value is in force
when VOTE client connections are created or recreated, ubik elections
will work correctly.
(Apparently, RPCTIMEOUT 20s was once intended to be used for this value,
but this constant has not been referenced by any live code since the
original IBM code import.)
However, since the original IBM code import, vlserver has set
rx_connDeadTime to 50s. In 1.6.x and older releases, this was only done
after the ubik VOTE and DISK client connections had been established;
therefore the initial VOTE connections had the correct default
rx_connDeadTime of 12s. However, if a VOTE client connection ever failed
(e.g., due to a down vlserver), it would be reestablished with the 50s
timeout. Because this violates a ubik invariant, it may lead to random
quorum disturbances if further vlserver outages occur. This is because
the election results may be delayed for up to 50s until the
multi_VOTE_Beacon to the down vlserver times out. If the vlserver goes
down just a few seconds before the next election, this delay is just
long enough to cause the syncsite's votes to expire (SMALLTIME 60s),
triggering a temporary loss of quorum even when there are sufficient yes
votes to maintain quorum.
As of commit 3e531db9ce (vlserver: rx_SetRxDeadTime before ubik init)
introduced with OpenAFS 1.8.0, rx_connDeadTime is set to 50s for ALL
vlserver connections, including the initial ubik VOTE and DISK client
connections. However, as explained above, this violates a ubik
invariant for the VOTE service. This results in a consistent loss of
quorum every time a vlserver goes down within a few seconds of a new
election, even if there are sufficient votes to maintain quorum.
Create and use a new function ubeacon_NewVOTEConnection to create all
VOTE client connections with an rx dead time VOTE_RPCTIMEOUT which
complies with the ubik invariants. This allows ubik applications like
vlserver to change rx_connDeadTime without affecting ubik election
timing.
Note: vlserver is the only in-tree ubik server affected by this issue.
Even though buserver (src/budb/server.c) also sets a problematic
rx_connDeadTime of 60s at initialization, this is immediately reset to
12s by a subsequent call to rx_InitHost. (This buserver anomaly will be
addressed in another commit.) The other ubik servers (ptserver and
kaserver) always use the default 12s time.
Change-Id: I63e2c46b6097c9c2c89e6e858e3958846c6cb190
Reviewed-on: https://gerrit.openafs.org/14608
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Since the original IBM code import, the magic number '6' has been used
to specify the number of consecutive lost keepalives (ping acks) that
indicate a dead connection. By implication, this also defines the
minimum number of seconds (at the minimum keeplive periodicity of 1
second) before a connection may be considered dead.
Define and use symbolic names for both uses of '6', and document their
relationship. Both have the same assigned value '6', but
RX_PINGS_LOST_BEFORE_DEAD is use as an ordinal count, while
RX_MINDEADTIME is expressed in units of seconds.
The magic number '12' is used in a couple of places for the default
value of rx_connDeadTime. Give this constant a name
(RX_DEFAULT_DEAD_TIME) and use it.
No functional change is incurred by this commit.
Change-Id: I8689062d25b51c557da16e27601297b6856e048a
Reviewed-on: https://gerrit.openafs.org/14621
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
The Linux 6.8 commit 'sysctl: Remove the now superfluous sentinel
elements from ctl_table array' (c8a65501d3) was a clean up commit
that removed the sentinel entry in the ctl_table array (e.g. the
"null" entry at the end of the table).
As of Linux 6.8, including the sentinel entry (.procname =) in the
ctl_table is unnecessary, but doesn't yet break anything. But it is
likely that including the sentinel will start to cause runtime errors in
future Linux versions very soon, so avoid the sentinel when we can, to
avoid possible problems in the future.
Define a new macro that can be used as the last entry of a ctl_table
that will either add a "null" entry, or nothing.
There is not a specific build test we can use within configure, so we
must explicitly test the Linux version to decide if we need to use a
sentinel or not when defining the macro. We are selecting 6.8 to match
the version where the Linux kernel is removing the sentinels from the in
kernel filesystems.
Note: See the Linux merge commits 'Merge tag 'sysctl-6.8-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux' (a05aea98d4)
for more details behind the staged removal of the sentinels in the
ctl_table structures and the potential future change for removing the
actual check for the sentinel within the Linux kernel.
Change-Id: I0f50872e7d08dc198584623337909a180002ab30
Reviewed-on: https://gerrit.openafs.org/15645
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Linux 6.8 commit 'dentry: switch the lists of children to hlist'
(da549bdd15) replaces the dentry lists d_subdirs/d_child with the hlist
d_children/d_sib.
Add an autoconf test for a d_children member in the dentry structure.
Define a macro that uses the applicable Linux function for iterating
over a dentry's children.
Change-Id: I6e8fb9a58c0afd9c383c07c294f64df1fc045585
Reviewed-on: https://gerrit.openafs.org/15632
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The function {PKG}_OpCodeStats() is generated by rxgen, however a
prototype for the function is not generated.
The functions h_ProcMainBody_setup() and h_HeadofOldStyleProc_setup()
in rpc_parse.c emit prototypes for {PKG}_ExecuteRequest() and
{PKG}_TranslateOpCode(), but do not emit a prototype for
{PKG}_OpCodeStats().
Update rxgen to emit a function prototype for {PKG}_OpCodeStats() in the
generated header file.
Use a variable to point to "PackagePrefix[PackageIndex]" in
h_ProcMainBody_setup to improve readability.
{PKG}_OpCodeStats(), specifically RXSTATS_OpCodeStats(), is flagged due
to a missing prototype when building against a Linux 6.8 kernel (which
sets the -Wmissing-declarations and -Wmissing-prototypes compiler flags
as default). Linux 6.8 commit: 'Makefile.extrawarn: turn on
missing-prototypes globally' (0fcb70851f). When building against a
kernel with CONFIG_WERROR=y, the build fails.
Change-Id: If660c21c1a7c452d212cc98fefc1bd61138b7c31
Reviewed-on: https://gerrit.openafs.org/15631
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Ever since commit 5c77a6ca (rxgen: add *TranslateOpcode functions to
XDR code), rxgen generates a PKG_TranslateOpCode function in the
relevant .xdr.c source, which can translate an RPC opcode into the RPC
name. But we never declare this function in a header file, making it
impossible to use without compiler warnings (unless the caller
declares the function itself).
To make it possible to actually use this function, declare this
function in the generated header file.
Change-Id: I013349d28ab1cac8e8aac2ddf6b2cecb64bdcc51
Reviewed-on: https://gerrit.openafs.org/14871
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>