13533 Commits

Author SHA1 Message Date
Mark Vitale
308ee38a30 afs: Correct comment typo in DNew()
Commit aed4a0c4b91c5ce185547e83bfff443f3d3831f9 "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.

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>
(cherry picked from commit abb15d449ca6792d9145c13c01d573ce32545916)

Change-Id: Ie540b13a040ac47bbaa2f753a9bbd21c046d4b49
Reviewed-on: https://gerrit.openafs.org/15758
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-30 15:44:25 -04:00
Mark Vitale
4022359253 afs: avoid panic in DNew when afs_WriteDCache fails
afs_WriteDCache may fail for an IO error, or if interrupted (EINTR).
Unfortunately, DNew will panic in this case, crashing the entire
machine.

In order to avoid an outage in this case, don't panic.  Instead, reflect
the error back to the caller of DNew.

While here, add Doxygen comments to DNew.

Reviewed-on: https://gerrit.openafs.org/13804
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit aed4a0c4b91c5ce185547e83bfff443f3d3831f9)

Change-Id: I634ce4b3c7c8b6029c5236b51f6ab8c0a5463ce9
Reviewed-on: https://gerrit.openafs.org/15744
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-30 14:35:21 -04:00
Mark Vitale
837e6a4ad2 dir: check DNew return code
Commit 0284e65f97861e888d95576f22a93cd681813c39 'dir: Explicitly state
buffer locations for data' changed DNew and DRead to return a return
code.  However, the callers of DNew were not modified to check the new
return code.  (This commit applied only to the implementations dealing
with AFS directories, in afs/afs_buffer.c and dir/dir.c.  The ubik
implmentations of DNew and DRead, dealing with ubik databases, were not
modified.)

Modify all (non-ubik) callers of DNew to check the return code.  In
addition, modify code as needed so return codes are properly propagated
to the callers.

While here, add Doxygen comments for AddPage and FindBlobs.

Reviewed-on: https://gerrit.openafs.org/13801
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6bd94fe29d1aa6ce61ba02e681defea79770ccdd)

Change-Id: I8d036748fa18365b843a69f2f0710eab31aa723d
Reviewed-on: https://gerrit.openafs.org/15743
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-30 12:38:01 -04:00
Mark Vitale
db39f77f0e dir: check afs_dir_Create return code in afs_dir_MakeDir
afs_dir_MakeDir() ignores the return code from afs_dir_Create() for the
'.' and '..' ("dot" and "dotdot") directories.  This has been the case
from the earliest implementation (MakeDir() calling Create()) in the
original IBM import.

Instead, check the return codes to prevent the possibility of creating
malformed directories.

Reviewed-on: https://gerrit.openafs.org/13800
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit dcce956df4fc8d368962cb36d8b3c801be69a85a)

Change-Id: Ib7066ab307fe6ab0e78407566d0fd32bd6827859
Reviewed-on: https://gerrit.openafs.org/15742
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-30 12:12:46 -04:00
Andrew Deason
3ff3101829 afs: Reintroduce and use DFlushDCache()
This reverts commit 432ac5810e51bb5bb2cf1df0bfebc64d1c4d7a39 (afs:
Remove DFlushDCache()). This also re-adds the caller of DFlushDCache()
removed by commit 4045f3d5350955de91e019b09ad2ed7941f6dadb
(disconnected-shadow-directory-fixes-20090121), and the prototype
removed by commit 5ad1e6cb904b953fbb04603f3ce1466dcc38cd48 (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.

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>
(cherry picked from commit 799d789fbaefc8c4dbcb803b885deb35f4947d26)

Change-Id: I3bffab4bae4214503591ac102aba59c7072b39af
Reviewed-on: https://gerrit.openafs.org/15741
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-30 11:57:13 -04:00
Cheyenne Wills
de7bc4890e 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.

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>
(cherry picked from commit 9937cce3f35f4e3aad0802189457bf16b84d7ab4)

Change-Id: I51343e1c2e360b68eabe2cc4069c25948b6c0729
Reviewed-on: https://gerrit.openafs.org/15739
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-23 17:23:05 -04:00
Cheyenne Wills
95e67f9c3e 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.

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>
(cherry picked from commit 6ace773fdcff0486663a0cc4381d7b6ce2352c04)

Change-Id: I75c6cd1e4e724d4803b62e2f74e5307cb8fcb14d
Reviewed-on: https://gerrit.openafs.org/15736
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-19 18:03:48 -04:00
Michael Meffie
4fc27548be 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.

Reviewed-on: https://gerrit.openafs.org/15731
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit e6bc50524e1bde199f6643d9784fe331577bee90)

Change-Id: I94a2f43c70f9cb5236c3ab4c5d2de66906eb68b3
Reviewed-on: https://gerrit.openafs.org/15735
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-16 13:00:11 -04:00
Cheyenne Wills
dfb6b53a68 Linux: Define afs_thread_wrapper() as static
When building against a Linux 6.8 kernel, functions that are missing
prototypes or declarations are flagged.

We can add the static attribute to functions that are not referenced
outside of the file that implements them to avoid having these functions
flagged by the compiler.

These functions are flagged due to missing prototypes when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

This is an openafs-1.8.x specific commit.

The function afs_thread_wrapper() in LINUX/osi_misc.c on the master
branch was changed to a static function with commit:
 'afs: Drop GLOCK for various Rx calls' (d5e1428a3b)
However this is a larger change than needed to fix the build problem and
the commit could have a significant impact for 1.8.x since it is
changing rx locking.  To avoid introducing such a change, just change
the afs_thread_wrapper() to static as a 1.8.x specific commit.

There are no functional changes in this commit.

Change-Id: I4edc61e6a4989c16ccf41b935e205dbf209bf2a5
Reviewed-on: https://gerrit.openafs.org/15727
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-16 12:43:53 -04:00
Cheyenne Wills
d1a42401fd Linux: Remove weak attribute for key_type_keyring
The reference to the Linux symbol key_type_keyring uses a weak
attribute to assist in determining if the symbol is exported.  This
method was introduced in commit: 'keyring-updated-20080310' (b7fb842b1c)
as a way to detect if the symbol was exported by the Linux kernel.  A
later commit: 'linux-keyring-export-check-20090701' (4ca66112c2)
introduced an autoconf test that eliminated the need for using the weak
attribute, but the commit did not remove the attribute.

