Commit Graph

13877 Commits

Author SHA1 Message Date
Andrew Deason
4dfae3fe35 doc: Update example output for 'fs getfid'
The output for 'fs getfid' was changed in commit d390df097c (fs getfid
output changed for consistency with Windows implementation), but the
manpage still had the old output in its examples. Update the manpage
to reflect the current behavior of 'fs getfid'.

Change-Id: Iea7a92cdb30ca6f935121aba26a072288b404567
Reviewed-on: https://gerrit.openafs.org/15587
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-27 17:30:29 -04:00
Andrew Deason
4f0244e295 LINUX: Refactor afs_osi_Sleep
Instead of having afs_osi_Sleep() call afs_osi_SleepSig() directly,
have both afs_osi_Sleep() and afs_osi_SleepSig() call a common helper
function, afs_linux_sleep(). This makes it easier for future commits
to alter the behavior for the _Sleep and _SleepSig variants.

This commit should incur no noticeable change in behavior. We now
manipulate the signal mask outside of AFS_GLOCK, but this doesn't matter
because 'current' and the signal mask are unrelated to any of our locks.
The signal mask is protected by SIG_LOCK (a wrapper from osi_machdep.h
for various different locks for different kernel versions), and is
handled in this commit the same as it was before.

Change-Id: Id14c44b22cf2a1883deaf6ceec66f71f3f4778a6
Reviewed-on: https://gerrit.openafs.org/15636
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-06-27 17:21:38 -04:00
Andrew Deason
ece18f6426 Kill Irix pre-6.5
Commit d1923139e6 (irix kill efs and start pruning pre-65) removed
most pre-6.5 Irix code, but there are still numerous references laying
around. Get rid of them.

Change-Id: I5e8b092374c616ccec84d195021a8bee78a4cea2
Reviewed-on: https://gerrit.openafs.org/15455
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-27 17:02:29 -04:00
Mark Vitale
dd927a9456 util: Remove duplicate path definitions
Commit f896be7dd5 dirpath-mrafs-additions-20010212 inadvertently
introduced duplicate entries for several AFS path definitions via a
cut-and-paste mistake.

Remove the duplicate definitions.

While here, move a server definition into the correct category.

No functional change is incurred by this commit.

Change-Id: Icf88ee9f74f8a7c72cd7cd2abf8b128f5651f4b5
Reviewed-on: https://gerrit.openafs.org/15420
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-27 15:41:27 -04:00
Michael Meffie
9dd6fa97b6 tests: Add make shell target
Add a makefile target to start an interactive subshell with the
environment required to run tests directly from the command line.  Tests
can also be run from a debugger or from the "runtests" front-end test
runner.

Example usage:

    $ make shell
    ...
    Starting a shell to run tests. Run 'exit' when done.

    # Set the subshell prompt (optional).
    $ PS1="(tests) $PS1"

    # Run tests directly or with a debugger.
    (tests) $ rx/perf-t
    ...
    (tests) $ file rx/perf-t
    rx/perf-t: Perl script text executable
    (tests) $ perl -d rx/perf-t
    ...

    # End the subshell.
    (tests) $ exit
    $

The shell started will be the one discovered by configure, which may not
be the preferred shell for interactive use. To specify a different
shell, define SHELL when running make:

    $ make shell SHELL=/path/to/my/shell

If you use this feature often, you may want to update your shell profile
to automatically set the PS1 when running the test subshell.  For
example, you can append this to your bashrc file:

    # OpenAFS unit test subshell.
    if [[ $MAKECHECK -eq 1 ]]; then
        PS1="(tests) $PS1"
    fi

Thanks to Ben Kaduk for the suggestion.

Change-Id: I8d949d21153396c0da8db186fd35477ad0383f12
Reviewed-on: https://gerrit.openafs.org/15730
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-27 09:10:18 -04:00
Mark Vitale
b78d0b46fc macos: Remove dead prefpane source file afsltd.m
Commit b0818fcdb2 'Cleaned most warning
OSX OpenAFS preference and completed the AFSBackgrounder implementation'
removed mention of afsltd.m from the xcode project, but neglected to
remove the actual source code file afsltd.m.

Remove the dead code.

No functional change is incurred by this commit.

Change-Id: I85f9a0842187c39a40cb8492e60a9371d6ff041d
Reviewed-on: https://gerrit.openafs.org/14591
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-26 21:32:37 -04:00
Michael Meffie
bd263e367d RedHat: Add RPM_BUILD_MODULES and RPM_BUILD_USERSPACE
Add makefile variables to specify if we are to build the userspace
and/or kernel module (kmod) packages.  Continue to build both by
default.

Change-Id: Idc20d5140fcb60cbe84a500b2a7580866008e3e0
Reviewed-on: https://gerrit.openafs.org/15407
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-26 12:59:48 -04:00
Michael Meffie
86d9e3368d RedHat: Add RPM_RELNOTES, RPM_CHANGELOG, and RPM_CELLSERVDB
Currently, when building the source RPM with make, the release notes and
change log are empty, and the CellServDB file is downloaded from
grand.central.org.

