Commit Graph

13893 Commits

Author SHA1 Message Date
Andrew Deason
a7f77245b7 dumpscan: Include time.h
Various parts of dumpscan use ctime(), time(), etc, but don't include
time.h. This causes errors on AIX when using the clang-based xlc 17.1,
such as:

    .../src/tools/dumpscan/parsevol.c:286:35: error: call to undeclared function 'ctime'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                printf("%s%s", field->label, ctime(&when));
                                             ^

Include time.h in these files, so we have declarations for these
functions.

Change-Id: I0247a55952640585ff3b27d2b0e47e09dea531a0
Reviewed-on: https://gerrit.openafs.org/15435
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-28 09:28:02 -04:00
Andrew Deason
a80e32ff63 bozo: Declare tweak_config() void
The AIX-specific tweak_config() clearly doesn't return a value, so
don't say it does.

Change-Id: I8b4535427438cb05c4243b4ef2a875c685c7bb76
Reviewed-on: https://gerrit.openafs.org/15434
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-28 09:26:42 -04:00
Andrew Deason
07223e5581 afsd: Properly declare aix_vmount and vmountdata
The AIX-specific functions aix_vmount() and vmountdata() are missing
return types, and vmountdata is referenced before we declare it. These
cause errors when using the clang-based xlc 17.1:

    .../src/afsd/afsd_kernel.c:386:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    aix_vmount(const char *cacheMountDir)
    ^
    int
    .../src/afsd/afsd_kernel.c:407:5: error: call to undeclared function 'vmountdata'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        vmountdata(vmountp, "AFS", cacheMountDir, "", "", "", "rw");
        ^
    .../src/afsd/afsd_kernel.c:415:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    vmountdata(struct vmount * vmtp, char *obj, char *stub, char *host,
    ^

Declare these 'static' and with proper return types, and move
aix_vmount() so it's after vmountdata().

Change-Id: Ie31dddaae515c914087a34efacfe3427eda22d0b
Reviewed-on: https://gerrit.openafs.org/15433
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-28 09:25:56 -04:00
Andrew Deason
3526f318cf kauth: Do not redefine vfprintf
kaserver.c redefines vfprintf in terms of the historical _doprnt
function, presumably to work around quirks of old platforms. This
should not be necessary anymore, since we call vfprintf() normally in
various other places throughout the tree without trouble.

Using _doprnt causes problems on various platforms (as can be seen by
the long #ifdef before it), including now AIX when using the
clang-based xlc 17.1:

        .../src/kauth/kaserver.c:99:5: error: call to undeclared function '_doprnt'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
            vfprintf(stderr, fmt, pvar);
            ^
        .../src/kauth/kaserver.c:60:35: note: expanded from macro 'vfprintf'
        #define vfprintf(stream,fmt,args) _doprnt(fmt,args,stream)
                                          ^

Instead of adding more conditions to the #ifdef, just get rid of this
weird workaround altogether.

Change-Id: Ie4e965229ed8e8636c6e6405cc33a4937e2ccabc
Reviewed-on: https://gerrit.openafs.org/15431
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-28 09:18:05 -04:00
Andrew Deason
7225c4b848 lwp: Declare LWP_CreateProcess2 for AIX
For most platforms, LWP_CreateProcess2 is #define'd to be the same as
LWP_CreateProcess. For AFS_AIX32_ENV, it is actually a different
function, but we don't declare it in a header. The clang-based xlc
17.1 complains about this:

        .../src/lwp/iomgr.c:670:6: error: call to undeclared function 'LWP_CreateProcess2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                    LWP_CreateProcess2(p, stackSize, LWP_NORMAL_PRIORITY,
                    ^
        .../src/lwp/iomgr.c:670:6: note: did you mean 'LWP_CreateProcess'?
        .../src/lwp/lwp.h:262:12: note: 'LWP_CreateProcess' declared here
        extern int LWP_CreateProcess(void *(*ep)(void *), int stacksize, int priority,
                   ^

Declare this in lwp.h, like we do for the normal LWP_CreateProcess.

Change-Id: I18e6d4436ae4c58f3ffb6fe57158e6869f0b36b5
Reviewed-on: https://gerrit.openafs.org/15430
Reviewed-by: Ben Huntsman <ben@huntsmans.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-28 09:16:48 -04:00
Andrew Deason
ff55ffd0d2 vol: Fix indent in VAdjustVolumeStatistics_r
Fix the indentation of a closing brace that was accidentally
extra-indented in e93786b01b (vol: remove OPENAFS_VOL_STATS).

Change-Id: I25627531fe9f4f07138a917b6c576f6ab22dd036
Reviewed-on: https://gerrit.openafs.org/15464
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2024-06-28 09:15:31 -04:00
Mark Vitale
e02d732525 bubasics: Remove dead code backmon.xg
Since the original IBM code import, this file has not been built or
referenced.  Remove it.

No functional change is incurred by this commit.

Change-Id: Iee8a077767bf7774f7f6b586501aea8a0fc88a3f
Reviewed-on: https://gerrit.openafs.org/15677
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-28 08:30:14 -04:00
Mark Vitale
cddd5e74f7 SOLARIS: Specify -m64 for Solaris 11 kernel builds
For 64-bit Solaris 11 kernel builds on SPARC, use '-m64' instead of the
long-deprecated "-xarch=v9".  This will eliminate the warning:

  Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs

The two options are functionally equivalent, so no functional change
should be incurred by this commit.

Change-Id: I6a4043a9e6dfad509fe1be3dd4071e5e77d31133
Reviewed-on: https://gerrit.openafs.org/15360
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-28 08:25:57 -04:00
Mark Vitale
a48912a40a afs: Remove stray semicolon from PGetTokens2
Since its introduction in commit 5ec5ad5dcc 'New GetToken pioctl',
PGetTokens2 has had a stray semicolon after its closing '}'.  This may
generate a compiler warning:

  warning: syntax error:  empty declaration

Remove the superfluous semicolon.

No functional change is incurred by this commit.

Change-Id: I49c220781d8d9c8d65a28996fbc0dbad803ca49b
Reviewed-on: https://gerrit.openafs.org/15357
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-28 08:24:46 -04:00
Mark Vitale
09aba81c50 Cast LWP event functions to void pointer
When building with Solaris Studio, we receive warnings about the type of
the event passed to the LWP functions.

  CC  /export/home/vagrant/openafs/src/vol/volume.o
  "volume.c", line 662: warning: argument #1 is incompatible with prototype:
     prototype: pointer to void : ".../include/lwp.h", line 273
     argument : pointer to function(enum  {volumeSalvager(7), ...)
                  returning int (E_ARG_INCOMPATIBLE_WITH_ARG_L)

In particular, this happens in src/vol/volume.c because our "events" are
function pointers and the LWP functions expect a pointer to a void.

As needed, cast the event pointer to the expected (void *) to eliminate
the warnings.

[mmeffie: Rebase and update commit message.]

Change-Id: I619a52326914aeff66263e62490de3b6d3b0c9ac
Reviewed-on: https://gerrit.openafs.org/15356
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-28 08:24:27 -04:00
Andrew Deason
9ae6552c4b afs: Remove unused fields in struct vcache
The following fields in struct vcache are never used (despite what
some comments suggest):

- next_seq_offset
- next_seq_blk_offset
- xlatordv
- protocol
- vpacRock

Remove them, to reduce the memory impact of our vcaches. While we're
here, also move around some fields to reduce the amount of unnecessary
padding and reduce #ifdefs:

- diskSlot
- activeV
- vstates
- multiPage
- callback
- vc_error
- dchint
- dcreaddir
- pagewriter_lock
- pagewriters

On amd64 RHEL7, this commit reduces the size of struct vcache by 40
bytes (from 1024 to 984).

Change-Id: I0cb6aedacc3cee56b952b3c5a6ec6a2d318043a8
Reviewed-on: https://gerrit.openafs.org/15211
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-28 08:20:14 -04:00
Mark Vitale
46a7ca3059 Standardize static library archive (lib*.a) options
Convert all hardcoded $(AR) options to use configuration variable
ARFLAGS.

No functional change should be incurred by this commit.

Change-Id: I3a0840e58d8996d60c119c6d5df1ab8d985ba0d8
Reviewed-on: https://gerrit.openafs.org/14896
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2024-06-28 08:17:31 -04:00
Mark Vitale
f4060d9d3c lwp: Remove vestigial Sun pre-8 references
Commit e4c2810f41 'Remove support for Solaris pre-8' overlooked some
references to pre-8 SunOS versions in lwp/Makefile.in.  Remove them.

Change-Id: I3ca5498444569134e1e9720efb96c84c61cdf799
Reviewed-on: https://gerrit.openafs.org/15366
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
2024-06-27 22:02:50 -04:00
Andrew Deason
1fe1dac4c5 rxkad: Cleanup and build src/rxkad/test
We currently do not build 'fc_test' or any of the programs in
src/rxkad/test, and they've bitrotted as a result. Clean them up so
they can build again, and make them all built by default.

Some of these programs depend on higher-level libraries (like
libafsauthent) that depend on rxkad, so we cannot build the test
programs during the top-level 'make rxkad' target. So instead, create
a new top-level target called 'rxkad_test' that just builds the test
programs. Move 'fc_test' into the test subdir to make it easier to
build with the other test programs.

Change-Id: Ic5570efd9076e3e4feec18002d67ce8d58f321d1
Reviewed-on: https://gerrit.openafs.org/14750
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2024-06-27 22:02:23 -04:00
Mark Vitale
fc626da7fd bubasics: use config variable $(AR) to build libbubasics.a
Since the original IBM code import, libbubasics.a has been built with a
hardcoded 'ar' instead of the customary $(AR).

For consistency with the rest of the tree (and in preparation for a
future commit), convert this to use $(AR) instead.

While here, also change the options from 'r' to the more typical 'crv'.

Change-Id: If74e4b92188af9de7f504e3f588b7ee1070425fc
Reviewed-on: https://gerrit.openafs.org/14895
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
2024-06-27 18:47:15 -04:00
Andrew Deason
addee42959 LINUX: Block non-fatal signals when sleeping
Currently, when sleeping on LINUX, we either block all signals
(afs_osi_Sleep), or do not block signals at all (afs_osi_SleepSig).
The only caller of afs_osi_SleepSig() is afs_read(), with the
intention that a user can interrupt the process while it's waiting for
data from an unresponsive server.

This can cause problems when afs_read() is called during a paging
request. In this case, if we are interrupted by a signal, we'll return
an error (EINTR) from afs_linux_readpage(), which causes a SIGBUS to
be sent to the process if it's not already dying.

If we're interrupted by a fatal signal, the process is already dying
so this is fine. But if we're interrupted by a non-fatal signal with
an installed signal handler, the SIGBUS almost always causes the
process to die immediately (and maybe dump core), where it otherwise
would have been fine.

This can be very confusing to a user when it happens, since it's not
immediately obvious that AFS was involved at all; the dumped core
often just shows the SIGBUS generated during a mundane memory load or
store. This situation is most easily seen when running golang out of
/afs, but has also been seen with git and other programs. Anything
that makes heavy use of signals while data is being fetched from /afs
is likely to trigger the behavior.

This problem in general may not be specific to Linux, since the
relevant code path is in cross-platform code (afs_read ->
afs_osi_SleepSig). But notably, this does not happen on Solaris[1];
other platforms may have their own quirks that prevent this from
becoming a problem.

To avoid this for Linux, block all signals except SIGKILL when we're
sleeping via afs_osi_SleepSig(). This allows the process to be killed
if needed, but prevents interruption from any non-fatal signal.

Ideally we would put our process in TASK_KILLABLE state, using
functions like wait_event_killable() or wait_event_state() instead of
blocking signals. But these functions have evolved over time, making
this approach complex or even impossible for various Linux versions in
our current design. Future commits may improve this; for now, do the
simpler fix and just block signals.

We could theoretically still allow non-fatal signals to interrupt
sleeps when called from a syscall like read(). But this is difficult
with the current structure of our Linux integration (syscall i/o is
implemented on top of the paging system, like most Linux filesystems),
and other filesystems tend to not do this.

Also, interrupting a stalled afs_read() in general doesn't currently
work very well anyway. The only callers of afs_osi_SleepSig() look
like this, to wait for a background fetch (BOP_FETCH) to complete:

    while (!code && tdc->mflags & DFFetchReq) {
	/* other locks, etc */
	ReleaseReadLock(&tdc->lock);
	code = afs_osi_SleepSig(&tdc->validPos);
	ObtainReadLock(&tdc->lock);
    }

A signal will cause afs_osi_SleepSig() to return, but then we must
wait to get tdc->lock. The background BOP_FETCH operation will keep
tdc->lock write-locked for the entire fetch from the fileserver
(afs_CacheFetchProc()), so we won't be able to continue until the
fetch completes.

Future commits may improve this, but for now just avoid the
unnecessary SIGBUS errors.

[1] On Solaris, the equivalent code path (afs_GetOnePage()) does not
go through afs_read() with noLock==0, but instead calls
afs_GetDCache() to handle fetching data. It does call afs_ustrategy()
to fill a page, which does technically call afs_read(), but with
noLock==1, and so avoids the case where we submit a BOP_FETCH and
wait for it. Fetching data from the network happens in the
afs_GetDCache() call, and so does not use afs_osi_SleepSig().

Change-Id: Ic9c0c35bd1a2a8fd1901d91dae10cb7719194d25
Reviewed-on: https://gerrit.openafs.org/15637
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-06-27 17:32:34 -04:00
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