On a Debian-12 system on ARM64 the use of the weak attribute in this
case causes an error when loading the kernel module:
  "ERROR: could not insert 'openafs': Exec format error".
The error is due to the Linux module loader not supporting the
relocation entry type in the openafs kernel module for the
key_type_keyring.  Further investigation showed that this problem could
occur with gcc-12 on a ARM64 system (see below for additional
information).

The code in osi_groups.c uses a pointer, __key_type_keyring, to the
key_type_keyring.  When this symbol is exported by the Linux kernel, the
loader would resolve the address and __key_type_keyring would contain
the address.  If the key_type_keyring symbol was not exported,
__key_type_keyring would be set to NULL (due to the weak attribute
associated with key_type_keyring).

Remove the weak attribute for key_type_keyring when the configure
test, introduced in the 4ca66112c2 commit, determines that the symbol
is exported (EXPORTED_KEY_TYPE_KEYRING is defined).  When the symbol
isn't exported (pre Linux 2.6.22), just set the pointer,
__key_type_keyring to NULL.

NOTE:

The load error was reported on the openafs IRC channel by "clarkb"

The problem of loading the openafs kernel module was also observed
on a NixOS system as well, and is described in the NixOS ticket

  https://github.com/NixOS/nixpkgs/issues/284501

A Debian-11 system did not have a problem loading the openafs kernel
module. Investigation of the differences between Debian-11 and Debian-12
showed that the problem is due to a series of fixes in the toolchain
(in particular gcc-12) to address 'Cortex-A53 erratum #843419', which
deals with how the ARM64 ADRP instruction is used. With gcc-12, the
code generated uses a R_AARCH64_ADR_GOT for this particular case (which
isn't supported by the Linux kernel module loader).  Gcc-11 created a
R_AARCH64_ABS64 relocation entry type for the symbol.

Reviewed-on: https://gerrit.openafs.org/15668
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 2f260825b96b76556aba82fc364c841357a23a7d)

Change-Id: Ifce08cb01f0b642ee9c2d90480b8a1766dfc52ff
Reviewed-on: https://gerrit.openafs.org/15728
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-16 12:37:56 -04:00
Cheyenne Wills
7b4802efaf Linux 6.8: Use roken's strlcpy() in kernel module
The Linux 6.8 commit 'string: Remove strlcpy()' (d26270061a) removed the
the strlcpy function from the Linux kernel.  The replacement function,
strscpy(), cannot be used as a drop-in replacement as its currently a
Linux kernel specific function and there are differences in the returned
value.

We can use roken's strlcpy() (provided in roken/strlcpy.c).

Create a configure test to that defines its own strlcpy() to test
if the kernel doesn't provide one itself. Note, we need to use a
different function signature for strlcpy() from what the kernel might
have otherwise the test build succeeds when the kernel does provide a
strlcpy().

Update the OpenAFS kernel specific roken.h to define the prototype for
strlcpy when it's not present in the Linux kernel.  We need to match the
defines used in the 'real' roken.h so the roken/strlcpy.c can build
properly. Add defines for ROKEN_LIB_FUNCTION, ROKEN_LIB_CALL and
ROKEN_LIB_VARIABLE to the kernel roken.h

Update Linux's osi_machdep.h to include roken.h so the strlcpy protoype
is available.

Update the Linux MakefileProto to include the strcpy-kernel object
when building the kernel module.

Reviewed-on: https://gerrit.openafs.org/15646
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 30b18c165752e6d0ce7b6daa6a90453f5e5e6d17)

Change-Id: I8013623e8f735d15bb7d4ac84ed0867f12b77783
Reviewed-on: https://gerrit.openafs.org/15706
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-16 12:31:03 -04:00
Cheyenne Wills
6333fae573 Linux 6.8: Remove ctl_table sentinels
The Linux 6.8 commit 'sysctl: Remove the now superfluous sentinel
elements from ctl_table array' (c8a65501d3) was a clean up commit
that removed the sentinel entry in the ctl_table array (e.g. the
"null" entry at the end of the table).

As of Linux 6.8, including the sentinel entry (.procname =) in the
ctl_table is unnecessary, but doesn't yet break anything.  But it is
likely that including the sentinel will start to cause runtime errors in
future Linux versions very soon, so avoid the sentinel when we can, to
avoid possible problems in the future.

Define a new macro that can be used as the last entry of a ctl_table
that will either add a "null" entry, or nothing.

There is not a specific build test we can use within configure, so we
must explicitly test the Linux version to decide if we need to use a
sentinel or not when defining the macro.  We are selecting 6.8 to match
the version where the Linux kernel is removing the sentinels from the in
kernel filesystems.

Note: See the Linux merge commits 'Merge tag 'sysctl-6.8-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux' (a05aea98d4)
for more details behind the staged removal of the sentinels in the
ctl_table structures and the potential future change for removing the
actual check for the sentinel within the Linux kernel.

Reviewed-on: https://gerrit.openafs.org/15645
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 35c8c1bf0b1cb48178f676ba5bcf16ad59c5a33b)

Change-Id: I34cb7586003e10a6c7438d7205123d57af30585e
Reviewed-on: https://gerrit.openafs.org/15705
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-16 12:20:35 -04:00
Cheyenne Wills
18a2a932df Linux 6.8: use hlist iteration for dentry children
Linux 6.8 commit 'dentry: switch the lists of children to hlist'
(da549bdd15) replaces the dentry lists d_subdirs/d_child with the hlist
d_children/d_sib.

Add an autoconf test for a d_children member in the dentry structure.

Define a macro that uses the applicable Linux function for iterating
over a dentry's children.

Reviewed-on: https://gerrit.openafs.org/15632
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8e0bbe6a07523dd2e7efb3c9d1b4ad9e19fc9bb7)

Change-Id: Ief4c334c4ef3e54822e068dcdf654541e86b9176
Reviewed-on: https://gerrit.openafs.org/15704
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-16 12:09:31 -04:00
Cheyenne Wills
fef1fc6f74 rxgen: Declare generated PKG_OpCodeStats()
The function {PKG}_OpCodeStats() is generated by rxgen, however a
prototype for the function is not generated.