Instead, by default, package the NEWS file for the release notes, the
ChangeLog generated by the 'make-release' script, and a CellServDB file
in the source tree.

Add the RPM_RELNOTES and RPM_CHANGELOG makefile variables so we can
override the defaults if builders want to provide their own release
notes and change log files.  Builders can specify empty values on the
make command line to fallback to empty files for the RELNOTES and
ChangeLog (which was the old behavior before this change).

Add the RPM_CELLSERVDB makefile variable to specify the local CellServDB
file to be packaged. By default, package src/afsd/CellServDB from the
working tree (which matches the one specified in the openafs.spec.in
used to build the source rpm).  Builders can specify an empty
RPM_CELLSERVDB on the make command line to have makesrpm.pl download the
CellServDB file from grand.central.org (which was the old behavior
before this change).

Change-Id: Idf1afd1683d87d882d2c7e49058cbf18839e5c9e
Reviewed-on: https://gerrit.openafs.org/15406
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-26 12:59:25 -04:00
Michael Meffie
d3bbd0bda6 Clean up packages directory with make clean
The 'packages' directory is created by the top makefile when building
source tarballs and RPM package files.  Remove this directory when
running 'make clean', just like we already do for the output of the
legacy 'make dest' target.

Change-Id: Icc912e8025d15dd2f3f52c9ffaa9d29f8c19268b
Reviewed-on: https://gerrit.openafs.org/15475
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-26 12:58:55 -04:00
Andrew Deason
cee94469b8 Remove TOP_JLIBDIR
In Makefile.config.in, the Makefile variable TOP_JLIBDIR is set to the
autoconf variable TOP_JLIBDIR. Except, we don't export anything called
TOP_JLIBDIR from autoconf, and never have. So, TOP_JLIBDIR gets set to
the literal string @TOP_JLIBDIR@, which is useless.

To get rid of this cruft, just remove references to this variable in
the top-level Makefile.in and Makefile.config.in, where it was clearly
not working.

[mmeffie: Updated commit message after rebase.]

Change-Id: Ic7e64d3743c99065dea8371bdc1007835c94edbd
Reviewed-on: https://gerrit.openafs.org/13810
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-26 12:57:38 -04:00
Andrew Deason
26f1504915 doc: Mention negative host ACL behavior
Permissions granted by host-based ACLs and non-host-based ACLs are
calculated separately (and transmitted somewhat differently, via
AnonymousAccess). So, if a caller is granted permissions via normal
user-based access, those permissions cannot be removed by host-based
entries in a negative ACL. And conversely, permissions granted by
host-based entries cannot be removed by negative ACLs for
non-host-based entries.

Both negative ACLs and host-based ACLs are uncommon and recommended
against, so this should not be a common combination. But this
limitation is not documented anywhere, so try to mention it in the
fs_setacl manpage, near some other text related to negative ACLs, to
give affected users a chance to figure out why it isn't working.

Change-Id: I13ba2adda1474a5e72271d3e843bb03feec29b67
Reviewed-on: https://gerrit.openafs.org/15340
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-06-26 08:27:30 -04:00
Mark Vitale
4731c80609 macos: AFSBackgrounder: improve detection of afs mount status
The OpenAFS preferences for MacOS provide two ways to start or stop the
cache manager:
 - Preference pane button:	[Startup] or [Shutdown]
 - AFS Menu item:	 	'Startup AFS' or 'Shutdown AFS'

Only one choice (startup or shutdown) is displayed in each UI element,
based on the current state of the cache manager according to
checkAfsStatus().

Unfortunately, checkAfsStatus() determines cache manager state by
issuing a 'df' command and searching the output for AFS_FS_MOUNT "AFS".
This heuristic is fragile and easily fooled by any "AFS" string in the
output.

For example, the OpenAFS installer .dmg mounts itself as "OpenAFS".  The
presence of "AFS" causes checkAfsStatus to believe that AFS is mounted.
Therefore the OpenAFS GUI will display only the "Shutdown" choice,
regardless of the true state of AFS.  If AFS is already shutdown, it is
impossible to start the cache manager via the GUI until the installer
image is ejected.

Modify checkAfsStatus to use a more robust method of determining the
state of AFS:  Iterate over the mounted devices to search for a mounted
AFS filesystem.

Change-Id: I3144de9d53aed0a8673cc8d869107f012728fd7c
Reviewed-on: https://gerrit.openafs.org/14587
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>
2024-06-25 23:16:36 -04:00
Benjamin Kaduk
933ae11e68 xdr: fix a typo in a comment
Obtained from: FreeBSD commit 85604f7008ee7c963bb6dc8417582f9c31bb4ad3.