The functions h_ProcMainBody_setup() and h_HeadofOldStyleProc_setup()
in rpc_parse.c emit prototypes for {PKG}_ExecuteRequest() and
{PKG}_TranslateOpCode(), but do not emit a prototype for
{PKG}_OpCodeStats().

Update rxgen to emit a function prototype for {PKG}_OpCodeStats() in the
generated header file.

Use a variable to point to "PackagePrefix[PackageIndex]" in
h_ProcMainBody_setup to improve readability.

{PKG}_OpCodeStats(), specifically RXSTATS_OpCodeStats(), is flagged due
to a missing prototype when building against a Linux 6.8 kernel (which
sets the -Wmissing-declarations and -Wmissing-prototypes compiler flags
as default). Linux 6.8 commit:  'Makefile.extrawarn: turn on
missing-prototypes globally' (0fcb70851f). When building against a
kernel with CONFIG_WERROR=y, the build fails.

Reviewed-on: https://gerrit.openafs.org/15631
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 26bb4d143b31ba027cf2721ac731df67a174c43b)

Change-Id: I9072d22d142b5b7a2f59b0cfc4026066ef1d9501
Reviewed-on: https://gerrit.openafs.org/15703
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-16 00:42:09 -04:00
Andrew Deason
57e0192a69 rxgen: Declare generated PKG_TranslateOpCode()
Ever since commit 5c77a6ca (rxgen: add *TranslateOpcode functions to
XDR code), rxgen generates a PKG_TranslateOpCode function in the
relevant .xdr.c source, which can translate an RPC opcode into the RPC
name. But we never declare this function in a header file, making it
impossible to use without compiler warnings (unless the caller
declares the function itself).

To make it possible to actually use this function, declare this
function in the generated header file.

Reviewed-on: https://gerrit.openafs.org/14871
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 9b2c27fc6d299cb0b23eca3e8cb25b7e0c41b11a)

Change-Id: I2479ff7f6579769b3319b2939ffde60fe570c880
Reviewed-on: https://gerrit.openafs.org/15702
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-12 23:10:12 -04:00
Cheyenne Wills
4c92936aef rx: Add static attribute to internal functions
When building against a Linux 6.8 kernel, functions that are missing
prototypes or declarations are flagged.

We can add the static attribute to functions that are not referenced
outside of the file that implements them to avoid having these functions
flagged by the compiler.

These functions are flagged due to missing prototypes when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

There are no functional changes in this commit.

Reviewed-on: https://gerrit.openafs.org/15626
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 55adceba2d561ec4e89235de329782a68e603a11)

Change-Id: I1b2a6e1c07bd4b75b7b83e177f17865eb903e488
Reviewed-on: https://gerrit.openafs.org/15701
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-12 23:05:49 -04:00
Cheyenne Wills
195f154aaf afs: Add static attribute to internal functions
When building against a Linux 6.8 kernel, functions that are missing
prototypes or declarations are flagged.

We can add the static attribute to functions that are not referenced
outside of the file that implements them to avoid having these functions
flagged by the compiler.

These functions are flagged due to missing prototypes when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

There are no functional changes in this commit.

Reviewed-on: https://gerrit.openafs.org/15625
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit efee796f28b53bf3ffc03186f81790c36c23c94c)

Change-Id: I0d923a65731f825d6c190056b0ccc3d362236706
Reviewed-on: https://gerrit.openafs.org/15700
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-12 23:03:01 -04:00
Cheyenne Wills
90b8dcff36 afs: fix 'ops' variable may be used uninitialized
When the function rxfs_storeInit() has the static attribute, gcc flags
the variable 'ops' as possibly uninitialized.

In function 'afs_CacheStoreDCaches',
    inlined from 'afs_CacheStoreVCache' at
     .../src/afs/afs_fetchstore.c:630:14:
     .../afs/afs_fetchstore.c:535:17: error: 'ops' may be used
     uninitialized [-Werror=maybe-uninitialized]
      535 |         code = (*ops->destroy)(&rock, code);
          |                ~^~~~~~~~~~~~~~
     ...src/afs/afs_fetchstore.c: In function 'afs_CacheStoreVCache':
     ...src/afs/afs_fetchstore.c:567:22: note: 'ops' was declared here
      567 |     struct storeOps *ops;
          |                      ^~~
     cc1: all warnings being treated as errors

This is a false positive report by the gcc compiler.

The function rxfs_storeInit() returns a 0 only when it has successfully
assigned a value to the ops variable, and afs_CacheStoreDcaches() is
only called if the return value from rxfs_storeInit() is 0.

The ops variable is only used within a block that is within a for loop,
which could leave a stray value if the variable isn't initialized within
that loop.

Assigning a NULL to ops is sufficient to avoid the compiler error, and
relocating the declaration of the ops variable into the block where it
is actually used ensures that it's always initialized before its use
within the loop.

Clean up whitespace in the statement that follows the new location for
the ops variable.

Note, this commit is being added before a commit that adds the static
attribute to the rxfs_storeInit() function which also "fixes" the
compiler error (see: afs: Add static attribute to internal functions).

Reviewed-on: https://gerrit.openafs.org/15630
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 36e4c02ff27b9d66755b9544778896b9b1e5c391)

Change-Id: I9d8a07e576c6bf889f8f182c6fc0d34dc997c004
Reviewed-on: https://gerrit.openafs.org/15699
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-12 22:51:44 -04:00
Cheyenne Wills
09f9660fbb rx: Add function prototypes to rx_prototypes.h
The prototype for rxk_NewSocketHost() is not in a header file, but is
defined in the referencing .c file. The ARCH/rx_knet.c files that
implement rxk_NewSocketHost() do not have a prototype (but when the
rx_kcommon.c implementation is used it does have a prototype, since
rx_kcommon.c is the "referencing .c file").

Add the prototype for rxk_NewSocketHost() to rx_prototypes.h and
remove the prototype from rx_kcommon.c

The prototypes for the functions rx_DebugOnOff() and rx_StatsOnOff()
are defined within rx_prototypes.h, but are within a preprocessor
conditional for AFS_NT40_ENV, however the implementation for these
2 functions do not have the preprocessor conditional.

Rearrange the prototypes for rx_DebugOnOff() and rx_StatsOnOff() so they
are outside the AFS_NT40_ENV preprocessor conditional.

These functions are flagged due to missing prototypes when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

There are no functional changes in this commit.

Reviewed-on: https://gerrit.openafs.org/15624
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8528c36b96fe2935f42188caabf4feed0d5dbcbd)

Change-Id: Ieae8be7f89f5c675c6580d8cfb02ea77ce4088f7
Reviewed-on: https://gerrit.openafs.org/15698
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-12 22:48:18 -04:00
Cheyenne Wills
53752b01bc afs: Remove SRXAFSCB* protos from afs_prototypes.h
The prototypes for the afscbint RPC functions (SRXAFSCB_*) implemented
in afs_callback.c are defined in 2 locations, afs_protypes.h and
afscbint.h (which is generated by rxgen).

Remove the protoypes for the SRXAFSCB_* functions from afs_prototypes.h
as they are redundant and are currently out of sync (the prototypes
for SRXAFSCB_GetCellByNum() and SRXAFSCB_TellMeAboutYourself() are
not present in afs_prototypes.h).  Also remove a redundant prototype for
afs_RXCallBackServer() which was prototyped both before and in the
middle of the SRXAFSCB* prototypes.

Since afs_callback.c only pulled in afs_prototypes.h and not afscbint.h,
add an include for afscbint.h to ensure that the all the prototypes for
the SRXAFSCB_* functions are present.

The 2 functions listed above are flagged due to missing prototypes when
building against a Linux 6.8 kernel (which sets the
-Wmissing-declarations and -Wmissing-prototypes compiler flags as
default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Reviewed-on: https://gerrit.openafs.org/15644
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit fae4003b403420d0b548920c7837a2d2b6e432ae)

Change-Id: I7d435455fc60cc10200ee91d0d76534367ab5883
Reviewed-on: https://gerrit.openafs.org/15697
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-12 22:45:59 -04:00
Cheyenne Wills
96932160fa afs: Add afs_xioctl prototyes to afs_prototypes.h
Several .c files have external function prototypes for the afs_xioctl
function, while the implementing files do not have the prototype.

Move these prototypes into afs_prototypes.h so that the prototypes are
available to both the caller and the implementation.

Because the file holding the implementation does not have a prototypes,
afs_xioctl() is being flagged when building against a Linux 6.8 kernel
(which sets the -Wmissing-declarations and -Wmissing-prototypes compiler
flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a Linux kernel with CONFIG_WERROR=y, the build
fails.

Note that the function afs_xioctl() has platform specific
implementations.

Reviewed-on: https://gerrit.openafs.org/15643
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 575d986aa6c18ac27ea42fb66ae8b8cb0e27fe6c)

Change-Id: If746111fdcf6a00459f524711623d322d5fc7942
Reviewed-on: https://gerrit.openafs.org/15696
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-12 18:07:42 -04:00
Cheyenne Wills
c04c2d0722 afs: Move function prototypes into headers
Several .c files contain external function prototypes, while the
implementing files do not have these prototypes.

Move these prototypes into header files so that the prototypes are
available to both the caller and the implementation.

Because the file holding the implementation does not have prototypes,
these functions are flagged when building against a Linux 6.8 kernel
(which sets the -Wmissing-declarations and -Wmissing-prototypes compiler
flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Add the prototypes for the following to afs_prototypes.h:
  exporter_add
  afs_syscall (AFS_LINUX_ENV)
  BlobScan

Remove the prototypes from the .c files where they are referenced.

Reviewed-on: https://gerrit.openafs.org/15642
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 85781d7e83ae4501d8ab267bf55ef63f90f63101)

Change-Id: I74333e99e08af88bebdcbff4767d79397acac358
Reviewed-on: https://gerrit.openafs.org/15695
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-12 18:04:09 -04:00
Cheyenne Wills
8b516820ab afs: Add includes to pick up function prototypes
The functions defined in LINUX/osi_crypto.c, osi_pagecopy.c,
osi_probe.c, and osi_syscall.c have function prototypes defined in
existing header files, however either due to missing includes or
preprocessor conditionals that skip the includes, these function
prototypes are not being pulled in.

These functions are flagged due to missing prototypes when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Add the necessary includes to osi_crypto.c and osi_pagecopy.c and
re-arrange the includes in osi_probe.c and osi_syscall.c to ensure that
the function prototypes are present when building the Linux kernel
module.

Reviewed-on: https://gerrit.openafs.org/15641
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3683f15278e34e13d7272928eaf666f0acc4e1e9)

Change-Id: Iac704fc98d0d685358224049f383d68aa7a105f8
Reviewed-on: https://gerrit.openafs.org/15694
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-12 17:52:52 -04:00
Cheyenne Wills
25e17fe719 afs: Declare init_hckernel_mutex()
The function init_hckernel_mutex() (in rand.c) is flagged due to a
missing prototype when building against a Linux 6.8 kernel (which sets
the -Wmissing-declarations and -Wmissing-prototypes compiler flags as
default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Add a function prototype for init_hckernel_mutex() to afs_osi.h and
remove the prototype from afs_osi.c

There are no functional changes with this commit.

Reviewed-on: https://gerrit.openafs.org/15622
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit ccc2af429710104793fb4659b10697cceab182b3)

Change-Id: Ic5eb4584a980657a01a1cb4411c0c1f03b1f3560
Reviewed-on: https://gerrit.openafs.org/15693
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-05-12 17:47:59 -04:00
Cheyenne Wills
b1c93f1387 Linux 6.8: Add function prototypes for krb5
The external files for heimdal/krb5 do not provide function prototypes
in a header file that is used when building files that we use from
heimdal/krb5 (e.g. crypto.c).

These functions are flagged due to missing prototypes when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

We cannot modify the external source files, however there is the local
OpenAFS include file, krb5_locl.h, that does contain OpenAFS specific
changes.

Add declarations to krb5_locl.h for the functions defined in the
heimdal/krb5 source.

There are no functional changes with this commit.

Reviewed-on: https://gerrit.openafs.org/15621
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 612927dd1dd44bbd08eda790de12b24213583156)