Change-Id: I0ad947ff22f49cb81df87033d307108c6293b8dc
Reviewed-on: https://gerrit.openafs.org/15476
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2024-06-25 23:10:11 -04:00
Cheyenne Wills
0fe477f267 vos: Fix potential string buffer overflows
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>
2024-06-25 23:09:20 -04:00
Cheyenne Wills
e7b2a5063b afs: afs_Analyze, don't retry if fatal sig pending
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>
2024-06-25 23:02:55 -04:00
Michael Meffie
8a983426fb cf: Fail configure --enable-kernel-module on missing Linux headers
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>
2024-06-25 19:22:39 -04:00
Cheyenne Wills
840cf3b628 afs: Introduce afs_kill_pending()
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>
2024-06-25 00:46:31 -04:00
Cheyenne Wills
9d34ceb2dc afs: Refactor afs_Analyze to use common exit label
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>
2024-06-24 21:54:32 -04:00
Mark Vitale
6218690883 tests: Specify unsigned char arrays in vos-t uuid tests
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>
2024-06-24 17:56:34 -04:00
Andrew Deason
4db3775c0f tests: Redirect diag() to stdout by default
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>
2024-06-24 17:54:59 -04:00
Marcio Barbosa
ff817eca28 roken: Add include guards to roken.h
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>
2024-06-24 17:49:43 -04:00
Mark Vitale
99ca5c0c22 tests: Add missing dependencies for the C-TAP tests
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>
2024-06-24 15:12:11 -04:00
Mark Vitale
fc5341d7ee tests: Cleanup auth/writeoldkey-t temp directory
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>
2024-06-24 15:10:43 -04:00
Mark Vitale
ac9d766b47 tests: Ensure temp file cleanup on Solaris
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>
2024-06-24 15:10:23 -04:00
Mark Vitale
f3fb37d608 vos: Remove client connection rx_ServiceOf() calls
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>
2024-06-24 15:09:46 -04:00
Cheyenne Wills
3412e3b67e stds.h: Fix comment/indentation for static_inline
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>
2024-06-24 09:26:02 -04:00
Mark Vitale
a25912df8d macos: AFSBackgrounder: report details of failed command
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>
2024-06-21 17:33:16 -04:00
Cheyenne Wills
7097eec17b Linux 6.10: Move 'inline' before func return type
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>
2024-06-15 15:17:06 -04:00
Cheyenne Wills
d8b56f2199 afs: avoid empty-body warning
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>
2024-06-15 15:10:45 -04:00
Cheyenne Wills
03b280649f Linux-6.10: remove includes for asm/ia32_unistd.h
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>
2024-06-15 15:08:16 -04:00
Cheyenne Wills
658942f279 Linux-6.10: define a wrapper for vmalloc
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>
2024-06-14 12:02:48 -04:00
Cheyenne Wills
0f6a3a402f Linux-6.10: Use filemap_alloc_folio when avail
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>
2024-06-14 12:02:30 -04:00
Cheyenne Wills
2856a350d0 afsweb: remove unsupported afsweb component
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>
2024-06-13 15:29:05 -04:00
Cheyenne Wills
cbfdf1ed97 JAVA: remove unsupported JAVA component
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>
2024-06-13 12:18:15 -04:00
Michael Meffie
372930175e auth: Allocate ThisCell and CellAlias pathnames
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>
2024-06-13 11:59:11 -04:00
Michael Meffie
bee0566133 rx: Print free and allocated counters as unsigned values
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>
2024-06-13 08:48:44 -04:00
Benjamin Kaduk
bc896094dd CODING: general tidying
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>
2024-06-04 00:54:04 -04:00
Andrew Deason
6ca01529de rx: Use _CLASS_RECV_CBUF in rxi_ReadPacket
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>
2024-05-30 18:38:16 -04:00
Sahil Siddiq
3961e416f6 rx: Cleanup and build simple.example
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>
2024-05-30 18:06:34 -04:00
Mark Vitale
abb15d449c afs: Correct comment typo in DNew()
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>
2024-05-30 14:29:59 -04:00
Andrew Deason
236cb51b83 rx: Cleanup and build src/rx/test
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>
2024-05-23 17:57:32 -04:00
Marcio Barbosa
2d980aaef7 rxgk: Initialize 'iterations'
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>
2024-05-10 14:40:44 -04:00
Andrew Deason
799d789fba afs: Reintroduce and use DFlushDCache()
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>
2024-04-26 18:47:45 -04:00
Stephan Wiesand
407c637157 make-release: create SHA256 checksums too
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>
2024-04-25 12:22:19 -04:00
Andrew Deason
4645618ec1 venus: Remove dedebug
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>
2024-04-18 16:50:37 -04:00
Cheyenne Wills
9937cce3f3 Linux-6.9: file_lock mbrs moved to file_lock_core
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>
2024-04-17 23:49:18 -04:00
Andrew Deason
134d6c1966 Remove more SRXAFSCB_GetDE stubs
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>
2024-04-17 23:07:06 -04:00
Chas Williams (CONTRACTOR)
4aafe1613d bozo: Introduce bnode_Wait()
Create bnode_Wait(), the other half of bnode_Check().

Change-Id: Ib38419ccae5861b8c2491c9d8d8b740ddf81d274
Reviewed-on: https://gerrit.openafs.org/14081
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-04-11 17:45:24 -04:00
Cheyenne Wills
6ace773fdc tests: rx/perf wait for server init before client
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>
2024-04-11 17:45:00 -04:00
Michael Meffie
e6bc50524e rxperf: Add -o option to rxperf client
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>
2024-04-11 14:52:22 -04:00