Change-Id: Iaae28186a24c3c5ca4407de9563c8cfed9644921
Reviewed-on: https://gerrit.openafs.org/15692
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-12 17:46:27 -04:00
Andrew Deason
15357006d9 roken: Declare ct_memcmp in hcrypto kernel roken.h
Currently, we build roken's ct.c for our kernel module to provide
ct_memcmp(). We declare a prototype for ct_memcmp() in krb5_locl.h,
and all of our kernel callers of ct_memcmp() include krb5_locl.h, so
all callers get a prototype and avoid "implicit declaration" compiler
warnings.

However, roken's ct.c itself does not include krb5_locl.h, so it
doesn't get a prototype for ct_memcmp(). This is dangerous, since if
the prototype ever slightly differs from the implementation for any
reason, it could cause a variety of issues.

This also causes warnings when building against a Linux 6.8 kernel
(which sets the -Wmissing-declarations and -Wmissing-prototypes
compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

We cannot change ct.c, since it is an external source file. To fix
this, instead move the prototype of ct_memcmp() to our stub
kernel-only roken.h header, which is included by ct.c. Make
krb5_locl.h also include roken.h when building kernel code, so all of
the ct_memcmp() callers also get the prototype.

While we're here, add some informative comments and an include guard
to our previously-blank roken.h stub.

Written in collaboration with cwills@sinenomine.net.

Reviewed-on: https://gerrit.openafs.org/15620
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit be236069e9d26339ed5f9939965bca0dd3f8bf4e)

Change-Id: I1112881938b0585263871f8f83d63b8909b12f0d
Reviewed-on: https://gerrit.openafs.org/15691
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-09 12:22:57 -04:00
Cheyenne Wills
5d2c4a0a8a afs: Add declaration for RXAFS_ResidencyCmd()
The function RXAFS_ResidencyCmd() is 'manually' defined within the
afsint.xg, so a prototype for the function is not defined.

This function is flagged due to a missing prototype when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Add a prototype for RXAFS_ResidencyCmd

There are no functional changes with this commit

The function RXAFS_ResidencyCmd() was introduced with commit:
'rename-residency-from-mrafs-to-osd-20090427' (8655541d1e)

Reviewed-on: https://gerrit.openafs.org/15619
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 1d6cfbc5f627abf3808aae97afb72662301483b5)

Change-Id: I42d0868b83e119b0c3348a3af8aaf5961c040bb2
Reviewed-on: https://gerrit.openafs.org/15690
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-02 12:24:24 -04:00
Cheyenne Wills
73844a4939 afs: Remove afs_DbgDisconFiles()
The function afs_DbgDisconFiles() is not referenced anywhere within the
source tree.

Remove the function afs_DbgDisconFiles().

The commit: 'disconnected-rw-20080922' (433afd4779) introduced
afs_DbgDisconFiles(), but the function was never used.

This function is flagged due to a missing prototype when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Reviewed-on: https://gerrit.openafs.org/15640
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 32bb90047782f41df521bba5ab4aba8b4ed34203)

Change-Id: I61d06515845dbb18a370f7856285596514242e99
Reviewed-on: https://gerrit.openafs.org/15689
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-02 12:17:44 -04:00
Cheyenne Wills
be8001f1d6 afs: Remove SRXAFSCB_FetchData/StoreData
Commit 'client-64bit-file-size-support-20011031' (971b18bc42) introduced
the RPC functions SRXAFSCB_FetchData() and SRXAFSCB_StoreData with RPC
numbers of 65536 and 65537 respectively.

Commit 'more-64bit-file-size-support-20011031' (c5b1a3775f) removed the
references from afscbint.xg, but did not remove the actual code. The
65536 RPC number was reassigned to SRXAFSCB_GetCE64, and the commit:
'This is mostly a rewrite of src/afs/afs_cell.c, and associated changes'
(629d08065) assigned the 65537 RPC to SRXAFSCB_GetCellByNum.

Remove the 2 functions since there are no references other than the
prototype in afs_prototypes.h.

This function is flagged due to a missing prototype when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

Reviewed-on: https://gerrit.openafs.org/15639
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 379f7fc51d411990189ec28e48c91edc87d76120)

Change-Id: I1a3539227d22e6df89d78245634dfeb14943035a
Reviewed-on: https://gerrit.openafs.org/15688
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-02 12:15:20 -04:00
Cheyenne Wills
bb7eaafb2e afs: Remove DFlushDCache()
The function DFlushDcache() is not referenced anywhere within the
source tree.

Remove the function DFlushDCache().

The commit: 'disconnected-shadow-directory-fixes-20090121' (4045f3d535)
removed the code reference to DFlushDCache() and the commit:
"dir: Prototype and function name cleanup" (5ad1e6cb90) removed the
function prototype.  The function was introduced in the commit:
"disconnected-flush-before-shadowing-20090119" (e1cc987ea5).

This function is flagged due to a missing prototype when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 "Makefile.extrawarn: turn on missing-prototypes globally" (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Reviewed-on: https://gerrit.openafs.org/15615
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 432ac5810e51bb5bb2cf1df0bfebc64d1c4d7a39)

Change-Id: Ib8ab79c76c633632215e02235f47fdb1d744e721
Reviewed-on: https://gerrit.openafs.org/15684
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-02 12:09:59 -04:00
Cheyenne Wills
bd2828f1ab afs: Remove dummy_PSetAcl()
The function dummy_PSetAcl() is not referenced anywhere within the
source tree.

Remove the function dummy_PSetAcl().

The commit: 'doxygen-comments-20081010' (4b72f8765c)
introduced the function, but dummy_PSetAcl() has never been referenced
or defined within a header file.

This function is flagged due to a missing prototype when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Reviewed-on: https://gerrit.openafs.org/15618
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 05ca98687d882c72915e91430e29a4f2a36c502c)

Change-Id: Ie4420a365e07d2d8564530e004df75330e86bea5
Reviewed-on: https://gerrit.openafs.org/15687
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-04-26 23:15:54 -04:00
Cheyenne Wills
cc8053e86e afs: Remove afs_osi_UnmaskUserLoop()
The function afs_osi_UnmaskUserLoop() is not referenced anywhere within
the source tree.

Remove the function afs_osi_UnmaskUserLoop().

The commit: 'darwin-afsdb-handler-signal-mask-20040728' (9728182c00)
introduced the function, but afs_osi_UnmaskUserLoop() has never been
referenced or defined within a header file.

This function is flagged due to a missing prototype when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Reviewed-on: https://gerrit.openafs.org/15617
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 587cfce29cb4e014e5b8d96e0433c5e7d2c6729a)

Change-Id: I0fe91a41e8f00773cb1d5976a8c3e39e4415f6bc
Reviewed-on: https://gerrit.openafs.org/15686
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-04-25 13:47:40 -04:00
Cheyenne Wills
4881af8e3c afs: Remove afs_MemExtendEntry()
The function afs_MemExtendEntry() is not referenced anywhere within
the source tree.

Remove the function afs_MemExtendEntry().

The commit: 'memcache: add extend-entry function' (f821c7e5c8)
introduced the function, but afs_MemExtendEntry() has never been
referenced or defined within a header file.

This function is flagged due to a missing prototype when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

Note, afsMemExtendedEntry() was a wrapper for the function
_afs_MemExtendedEntry(), which is still used.

Reviewed-on: https://gerrit.openafs.org/15616
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit eab2a4ae758876bb7547d289f936f9cfc4227cf5)

Change-Id: I37f241a6df33ab15249c6708d5ca820353c8b413
Reviewed-on: https://gerrit.openafs.org/15685
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-04-25 13:45:03 -04:00
Cheyenne Wills
ef7b8c5787 cf: Add function prototypes for linux conftest
The Linux 6.8 commit:
  'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f)

added the compiler flags -Wmissing-declarations and -Wmissing-prototypes
as defaults for all kernel modules builds.  This change causes configure
to fail for various Linux kernel tests.

Update the template used to create the conftest.c file to provide a
function declaration for conftest().

Use a 'static' attribute when defining functions used within tests.

Note: 2 configure tests (LINUX_INIT_WORK_AS_DATA and
LINUX_IOP_CREATE_TAKES_MODE_T) defined nested functions.  Relocate the
nested functions to outside the body of conftest() to avoid compiler
errors due to nested function definitions.

Reviewed-on: https://gerrit.openafs.org/15614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 1440843b80e28db908bd8c264b8adbfb2c95b4d9)

Change-Id: I38acb7b0cb08dec8e9bca5f3792fbf981884a74c
Reviewed-on: https://gerrit.openafs.org/15683
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-04-15 23:40:56 -04:00
Mark Vitale
05ac6149f2 afs: remove dead ICL (fstrace) code
The ICL code (afs/afs_icl.c) which supports fstrace includes a number of
functions that have been dead code since the original IBM code import.
Some of these seem to have been intended to support fine-grained event
tracing, but the implementation was never completed.

Remove the dead code.  No functional change is incurred by this commit.

Reviewed-on: https://gerrit.openafs.org/14555
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit ba58d9912cff07a6f2af7275017cf70115f1a88d)

Change-Id: Ic0a6d5dac200e7e130fa8df66005bdaf291cf088
Reviewed-on: https://gerrit.openafs.org/15682
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-04-15 23:29:00 -04:00
Andrew Deason
9f052c137d afs: Remove SRXAFSCB_GetDE
The GetDE RPC has been commented out from afscbint.xg effectively
since it was introduced, but we still define the SRXAFSCB_GetDE server
stub for it.

This is useless, but also potentially dangerous, since the stub
routine just returns success, without populating the output arguments.
One of the output arguments is a string, and so if this RPC is
actually run, the rxgen-generated server code will try to xdr_string()
that string. Since we never set it to anything, this will result in
xdr_string trying to dereference a NULL pointer.

None of this actually happens currently, since the GetDE RPC is
commented out. But to avoid the above situation if it's ever
uncommented, remove the useless SRXAFSCB_GetDE function.

Reviewed-on: https://gerrit.openafs.org/14488
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 444a971edc47c34efbefed6e332ee6e843ae072b)

Change-Id: I83846d79ce3143571923cb6023075620091f093d
Reviewed-on: https://gerrit.openafs.org/15681
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-04-15 00:41:57 -04:00
Andrew Deason
1e1bf8ebcd LINUX: Minor osi_vfsop.c cleanup
- Fix the formatting on afs_mount/afs_get_sb definitions

- Declare a couple of functions static that are not referenced outside
  of this file

Reviewed-on: https://gerrit.openafs.org/13282
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit fa15fbda0aa0c3810695d9b867d3258b60e76b7c)

Change-Id: I8a32475bf2ddb9c7206aef679947021925697c5a
Reviewed-on: https://gerrit.openafs.org/15680
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-04-12 23:22:22 -04:00
Andrew Deason
fca6fd911e afs: Make afs_AllocDCache static
Nothing using afs_AllocDCache outside of afs_dcache.c. Declare the
function static, to ensure that nobody else uses it, and to maybe
allow for more compiler optimization.

Reviewed-on: https://gerrit.openafs.org/13226
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 4ab70de9641807bd06056f0c1ac79550453b9574)

Change-Id: I6fd9e31c4b2e862174402f731a77c91599893223
Reviewed-on: https://gerrit.openafs.org/15679
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-04-12 23:17:34 -04:00
Mark Vitale
1a36b92977 Make OpenAFS 1.8.11
Update version strings for the 1.8.11 release.
Add final updates to NEWS.

Change-Id: Id66da29a5001f18e8816bcb214f70544474bfaef
Reviewed-on: https://gerrit.openafs.org/15671
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
openafs-stable-1_8_11
2024-03-08 18:09:08 -05:00
Andrew Deason
33fabe9e0b roken: Use srcdir for roken-post.h
roken-post.h is a source file, not a generated file in the objdir.
Specify $(srcdir) so we can work with objdir builds.

Reviewed-on: https://gerrit.openafs.org/13387
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 345a739b7bb6c9c142a2b0fe584fed6c44d6c655)

Change-Id: Ie02f0aaf373bebe74b0eaf8969b712c146a462f8
Reviewed-on: https://gerrit.openafs.org/15638
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-03-07 14:21:43 -05:00
Stephan Wiesand
47c4fb427a Make OpenAFS 1.8.11pre1
Update version strings for the first 1.8.11 prerelease.

Change-Id: I161717ae5670a3261ebbc1fe8fe9c13c18868e74
Reviewed-on: https://gerrit.openafs.org/15527
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
openafs-stable-1_8_11pre1
2024-01-12 23:15:42 -05:00
Michael Meffie
85d4e2dce8 Update NEWS for 1.8.11 pre-release
Add NEWS items for the upcoming 1.8.11 release.

Change-Id: I0b690b0aa273c05f33e68e1ba086863703266b3b
Reviewed-on: https://gerrit.openafs.org/15551
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-01-12 23:14:22 -05:00
Indira Sawant
1f63ffef47 util: Clear owner when unlocking recursive mutex
A race condition where the pthread_recursive_mutex_t::owner that is maintained
by AFS doesn’t match with the thread that is trying to unlock.

This leads to AFS file server and ptserver crash due to assertion failure
where it was trying to unlock the grmutex.

We saw the race more often when our customer migrated their machines from
Power8 to Power9 systems and increased the SMT value from 2 to 4.

fileserver        Assertion failed! file keys.c, line 911.
ptserver          Assertion failed! file userok.c, line 78.

File: keys.c

 889 int
 890 afsconf_GetKeyByTypes(struct afsconf_dir *dir, afsconf_keyType type,
 891                       int kvno, int subType,struct afsconf_typedKey **key)
 892 {
 893     int code = 0;
 894     struct subTypeList *subTypeEntry;
 895
 896     LOCK_GLOBAL_MUTEX;
 897
…
 910 out:
 911     UNLOCK_GLOBAL_MUTEX;   <<<<
 912     return code;
 913 }

Consider a following situation,
cpu0 , cpu1 and T0, T1 and T2 are the cpus and timestamps respectively,

T0: thread1 locks grmutex performs some operations and unlocks the same,
thus has itself set as pthread_recursive_mutex_t::owner. Since presently we do
not reset it, thus, pthread_recursive_mutex_t::owner = thread0.
T1: thread0 starts on cpu0.
T2: thread1 starts on cpu1.
T3: thread0 tries to lock AFS grmutex and acquires corresponding pthread_mutex,
now before thread0 updates pthread_recursive_mutex_t::owner, a context switch
happens.
T3: thread1 on cpu1 tries to acquire grmutex and sees itself as the
pthread_recursive_mutex_t::owner, possibly as it was not reset and updated yet.
So thread1 thinks itself as the owner and proceeds.
T4: thread0 updates the pthread_recursive_mutex_t::owner this time it is also
synced across the cpu caches.
T5: thread1 tries to unlock the grmutex and crashes because now it’s not the
owner of the mutex.

Debugging:

We implemented a circular log to store certain values related to grmutex which
helped in debugging us this further.

({  \
   time_t t; \
   time(&t); \
   LOG_EVENT("%s: Unlocking TID %u: %s:%d owner %lu " \
	     "locked %d  pthread_self %u times_inside %d\n", \
              ctime(&t), (unsigned)grmutex.mut.__data.__owner,\
	      __func__    , __LINE__, \
              grmutex.owner, grmutex.locked, (unsigned)pthread_self(), \
 	      grmutex.times_inside); \
   opr_Verify(pthread_recursive_mutex_unlock(&grmutex)==0); \
})

$614 =   "Mon Sep 11 19:35:34 2023\n: Locking TID 136896:
afsconf_GetKeyByTypes:896 owner 140735030161776 locked 1
pthread_self 2305880432 times_inside 1\n\000 2\n",

$615 =   "Mon Sep 11 19:35:34 2023\n: Unlocking TID 136896:
afsconf_IsLocalRealmMatch:602 owner 140735030161776 locked 1
pthread_self 1836773744 times_inside 2\n",

$617 =   "Mon Sep 11 19:35:34 2023\n: Unlocking TID 136896:
afsconf_GetKeyByTypes:911 owner 140735030161776 locked 1
pthread_self 2305880432 times_inside 1\n\000\061\n",

Solution:

This problem was resolved after resetting thread_recursive_mutex_t::owner in
global mutex unlock function.

Thanks to Todd DeSantis for helping with debugging, review and verification of
this problem.

Signed-off-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-on: https://gerrit.openafs.org/15604
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit e4fda3481dc9ec651377493afbc95bd40f4f1fb2)

Change-Id: I400892121d1b1f63adcd6848e774ede1c4ec5da9
Reviewed-on: https://gerrit.openafs.org/15609
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-01-07 16:36:37 -05:00
Cheyenne Wills
6edf9d350c Linux 6.7: convert to inode a/mtime accessor funcs
The Linux 6.7 commit "fs: new accessor methods for atime and mtime"
(077c212f03) is a follow up to the Linux 6.6 commit "fs: add ctime
accessors infrastructure" (9b6304c1d5)

With the above 6.7 commit, the inode's i_atime and i_mtime are renamed
to __i_atime and __i_mtime and accessing these members should use the
new accessor functions.

This commit is similar to the OpenAFS commit "Linux 6.6: convert to
ctime accessor functions" (072c7934cd1)

Add autoconf tests to detect when we need to use the new accessors and
introduce new wrapper functions to get and set an inode's atime and
mtime.

Note, unlike the (072c7934cd1) commit, we need to add support for
reading an inode's atime and mtime, so this commit has the getters for
the atime and mtime members.

Reviewed-on: https://gerrit.openafs.org/15597
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8962767a7e27f8db9dc9001999edf573be706d66)

Change-Id: If5f58df74f37749b7dfdc52172a8e9573d849ecd
Reviewed-on: https://gerrit.openafs.org/15600
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-01-07 16:34:48 -05:00
Mark Vitale
fd527549c2 dir: Introduce struct DirEntryFlex
The directory package as implemented in AFS-2 allocates space for each
directory entry as a DirEntry struct followed by 0-8 contiguous
DirXEntry structs, as needed. This is implemented by:

 - afs_dir_NameBlobs    calculates the number of blocks needed
 - FindBlobs		allocates and returns index of entry
 - afs_dir_GetBlob	returns pointer to 1st DirEntry struct

After this, we populate DirEntry (and any contiguous DirXEntry blocks)
with open code.  Most existing code writes the entry's name via a string
copy operation to DirEntry->name, which is only 16 bytes long.
Therefore, for dir entry names that are 16 bytes or longer, OpenAFS
routinely does string copies that look like buffer overruns.  This has
not previously caused problems because the OpenAFS code has arranged for
a sufficiently large amount of contiguous memory to be available.
However, this remains undefined behavior in the C abstract virtual
machine; thus compilers are not required to produce safe operation.

Recent changes in the OpenAFS build chain have made this approach no
longer viable:

1) Linux 6.5 commit df8fc4e934c12b 'kbuild: Enable
-fstrict-flex-arrays=3' modified the hardening of several kernel
string operations when running with CONFIG_FORTIFY_SOURCE=y.

2) gcc 13 commit 79a89108dd352cd9288f5de35481b1280c7588a5
'__builtin_dynamic_object_size: Recognize builtin' provides some
enhancements to _builtin_object_size.  The Linux commit above will now
use these when the kernel is built with gcc 13.

When OpenAFS is built under Linux 6.5 or higher and gcc 13 or higher,
the hardened strlcpy will BUG for directory entry names longer than 16
characters.

Since there are multiple places where OpenAFS writes directory names,
there are several symptoms that may manifest.  However, the first one is
usually a kernel BUG at cache manager initialization if running with
afsd -dynroot _and_ there are any cell names 15 characters or longer in
the client CellServDB.  (A 15-character cellname reaches the 16
character limit when -dyrnoot adds the RW mountpoint ".<cellname>".)

Address this by using flexible arrays (standardized with C99). A
flexible array is a variable-length array that is declared with no size
at all, e.g., name[].

Create an autoconf test to determine whether the compiler supports
flexible arrays.

Create a new struct DirEntryFlex.  If the compiler supports
flexible arrays, define name[]; otherwise retain the name[16]
definition.

Whenever we write a directory name, use DirEntryFlex so that any
hardening will be satisfied that there is sufficient space for the name.

However, the actual guarantee that this is true is still provided by the
OpenAFS directory routines mentioned above - all of these remain
unchanged.

The DirEntry struct remains unchanged for continued use in OpenAFS, as
well as for any out-of-tree users of the directory package.

Reviewed-on: https://gerrit.openafs.org/15573
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit e2ec16cf941b0aadfbd54fc2f52edd58b62e232d)

Change-Id: Ibf6d3549ba1e941c957e98ef4875152d865c9358
Reviewed-on: https://gerrit.openafs.org/15599
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-01-06 14:53:33 -05:00
Mark Vitale
9ff2623126 dir: Allow 256-byte directory entry names in salvager
Since the original IBM code import, the DirOK test for directory entry
names has been off-by-1; it says that directory names of length MAXENAME
256 are "too-long".

Modify DirOK to properly validate directory entry names during salvage.
While here, remove MAXENAME in favor of AFSNAMEMAX.

Reviewed-on: https://gerrit.openafs.org/15574
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit 319c1ca87af66425048e498e300e7d8e714fc98a)

Change-Id: Ie4355f9867372f99e4cb283a209953fcda949397
Reviewed-on: https://gerrit.openafs.org/15598
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-01-06 14:41:25 -05:00
Cheyenne Wills
56763a199f Linux: Fix to use time_t instead of time64_t
In commit 'Linux 6.6: convert to ctime accessor functions' (072c7934cd)
the functiom afs_inode_set_ctime was defined to use time64_t when it
should have used a time_t as the data type for the sec parameter.
See the commit 'LINUX 5.6: define time_t and use timespec/timespec64'
(78049987aa).

The time64_t data type was introduced in Linux 3.17.  A build failure
will occur when building on kernels prior to Linux 3.17.

Reviewed-on: https://gerrit.openafs.org/15595
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit a2f77c53073b3999887eb689f396a414b191aba7)

Change-Id: Ie14d9ebbcce6a5d2db0fc38eb4d97aa30f574da9
Reviewed-on: https://gerrit.openafs.org/15596
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2024-01-06 14:36:53 -05:00
Ganesh Chaudhari
519918dfed macos: Add support for MacOS 14.X (Sonoma)
This commit introduces the new set of changes/ files required
to successfully build and package the OpenAFS source code on
MacOS 14.X "Sonoma".

Signed-off-by: GANESH CHAUDHARI <gangovind@in.ibm.com>
Reviewed-on: https://gerrit.openafs.org/15591
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f379e1b255ebb5094c5acc11a9234d5a321818c2)

Change-Id: I913bf9ae5eda0ae571c727e95f9f3ac113df9f64
Reviewed-on: https://gerrit.openafs.org/15602
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ganesh G. Chaudhari <gangovind@in.ibm.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2023-12-21 11:51:25 -05:00
Michael Meffie
88d3cbbf7e CellServDB update 31 October 2023
Update all three copies in the tree, and the rpm specfile.

Reviewed-on: https://gerrit.openafs.org/15601
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 26fdb47dba4852f3525db00c6eb72863d92d74fa)

Change-Id: I4468ff651da06236543e0c7ac7aee247ed03cfa3
Reviewed-on: https://gerrit.openafs.org/15603
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Ralf Brunckhorst <rbrunckhorst@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2023-12-21 11:44:23 -05:00
Cheyenne Wills
4f1d8104d1 Linux 6.6: Pass request_mask to generic_fillattr
The Linux 6.6 commit: "fs: pass the request_mask to generic_fillattr"
(0d72b92883) added an additional parameter to Linux's
generic_fillattr() function.

For openafs, generic_fillattr() is called from the inode_operations
method "getattr", which is implemented in afs_linux_getattr(). The value
for the request_mask parameter is an existing parameter that is passed
to the inode_operations "getattr" method.

Add an autoconf test for 4 parameters to the generic_fillattr function
and update afs_linux_getattr() to pass the request_mask to
generic_fillattr().

Reviewed-on: https://gerrit.openafs.org/15561
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 4fed232b80fb1ad6c0e1dfb42ed8d8e1e6821dd7)

Change-Id: I5cddc56c5e605a6c5e4f7f3691eafec8ca589d2c
Reviewed-on: https://gerrit.openafs.org/15590
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2023-10-12 10:12:17 -04:00