Ben Huntsman [Mon, 15 Aug 2022 21:45:12 +0000]
export: Install kernel utilities with execute permissions on AIX
Make sure that cfgexport and cfgafs are installed with execute
permissions. These executables load the AIX kernel modules into
the running kernel and are called by the rc.afs script.
Change-Id: I9434a25dc03033cfcc268e763bf9122349eef3a4
Reviewed-on: https://gerrit.openafs.org/15116
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>
Ben Huntsman [Sat, 13 Aug 2022 18:40:18 +0000]
afs: Fix missing def for timestruc_t on AIX
Include sys/time.h in AIX's osi_machdep.h. This resolves a build
issue where the struct timestruc_t was not defined.
Change-Id: I2acf770f8bfa226915d6257ff6a376ea11e515b9
Reviewed-on: https://gerrit.openafs.org/15107
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Benjamin Kaduk [Tue, 16 Aug 2022 14:48:02 +0000]
rxevent: fix mismatched #endif
We should only assign to 'ev' once, rather than assigning a second
time to an uninitialized value.
Reported by Ben Huntsman and diagnosed by Jeffrey Altman.
Change-Id: I63f50d46658e95ae570dc78dcfeffce973a9e7ed
Reviewed-on: https://gerrit.openafs.org/15106
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Fri, 8 Jul 2022 22:14:26 +0000]
viced: Verify primary host address
Currently, h_stateVerifyHost verifies that all of the valid entries on
h->z.interface are on the host address hashtable. If we don't have a
h->z.interface, we check the primary address h->z.host/h->z.port
instead.
But if we do have a h->z.interface, we don't check h->z.host/h->z.port
at all. Normally, the primary address should always be included in the
h->z.interface list (in a 'valid==1' entry), and so checking the
primary address is redundant. However, currently it is possible in
some edge cases for the primary address to be missing from the
hashtable and to not be listed as a valid address in h->z.interface.
In such cases, we don't flag an error or even log a warning, since we
don't check the primary address separately. (These cases are bugs, and
will be addressed in future commits.)
To detect this case, change h_stateVerifyHost to always check
h->z.host, just like we do for the entries in h->z.interface.
Change-Id: Id88276dfd121194141cb493924bab8d50cb8fcf3
Reviewed-on: https://gerrit.openafs.org/15070
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>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Jan Iven [Fri, 5 Aug 2022 12:46:27 +0000]
systemd: do not load the 'openafs' module on boot
remove /etc/sysconfig/modules/openafs-client.modules, i.e no longer have
systemd run "modprobe openafs" at boot, on RPM-based systems.
This had been introduced with a reference to the Fedora packaging guide
at the time. However, this mechanism was meant just for persistent
driver modules (i.e expected to stay loaded over the runtime) - the
"openafs" module is loaded (and unloaded) by the actual systemd unit.
The systemd unit that processes the above file comes from "initscripts",
this is optional in later Fedoras/RHELs and so the file may not even be
processed (/usr/lib/modules-load.d/ would be an alternative mechanism to
load modules at boot.. if needed).
This change is mostly cosmetic, although RT#135204 showed that having
the "openafs" module loaded without a client running can actually be
harmful.
Change-Id: Iff1762723e25565268220403c383c7cc3fb4797a
Reviewed-on: https://gerrit.openafs.org/15092
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Fri, 8 Jul 2022 21:42:43 +0000]
viced: Show correct port/valid in state_analyzer
state_analyzer currently prints the port for 'host' entries directly.
The port is stored in network-byte order, though, so on little-endian
machines, the port is not displayed correctly.
Fix this by converting to host-byte order when printing. Also while
we're here, print the 'valid' field when showing AddrPort structs,
since we currently don't show it at all.
Change-Id: Id5049f37566f74287d71973957e25c1ffd64982d
Reviewed-on: https://gerrit.openafs.org/15066
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Wed, 23 Jun 2021 18:51:52 +0000]
bozo: Use buffered I/O to send notifier data
Currently, popen() is used to open a pipe to the notifier program, then
notifier messages are formatted in memory then sent with unbuffered I/O,
then the pipe is immediately closed.
Instead of allocating buffers and formatting the notifier string, just
use the buffered stream. Check for write errors with ferror(), and do
not ignore the pclose() return code.
Change-Id: Ib2bd692591171b4f380fc25bec56d4db898d883e
Reviewed-on: https://gerrit.openafs.org/14818
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Michael Meffie [Tue, 19 Oct 2021 15:26:36 +0000]
bozo: Set instance output parameters with strdup
Use strdup() to allocate and copy the SBOZO_EnumerateInstance() and
SBOZO_GetInstanceInfo output strings, instead of preallocating buffers
and filling them with strcpy(). This avoids fixed size memory
allocation and a possible overflow from an unbounded string copy.
Commit
ea276e83e3 (OPENAFS-SA-2019-001: Skip server OUT args on
error) is a prerequisite for this change.
Change-Id: I5b1df645b4ca8fbf42cd39d8c09a9af50d302ad1
Reviewed-on: https://gerrit.openafs.org/14833
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Michael Meffie [Wed, 8 Sep 2021 18:33:25 +0000]
bozo: Add bnode_GetNotifier()
Add the bnode_GetNotifier() function to retrieve the bnode's notifier
string, if one is set. This is a refactoring change to improve code
clarity.
Change-Id: I5c5bb2e8349a3aaa65014a33fa0fdd691dc697dc
Reviewed-on: https://gerrit.openafs.org/14797
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Cheyenne Wills [Thu, 14 Jul 2022 19:03:08 +0000]
linux: Call put_page if errors in aops->readpages
Within the address_space_operations readpages function, when we remove a
page from the page->lru list, we must ensure that the page reference
count is decremented via put_page.
There are two cases within the flow of the afs_linux_readpages where
we remove a page from the page->lru list, but fail to put_page() it.
- If we go through afs_linux_bypass_readpages we fail to call
put_page() if the page index is larger than the index calculated from
i_size_read for the cache file.
- If get_dcache_readahead returns an error in afs_linux_readpages, we
fail to put_page(). This can happen if there was a problem opening
the cache file, or if the cache file has no a_ops->readpage.
Add a call to put_page in afs_linux_bypass_readpages when the page index
is greater than the index calculated from the i_size_read for the cache
file.
Add a call to put_page in afs_linux_readpages if get_dcache_readahead
returns an error.
Note: The condition of not calling put_page if there was an error
opening the cache file was introduced by commit 'LINUX: Don't panic on
some file open errors' (
af73b9a3b1f), which replaced an assert with
code that handled the error. The other conditions have existed since
the relevant code was introduced.
In addition, the problems addressed by this commit are not present in
Linux kernels 5.8 and greater when the commit 'Linux-5.18: replace
readpages with readahead' (
7a181415db1) is present, because we call
afs_linux_readahead instead of afs_linux_readpages.
Change-Id: Ibabd6519601366d7d944138b1f663fbb6002a879
Reviewed-on: https://gerrit.openafs.org/15068
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Mon, 18 Jul 2022 23:17:26 +0000]
build: package ltmain.sh in the libafs_tree
Commit
0a58d2188[1] "cf: Run AFS_LT_INIT after setting CC" moved the
location of LT_INIT (libtool initialization) to a common macro, so it is
now expanded in configure-libafs. This breaks the linux DKMS packaging,
which uses configure-libafs to build the kernel module, since the
ltmain.sh aux file is not included in the dkms package.
For now, just include the ltmain.sh aux file in the libafs_tree files to
fix DKMS build. Later, we should restructure the autoconf macros so the
LT_INIT macro is not expanded in the configure-libafs configure script,
since we do not need libtool to build the kernel module.
Thanks to Alex T Prengel for reporting this issue on the openafs-info
mail list.
1)
0a58d21881d7e91deccb416e8d2c272e14b412dd cf: Run AFS_LT_INIT after setting CC
Change-Id: I5aec1711ab33cc619c233889db3f55f83343c4d9
Reviewed-on: https://gerrit.openafs.org/15076
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Tue, 5 Jul 2022 16:33:19 +0000]
Linux-5.19: Remove flags from aops->write_begin
The Linux 5.19 commits:
fs: Remove aop flags parameter from grab_cache_page_write_begin()
(
b7446e7c)
fs: Remove flags parameter from aops->write_begin (
9d6b0cd7)
removed the flags parameter from the address space operations
'write_begin' as well as removing the flags parameter from the Linux
function 'grab_cache_page_write_begin'.
Add an autoconf test to see if grab_cache_page_write_begin takes 2 or
3 parameters. Use this as a test to determine if the address space
operations 'write_begin' takes a flags parameter.
Create a version of afs_linux_write_begin that does not take a flags
parameter, which also calls grab_cache_page_write_begin without flags.
Change-Id: Ib98c615e6964202748c78037c9ecac459fc3372b
Reviewed-on: https://gerrit.openafs.org/15041
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>
Cheyenne Wills [Tue, 5 Jul 2022 17:45:29 +0000]
Linux-5.19: Rename aops readpage to read_folio
With Linux commits:
mm,fs: Remove aops->readpage (
7e0a126519)
fs: Introduce aops->read_folio (
5efe7448a1)
the address space operations method 'readpage' was replaced with
read_folio. The operation behaves the same, except instead of taking a
struct page parameter, the new function takes a folio structure.
Add an autoconf test for the address space operation entry read_folio
Replace the references to an address space operations' readpage with
read_folio. Note that the function Linux page_folio can be used to
obtain the required pointer to the folio for a given page.
Introduce afs_linux_read_folio that accepts a folio and calls
afs_linux_readpage with the page associated with that folio.
Change-Id: I2c43a9bfb26042f7cc2c55807d46b33769f2594a
Reviewed-on: https://gerrit.openafs.org/15040
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Cheyenne Wills [Tue, 5 Jul 2022 16:28:10 +0000]
Linux: Introduce file mapping readpage helpers
Create a helper function that determines if a file's
i_mapping->a_ops->readpage
is NULL.
Create a helper function that calls a file's
i_mapping->a_ops->readpage
There are no functional changes with this commit.
Note: This commit isolates references to 'readpage' so that future
commits can change the name in a more straight forward manner.
Change-Id: If3ad33766c7a3bce27c2aa3c3b409157264230b1
Reviewed-on: https://gerrit.openafs.org/15039
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Mon, 4 Jul 2022 15:04:19 +0000]
autoconf: Remove redundant exit statements
The AC_MSG_ERROR macro prints an error message to the standard error
output and exits configure with exit-status (1 by default), so the
exit statements following AC_MSG_ERROR are never reached.
Change-Id: I7a4e6e4501e55fb49eab8d7773d281a36f868525
Reviewed-on: https://gerrit.openafs.org/15049
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Mon, 4 Jul 2022 14:58:30 +0000]
autoconf: Remove unused SUBARCH variable
The SUBARCH variable was added in the work-in-progress commit
f3cd6ca06315691c46f9a3f917099efaed57fe3d (linux-26-progress-
20040412)
The last use of SUBARCH was removed in commit
51799f7cc0337e6ecc7892be7b8700737712b5e5 (linux-try-kbuild-
20060804)
Change-Id: I9b28655f5d671850f4adc8b1d0ee015eca9480a6
Reviewed-on: https://gerrit.openafs.org/15048
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Wed, 29 Jun 2022 22:18:01 +0000]
CODING: Fix a couple of typos
Change-Id: I2792f710a4bc61ea755b5231a9819971754ed808
Reviewed-on: https://gerrit.openafs.org/15046
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>
Cheyenne Wills [Mon, 27 Jun 2022 14:38:25 +0000]
Linux-5.18: replace readpages with readahead
The linux 5.18 commit 'fs: Remove ->readpages address space
operation' (
704528d8) removes the address_space_operations operation
"readpages", which is replaced with the "readahead" operation
that was introduced with the 5.8 commit 'mm: add readahead address
space operation' (
8151b4c8).
When readahead is called, the pages in 'rac' have already been added to
the lru caches and are locked. For each page that we get from the 'rac'
(i.e. from 'readahead_page(rac)'), we must unlock and put_page the page;
if we successfully populated the page with data, we also set
PageUpToDate. If we don't process all the pages in 'rac', the caller
will handle cleaning up any remaining pages; we don't need to unlock/put
them or touch them at all.
(See Linux Documentation/filesystems/vfs.rst)
Add an autoconf test to detect the presence of 'readahead' in the
address_space_operations structure.
For the implementation of readahead (which is contained in Linux's
osi_vnodeops.c):
Add new functions 'afs_linux_bypass_readahead' and 'afs_linux_readahead'
as replacements for 'afs_bypass_readpages' and 'afs_linux_readpages'
when the linux kernel supports the readahead operation.
Notes:
In afs_linux_bypass_readahead, the pages are already locked and are
already in the page cache, we just need to place the page into the
iovecp. The page's refcount will be decremented and will be unlocked
when processing the read request.
In afs_linux_readahead, the lrupages is needed in case a page is added
to the cachefp's mapping in afs_linux_read_cache (which also handles
unlocking the page).
In afs_linux_readahead, if there is no tdc, we must still unlock the
page otherwise the read process will wait on that page.
Change-Id: I6960a2fc14df85869c373f3e3afbf3ee5eb7228f
Reviewed-on: https://gerrit.openafs.org/14953
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Wed, 29 Jun 2022 14:33:23 +0000]
Change klog.krb5 -lifetime option help description
Change the klog.krb5 -lifetime help description to show this option is
ignored. This option name was copied from the krb4 command but is not
implemented for the krb5 version. It is retained for command line syntax
compatibility.
Change-Id: I7f4e81609cf3613a7173e2b6f2e6b1bfb8cd4dc8
Reviewed-on: https://gerrit.openafs.org/15045
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Tue, 27 Jul 2021 18:35:23 +0000]
bozo: Let the bnode operations allocate output strings
The GetInstanceParm and GetStatus bosserver RPCs return output strings
by first allocating a 256 byte buffer then calling the bnode operations
bnode_GetParm() and bnode_GetString() to fill those buffers. The RPC
output strings are automatically freed by XDR.
In order to support large output strings in the future, change these
bnode operations to allocate the output strings and to use safe string
functions to duplicate and format strings.
Update the ez, cron, fs, and dafs getstring and getparm operations to
allocate the output string or return an error.
Return BZIO over the wire when a string cannot be allocated, since
ENOMEM is not a portable wire error code. (Use BZIO to be consistent
existing code added in commit
fda2bc874751ca479365dc6389c0eebb41a0bda1
(Allocate pathname buffers dynamically).
Commit
ea276e83e3 (OPENAFS-SA-2019-001: Skip server OUT args on
error) is a prerequisite for this change.
Change-Id: Id16184efc95d614846b912177b220c8e87b7a88b
Reviewed-on: https://gerrit.openafs.org/14766
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Michael Meffie [Wed, 22 Jun 2022 17:31:40 +0000]
bozo: Check for negative simple bnode parameter index
The simple (ez) bnodes have only one parameter, which is accessed as
index 0. A check is made for values greater than 0, however the index
argument is a signed type, and a check for negative indices is missing.
Explicitly check for non-zero index values when retrieving simple bnode
parameters, and if not zero return BZDOM.
The other bnode types already check for specific (positive) index
values, so only the simple bnode type needs to be updated.
Change-Id: I8764af6c975431caf26c25a371cf6db10e6e7fec
Reviewed-on: https://gerrit.openafs.org/15043
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Tue, 7 Jun 2022 18:19:44 +0000]
Prevent sscanf format widths from overrunning array
cppcheck noted these instances of sscanf could wipe out the ending null
terminator. Length is now macro expanded rather than hard coded and the
array itself is one unit longer to avoid the overrun.
Change-Id: Ic76e1b74701d7fb7b722ba1f8eae3a4d16e91f65
Reviewed-on: https://gerrit.openafs.org/13136
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Tue, 21 Jun 2022 15:50:41 +0000]
opr: replace AFS_STRINGIZE with opr_stringize
To avoid adding new includes for afs/afsutil.h in order to use
'AFS_STRINGIZE', create a replacement, 'opr_stringize', in afs/opr.h.
Replace the usage of 'AFS_STRINGIZE' with opr_stringize and remove the
definition of 'AFS_STRINGIZE'
Change-Id: I6d12ed101b6f9246a59c46024c216c7fe25bc1c8
Reviewed-on: https://gerrit.openafs.org/15029
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>
Cheyenne Wills [Tue, 7 Jun 2022 17:14:55 +0000]
lwp: Ignore dangling-pointer warning in process.c
In lwp/process.c the address of a stack variable is saved as part of
creating a new context. GCC-12 is flagging the statement with a
diagnostic:
./process.c:46:24: error: storing the address of local variable
‘stackvar’ in ‘*savearea.topstack’ [-Werror=dangling-pointer=]
46 | savearea->topstack = (char *)&stackvar;
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In this particular case, the code is meaning to save the address of the
stack in preparation of setting up a new context, which requires knowing
the address the current stack.
The diagnostic is changed from a warning to an error when configured
with --enable-checking.
Set the env variable CFLAGS_NODANGLING_POINTER to
'-Wno-dangling-pointer' if the compiler supports the option and update
the src/lwp/Makefile.in to use the flag when compiling process.c
Change-Id: Ibec956b505c0edad9b74d63b9bb7805f6f0cba01
Reviewed-on: https://gerrit.openafs.org/14957
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>
Cheyenne Wills [Tue, 21 Jun 2022 15:57:40 +0000]
afs: Avoid always-false NULL test on AFSTOV(avc)
GCC-12 is flagging a comparison with the following diagnostic:
src/afs/afs_vcache.c:3161:25: error: the comparison will always
evaluate as ‘false’ for the address of ‘v’ will never be NULL
[-Werror=address]
3161 | AFSTOV(avc) == NULL || vType(avc) == VDIR ||
| ^~
When the vcache structure does not have the vnode embedded the expansion
of the AFSTOV macro results in:
((avc)->v)
which tests contents of a 'v'.
When the vcache structure does have the vnode embedded, the expansion of
the macro results in:
(&(avc)->v)
which tests the address of 'v', which will never be NULL in this case.
Update afs.h to add a new define 'AFS_VCACHE_EMBEDDED_VNODE' when the
vcache structure contains an embedded vnode structure. Restructure the
preprocessor statements for the AFSTOV definition
Avoid testing AFSTOV(x) against NULL when AFS_VCACHE_EMBEDDED_VNODE is
defined.
The diagnostic is changed from a warning to an error when configured
with --enable-checking.
Change-Id: Ib72647fa23e5a7ecd96772b04c6ef76540f44535
Reviewed-on: https://gerrit.openafs.org/14956
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>
Michael Meffie [Wed, 8 Jun 2022 13:03:32 +0000]
bozo: Return BZDOM when BOZO_EnumerateInstance index is negative
The BOZO_EnumerateInstance looks up a bnode instance with a zero-based
index (anum) and returns BZDOM when the index is out of range for the
current list of bosserver bnode instances.
The index is defined as a signed integer by the RPC, but the implementation
does not check for a negative index. Currently, the implementation
returns an empty string when a negative (out of range) index is given.
Instead, return a BZDOM error to indicate the index is out of range.
Commit
ea276e83e37e5bd27285a3d639f2158639172786 (OPENAFS-SA-2019-001:
Skip server OUT args on error) is a prerequisite for this change.
Change-Id: I4df5d35aaccdbfcbe8e8dcc4fa1aa45ee06b06ab
Reviewed-on: https://gerrit.openafs.org/15031
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Wed, 8 Jun 2022 12:36:10 +0000]
bozo: Use BZIO for out of memory errors
Return a BZ error code over the wire when memory cannot be allocated,
since ENOMEM is not a portable wire error code.
Use BZIO for these errors to be consistent with the existing bosserver
code added in commit
fda2bc874751ca479365dc6389c0eebb41a0bda1 (Allocate
pathname buffers dynamically).
The incorrect error codes were added in:
fda2bc874751ca479365dc6389c0eebb41a0bda1 Allocate pathname buffers dynamically
381597851b659f00747b22efc24240073c4403ce bozo: Fix problems found by static analysis
Change-Id: I6e19aba226441159ba9e7d4173d2145f5d6745c2
Reviewed-on: https://gerrit.openafs.org/15030
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Thu, 9 Jun 2022 19:20:02 +0000]
afs: introduce get_dcache_readahead
Relocate the block of code that obtains the dcache for a readahead
operation from the afs_linux_readpages function into its own static
function.
Change-Id: Iaaf9523532e292a1f2426d5ced65ddfbceb5d060
Reviewed-on: https://gerrit.openafs.org/14962
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Mon, 6 Jun 2022 18:27:43 +0000]
afs: introduce afs_alloc_ncr/afs_free_ncr
There is duplicated code for initializing a nocache_read_request
and also freeing the associated storage in certain cases. Create a set
of helper functions that allocates and frees a nocache_read_request and
its associated structures.
afs_alloc_ncr allocates a nocache_read_request structure and if not
UKERNEL, will allocate and initialize the associated uio and iovec
structures.
afs_free_ncr releases a noncache_read_request structure and the
associated uio and iovec structures if not UKERNEL.
Update locations that allocate/free nocache_read_request structures to
use the new functions.
Change-Id: I80c0b4eb036bcb1223b73f4c1de2c12be362de42
Reviewed-on: https://gerrit.openafs.org/14954
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Fri, 18 Feb 2022 01:32:41 +0000]
afs: Use literal NULL for NULL function pointer
The clang compiler complains that this function pointer cast is not a
prototype.
.../osi_file.c:141:27: error: this function declaration is not a
prototype [-Werror,-Wstrict-prototypes]
afile->proc = (int (*)())0;
^
void
Just use NULL instead of trying to create a cast to 0.
Change-Id: I3adb22cb38db8c854d9313ec9eb2b008a4e9a9db
Reviewed-on: https://gerrit.openafs.org/14902
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>
Cheyenne Wills [Fri, 18 Feb 2022 01:27:02 +0000]
cf: Avoid nested C functions built by autoconf
Currently, two of the Linux-related autoconf macros try to compile code
containing nested C functions (AC_CHECK_LINUX_OPERATION and
LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID). For example, the
AC_CHECK_LINUX_OPERATION check for 'follow_link' generates this code
where 'op' is a nested function inside 'conftest':
#include <linux/module.h>
#include <linux/fs.h>
void conftest(void)
{
struct inode_operations ops;
const char *op(struct dentry *dentry, void **link_date) {
return (const char *)0;
};
ops.follow_link = op;
}
Nested functions are a gcc-specific feature, and are not supported by
other compilers (e.g. clang), causing these checks to always fail when
using clang, leading to incorrect configure results.
To fix this, change AC_CHECK_LINUX_OPERATION and
LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID macros to just define the
relevant function as a proper top-level function.
(these were discovered by forcing a clang build of both the Linux kernel
and the openafs kernel module)
Change-Id: I1f5410d6702025d228b6ed80e7b86b9745ffe3dc
Reviewed-on: https://gerrit.openafs.org/14901
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>
Cheyenne Wills [Tue, 1 Mar 2022 22:35:07 +0000]
cf: Use -Werror when checking for -Wno-* flags
When detecting valid compiler flags clang behaves differently than gcc
for certain types of flags. Specifically, gcc will ignore an unknown
"-Wno-someflag" while clang will issue a warning. If using clang and
--enable-checking is specified, this difference causes a build failure
because the warning for the unknown flag is turned into an error.
The autoconf macro AX_APPEND_COMPILE_FLAGS (via the underlying macro
AX_CHECK_COMPILE_FLAGS) looks specifically for errors and not warnings
to determine if the flag is valid. In order to properly catch the above
type of unknown compiler flags, a '-Werror' must be passed as an
extra-flag.
Update the autoconf functions that use AX_APPEND_COMPILE_FLAGS to use
'-Werror' as an extra flag when testing for "-Wno-..." flags.
Note, for gcc, the test may (incorrectly) think that the compiler
supports the given flag, but that is okay, since the flag will be
ignored by gcc during the build without raising any warnings or errors.
Change-Id: I9e4dabf04a3b019cb1ea58a4b2ac1cf0fc8d1e71
Reviewed-on: https://gerrit.openafs.org/14900
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>
Andrew Deason [Sat, 4 Jun 2022 23:36:20 +0000]
finale: Use unified_afs.o from objdir
Commit
bffc354ff7 (finale: translate_et (Unix) support for UAE) added
a dependency on unified_afs.o, but it uses a srcdir path. For objdir
builds, this will only exist in objdir and not srcdir, so make cannot
find the file and the build fails.
Use an objdir path instead.
Change-Id: Ie581ad9cf587dfccd73bcb41b942ea727a683e1f
Reviewed-on: https://gerrit.openafs.org/15025
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Fri, 3 Jun 2022 18:40:53 +0000]
Remove osi_GetTime from param.i386_dfbsd_23.h
Commit
a5c3dfe99f (afs: Move osi_GetTime out of param.h) moved all
osi_GetTime definitions from param files into osi_machdep.h for the
given platform. But while it added an osi_GetTime for the DFBSD
osi_machdep.h, it forgot to remove the osi_GetTime definition from the
only DFBSD param file we have, param.i386_dfbsd_23.h.
Get rid of the lingering extra definition.
Change-Id: Ic391922e9fe2551065342b4f9ef3b148402d70b6
Reviewed-on: https://gerrit.openafs.org/14992
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Wed, 11 May 2022 14:48:52 +0000]
afsd: Avoid fscanf overflows when paring cacheinfo
clang-14 is producing the following diagnostic:
afsd.c:581:44: error: 'fscanf' may overflow; destination buffer in
argument 3 has size 1024, but the corresponding specifier may
require size 1025 [-Werror,-Wfortify-source]
fscanf(cachefd, "%1024[^:]:%1024[^:]:%d", tCacheMountDir,
fscanf is being used to parse the contents of a file and the buffer
sizes are hardcoded. Simply increase the size of the 2 buffers by 1.
The diagnostic warning is changed to an error when configured with
--enable-checking.
Change-Id: Iefbc4e87242232531a266e876fe779476b42fb62
Reviewed-on: https://gerrit.openafs.org/14958
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Wed, 25 May 2022 02:14:36 +0000]
vol: Use asprintf in _namei_examine_special
GCC-12 is flagging an snprintf statement with a format truncation
warning:
namei_ops.c: In function ‘namei_ListAFSSubDirs’:
namei_ops.c:2029:22: error: ‘%s’ directive output may be truncated
writing up to 255 bytes into a region of size between 0 and 511
[-Werror=format-truncation=]
Change code to use asprintf instead of snprintf. Return an error if a
memory allocation fails.
Change-Id: I1f617ab22dbec4c2497ec482115cd20c9af0ecfa
Reviewed-on: https://gerrit.openafs.org/14955
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Wed, 25 May 2022 18:54:50 +0000]
ukernel: Fix AFS_GUNLOCK panic in rx_ServerProc
At the beginning of UKERNEL's rx_ServerProc a call to AFS_GUNLOCK
panics with 'afs global lock not held'.
The commit 'afs: Drop GLOCK for various Rx calls' (
d5e1428a3b) altered
afs_RXCallBackServer so the global lock is released prior to calling
rx_ServerProc, and to reacquire the lock after rx_ServerProc returns.
Remove the AFS_GUNLOCK at the start and the AFS_GLOCK at the end of
UKERNEL's rx_ServerProc.
Change-Id: Id0e2fef574e4d3473e83f77615d194448f55ab47
Reviewed-on: https://gerrit.openafs.org/14963
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Tue, 3 May 2022 20:57:58 +0000]
afs: Increase NUSERS to 2k
The current value of NUSERS (16) is very small when the client has a
large number of PAGs. When we have a few thousand (or even just a few
hundred), the length of the unixuser hash chains can be come long
enough to cause noticeable differences in performance. Looking up
unixuser structs is a very common code path, since we need to do this
for pretty much any file access that's not already cached at the VFS
layer.
To alleviate this, increase NUSERS to 2k. This is certainly not
necessary on all systems (such as those that never use authentication,
or only have a few PAGs), but the overhead is a very small constant
amount of memory.
Change-Id: I17b32f192656db9ffc97ac47b0923a02803977a3
Reviewed-on: https://gerrit.openafs.org/14959
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Thu, 7 Apr 2022 22:51:21 +0000]
DARWIN: On macOS 12, mount afs on user's directory
Currently, /afs is mounted/unmounted by a LaunchDaemon. In order to
unmount /afs on restart/shutdown, this daemon runs umount -force /afs.
Unfortunately, SIP (System Integrity Protection) is not allowing the
LaunchDaemon in question to run this command successfully on macOS 12
(exclusively on restart/shutdown):
umount: Operation not permitted
In this situation, afs can't be turned off correctly, leaving many
unkillable afsd processes lingering around. As a result, the
restart/shutdown process gets stuck indefinitely.
Fortunately, this problem doesn't happen if /afs is mounted on an user's
directory. That said, avoid this issue by mounting /afs on the current
user's directory (/Users/$USER/OpenAFS/afs). Notice that afs is still
accessible (including for other users) through a synthetic link added in
the root directory (/afs -> /Users/$USER/OpenAFS/afs).
Change-Id: Id05d811e785057a82b73d0946154d9be8b5d772a
Reviewed-on: https://gerrit.openafs.org/14925
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Marcio Barbosa [Tue, 15 Mar 2022 13:58:16 +0000]
macos: Packaging support for MacOS X 12.0
This commit introduces the new set of changes / files required to
successfully create the dmg installer on OS X 12.0 "Monterey".
Change-Id: I365aecabf12e88bbe7eabd22c8727a5c446656b8
Reviewed-on: https://gerrit.openafs.org/14924
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Thu, 7 Apr 2022 03:16:45 +0000]
macos: Add support for MacOS 12.0
This commit introduces the new set of changes / files required to
successfully build the OpenAFS source code on OS X 12.0 "Monterey".
Change-Id: Iada9cab596747122c1973654ae4f78d52957c8a6
Reviewed-on: https://gerrit.openafs.org/14923
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Tue, 15 Mar 2022 13:38:45 +0000]
DARWIN: Replace afs_osi_cred by allocated ucred
Building the current version of OpenAFS on macOS Monterey arm64 results
in the following error:
error: globals with authenticated null values are currently unsupported
afs_ucred_t afs_osi_cred;
To avoid this problem, replace the global in question by a pointer to a
dynamically allocated afs_osi_cred (afs_osi_credp). Ideally we would
create a new credential with kauth_cred_create(), but this function is
not well documented and using it results in crashes. Moreover, if the
kauth_cred_dup() function were still available (private since XNU
1456.1.26 - macOS 10.6), we could also duplicate the current user's
credential during startup (like commit
f40f466c7f did for BSD).
Change-Id: Ied2df7590e4e671ce2643669c83ee0e4b2a97cd1
Reviewed-on: https://gerrit.openafs.org/14922
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Thu, 7 Apr 2022 22:35:02 +0000]
macos: Add support for Apple Silicon
This commit introduces the new set of changes / files required to
successfully build the OpenAFS source code on Apple M1 (macOS 11+).
Notice that kexts on Apple silicon must support the arm64e architecture,
since they run in kernel space and must support the same architecture
and restrictions as other kernel code. On the other hand, the utilities
that run on user space, like vos, fs, and others, have to be built for
arm64 (currently).
Change-Id: Ib005215ae9bfb0b9dda94b2e194f05c0ce92fa1e
Reviewed-on: https://gerrit.openafs.org/14746
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Marcio Barbosa [Thu, 7 Apr 2022 02:15:57 +0000]
macos: Refactor param.x86_darwin_200.h
In preparation for a future commit, try to make param.x86_darwin_200.h
more readable. Also, rename this file to param.darwin_200.h so code from
other architectures can be included in this header.
Change-Id: I1617e3ca93b7e9a4eee4ba121aa20d993302eb84
Reviewed-on: https://gerrit.openafs.org/14934
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Mon, 14 Feb 2022 23:09:27 +0000]
build: Select param.h in sysname.m4
Currently, the way the file that will be used as param.h is selected
doesn't allow us to choose headers from other architectures, making
cross-compiling difficult. In an effort to facilitate this process,
select the header that will be used as param.h in sysname.m4. By doing
this, we will have more flexibility to select which header should be
used (in future commits).
Change-Id: I5c77e9e061b847e770bf25f454fe891b5ead9429
Reviewed-on: https://gerrit.openafs.org/14914
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Wed, 6 Apr 2022 23:36:15 +0000]
macos: Build afscell for supported architectures
Given that i386 is no longer supported, trying to build the current
version of afscell on macOS 11 (Big Sur) results in the following error:
error: The i386 architecture is deprecated. You should update your ARCHS
build setting to remove the i386 architecture.
To fix this problem, build afscell for all architectures listed in
ARCHS_STANDARD.
For the macosx11.0 sdk:
$ xcodebuild -showBuildSettings -scheme afscell -sdk macosx | grep ARCHS
ARCHS = arm64 x86_64
ARCHS_STANDARD = arm64 x86_64
ARCHS_STANDARD_32_64_BIT = arm64 x86_64 i386
ARCHS_STANDARD_32_BIT = i386
ARCHS_STANDARD_64_BIT = arm64 x86_64
ARCHS_STANDARD_INCLUDING_64_BIT = arm64 x86_64
VALID_ARCHS = arm64 arm64e i386 x86_64
While here, add arm64 to the list of valid architectures.
Change-Id: I37230e49ff5884234b8195bc49ce8b8938580c9e
Reviewed-on: https://gerrit.openafs.org/14745
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Marcio Barbosa [Wed, 23 Mar 2022 20:58:41 +0000]
DARWIN: Declare/include functions before using them
Every function should be explicitly declared before it can be called.
Since -Wimplicit-function-declaration is usually a warning and not an
error, calling undeclared functions does not prevent us from building
the code.
However, apple-clang 12 makes this an error by default, prohibiting the
build of the current version on macOS 11 (Big Sur).
To fix this problem, declare functions before calling them. Also,
include mach/thread_act.h into afs_call.c so the declaration of
thread_terminate() can be found on macOS. Last, given that the third
argument of PIOCTL() (if UKERNEL is defined) is a pointer, cast it to
'long'. Doing so, we can avoid another inhibited warning. Notice that
this PIOCTL definition is scoped to a single file (src/auth/ktc.c).
Change-Id: I6d796c10ea4dd81b13ae5feb9f42608aa445560d
Reviewed-on: https://gerrit.openafs.org/14744
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Wed, 23 Mar 2022 20:31:54 +0000]
bucoord: Introduce ubik_Call_SingleServer_BUDB_*
In an effort to avoid the usage of undeclared functions, add wrappers
for ubik_Call_SingleServer() (_BUDB_GetVolumes(), _BUDB_DumpDB()) and
adjust its callers accordingly.
Also, make sure that ubik_Call_SingleServer() uses the same signature as
ubik_Call(). This change helps us to get rid of casting errors.
Change-Id: I431360f7a42a81b1f20005ebaf0c703bab73a963
Reviewed-on: https://gerrit.openafs.org/14886
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Tue, 5 Apr 2022 22:39:56 +0000]
afs: Ensure dirEntry->name has room for entry name
Currently, the afs_dynroot_addDirEnt() function assumes that the caller
has allocated the directory to be large enough to hold the necessary
entry. In order to make sure that memory isn't being accidentally
stomped, use strlcpy to truncate instead of stomping on other memory.
That way, if the caller makes a mistake we don't silently corrupt memory.
We specifically do not assert that there is no truncation or panic if
truncation occurs, since the effect of a truncated entry in the
dynamic AFS root volume is limited and does not justify bringing down
the entire client.
Change-Id: I9c9b0ee6bc32ae7751005dd9b21a75e878e59fe3
Reviewed-on: https://gerrit.openafs.org/14938
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Marcio Barbosa [Wed, 6 Apr 2022 20:59:56 +0000]
afs: Replace strcpy &co by safer alternatives
In addition to being unsafe, these functions (strcpy, strncpy, strcat,
and sprintf) are deprecated on macOS. Replace these functions by safer
alternatives (strlcpy, strlcat, snprintf, and afs_strdup).
Notice that, in order to use afs_strdup(), this commit adds the afs_util
library to the AFSPAGOBJS list. Given that afs_strcasecmp() is also
implemented in afs_util.c, src/crypto/hcrypto/kernel/strcasecmp.c can be
removed from the tree.
No functional change should be incurred by this commit.
This commit is a continuation of a patch initially developed by
cwills@sinenomine.net.
Change-Id: Id11d8bca133e44f96913f7959d87bc82dbebce29
Reviewed-on: https://gerrit.openafs.org/14743
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Wed, 23 Mar 2022 19:04:46 +0000]
UKERNEL: Remove flock -> usr_flock redirection
In order to replace 'struck flock' with 'struct usr_flock' and 'flock()'
with 'usr_flock()', the current version of src/afs/UKERNEL/sysincludes.h
defines flock to usr_flock. This can cause problems when trying to use
libroken in UKERNEL code, because roken.h redefines flock.
To avoid conflicts with libroken (included in a future commit), add a
new UKERNEL specific AFS_FLOCK -> usr_flock redirection. Doing so, the
flock -> usr_flock redirection can be removed. While here, also remove
'usr_flock()' as it shouldn't be called and is not defined in any header
file.
Change-Id: Ia71811513ab6655f60d8b63fc18b26be663ab4dc
Reviewed-on: https://gerrit.openafs.org/14913
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Thu, 24 Mar 2022 17:04:13 +0000]
afs: Remove redundant AFS_LINUX_ENV test
After our Linux checks were converted to AFS_LINUX_ENV in commit
6329a523 (Change AFS*_LINUXnn_ENV to AFS*_LINUX_ENV), the extra
AFS_LINUX_ENV check in this line doesn't make any sense. Get rid of
it.
Change-Id: I4196744b1a6674469efef04aa487a50743084656
Reviewed-on: https://gerrit.openafs.org/14935
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Marcio Barbosa [Wed, 23 Mar 2022 18:10:15 +0000]
afs: Save size of sysname_info->name
In preparation for a future commit, save the size of sysname_info->name
by adding a new field (name_size) into the sysname_info struct. Also,
remove the sysname_info->allocked field, since now we can find out if
memory has been allocated by checking if sysname_info->name_size is
different than zero.
No functional change should be incurred by this commit.
Change-Id: Id0f5a646b2d82fda5344d53c9fc8b3407f2ea805
Reviewed-on: https://gerrit.openafs.org/14912
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Marcio Barbosa [Wed, 20 Apr 2022 13:06:17 +0000]
cmdebug: Print AFSFid fields as unsigned integers
Currently, AFSFid fields are printed as signed integers. As a result,
large numbers can be erroneously printed as negative numbers.
To fix this problem, print AFSFid fields as unsigned integers.
Change-Id: Ic8c39bc90303e35bd982f6a850330d623047e0ec
Reviewed-on: https://gerrit.openafs.org/14950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Marcio Barbosa [Mon, 21 Mar 2022 17:43:34 +0000]
DARWIN: Drop afs_event lock before destroying it
On macOS arm64, a lock (lck_mtx_t) must be released (lck_mtx_unlock)
before it can be destroyed/freed (lck_mtx_free -> lck_mtx_destroy). If
this rules isn't respected, the operating system in question will panic
with the following message:
panic("lck_mtx_assert(): mutex (%p) not owned", lock);
Unfortunately, the current shutdown process of the osi_sleep module
doesn't respect this rule. As a result, macOS arm64 panics when the
OpenAFS client is shut down/restarted. To fix this problem, release
afs_event->lck (EVTLOCK_UNLOCK) before destroying it (EVTLOCK_DESTROY).
Change-Id: Ifd39fd99c237c783ed98079573fd4043ebab363b
Reviewed-on: https://gerrit.openafs.org/14933
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Tue, 23 Nov 2021 21:56:49 +0000]
tests: Avoid plain printf in auth/superuser-t
If we're reporting an error, we should be printing to stderr. If we're
printing informational data, we should be using diag() to try to avoid
interfering with the TAP data. Change all printf() calls into one of
those two options.
Change-Id: I2e0d577e0c32efa539ed486190dbaca23bd0487f
Reviewed-on: https://gerrit.openafs.org/14866
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Tue, 23 Nov 2021 21:52:23 +0000]
tests: Improve fork/waitpid error handling
A couple of places in our test code aren't handling errors from fork()
or waitpid() properly. We don't expect to ever hit errors for these,
but sysbail() in this case, so they don't fail silently.
Change-Id: I1c548f93f4d4ac4344032d7847470b04319386f2
Reviewed-on: https://gerrit.openafs.org/14865
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Tue, 23 Nov 2021 21:31:33 +0000]
tests: Put tmp dirs in objdir, not /tmp
Currently, all tests that use afstest_mkdtemp() generate a temporary
dir in /tmp, which is removed when the test is done (unless MAKECHECK
isn't set, or the test prematurely exits/crashes). The /tmp dir on a
system may not be the best choice; it may be limited in size, and it's
visible to other users, which is annoying if we are littering the dir
with afs_XXXXXX dirs if broken tests are running during development.
Instead, use a tmp dir in the objdir of the current build
(specifically, tests/tmp/). Since this is the same dir we're building
the tree in, we must be able to write to it and it should have plenty
of space. And it will almost certainly get cleaned up eventually, even
with broken tests, since it will get removed when the build tree is
inevitably removed.
While we're doing this, run the paths from afstest_src_path and
afstest_obj_path through realpath(), so our tmp paths (and other
paths) look a little cleaner, and don't look like
/home/user/openafs/tests/../tests/tmp/foo.
Change-Id: I6633f58ac1f6ef34e33b51cc19d3bff7a4f3fdb0
Reviewed-on: https://gerrit.openafs.org/14864
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Cheyenne Wills [Wed, 30 Mar 2022 17:09:45 +0000]
Linux-5.18 replace set_page_dirty with dirty_folio
The commits going into Linux 5.18:
fs: Add aops->dirty_folio (
6f31a5a261db)
fs: Convert __set_page_dirty_buffers to block_dirty_folio (
e621900ad2)
fs: Remove aops ->set_page_dirty (
3a3bae50af)
replaces the address_space_operations structure member set_page_dirty
which with dirty_folio. The linux function __set_page_dirty_buffers is
replaced by block_dirty_folio.
Nothing within afs uses or implements the set_page_dirty function,
however the structure member is required to be initialized.
Add an autoconf test for the dirty_folio member and if present, set the
address_space_operations member dirty_folio to block_dirty_folio
instead of setting the set_page_dirty member.
Change-Id: Iad6783308989f4a1390c1c94d2c571048bd4e771
Reviewed-on: https://gerrit.openafs.org/14939
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Mark Vitale [Sat, 19 Jun 2021 03:54:00 +0000]
finale: translate_et (Unix) support for UAE
Add support for the UAE numbers to the Unix implementation of
translate_et.
example:
$ translate_et
49733388
49733388 (uae).12 = Permission denied
Change-Id: Id70aaf0fcbffd580ee21de39aa32923dda3e6dac
Reviewed-on: https://gerrit.openafs.org/14649
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Mark Vitale [Mon, 21 Jun 2021 22:05:04 +0000]
libadmin: add support for UAE error translation
Routine util_AdminErrorCodeTranslate() provides the support for error
translation that is used by the libadmin package and several Windows utilities,
including the Windows implementation of translate_et (translate_et_nt.c).
Enhance it so the Windows translate_et can translate UAE errors.
No changes are required for translate_et_nt.c.
Note: this may be unit-tested under Unix via a libadmin test:
$ src/libadmin/test/afscp UtilErrorTranslate -error
49733388
49733388 -> Permission denied
Change-Id: Iee85e09813e3488558c0f1c6682d0049b912abc7
Reviewed-on: https://gerrit.openafs.org/14648
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Mon, 23 Aug 2021 19:33:19 +0000]
Fix PrintInode() mismatched array parameter warnings
The PrintInode() prototypes do not match the function definitions.
When AFS_64BIT_IOPS_ENV is defined (which is the common case and is
required for namei), the buffer parameter is declared as a bounded
character array (afs_ino_str_t) in the prototype, but is defined as an
unbounded character pointer. When AFS_64BIT_IOPS_ENV is not defined
(for legacy 32-bit inode vice partitions), PrintInode() is declared with
no specified parameters.
A static buffer is used to hold the formatted string when a NULL is
passed as the first argument to PrintInode(). However, this method is
only used by the volinfo and iopen utility programs.
Fix the mismatch function prototypes and definitions to use the bounded
char array (afs_ino_str_t) in all cases. Remove the deprecated function
declaration with no specified parameters. Update vol-info and iopen to
pass an afs_ino_str_t buffer and remove the now unused static buffer.
Update the duplicated PrintInode() function definition in namei_ops.c.
(This duplicated code could be removed in a future commit.)
Change-Id: I5c0128bb0d572dab0df637289daad0e648ad8a8f
Reviewed-on: https://gerrit.openafs.org/14770
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Mon, 23 Aug 2021 19:37:13 +0000]
bucoord: Fix doDispatch() array-parameter gcc warning
The doDispatch() prototype does not match the function definition. The
targv parameter is declared as an unbounded array in the prototype, but
is defined as a bounded array. As of GCC 12, a warning is issued for the
mismatch.
main.c:346:18: error: argument 2 of type ‘char *[100]’ with
mismatched bound [-Werror=array-parameter=]
bucoord_internal.h:123:40: note: previously declared as ‘char *[]’
Within doDispatch(), the targv argument is just passed to cmd_Dispatch()
(this is the only use of targv). Since cmd_Displatch() expects an
unbounded array, update the doDispatch() definition to match the
prototype.
Change-Id: I50a170b3490d0d4e5d971b9ccb483cccb6833686
Reviewed-on: https://gerrit.openafs.org/14771
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Tue, 22 Feb 2022 19:10:36 +0000]
doc: Show correct path to BosConfig when using modern paths
The BosConfig.5 man page shows the incorrect path to the BosConfig file
when modern installation paths are used. For example, BosConfig.5 man
page distributed by Debian contains the text:
The file must reside in the /var/lib/openafs/local directory ...
which should read:
The file must reside in the /etc/openafs directory ...
The man page files contain Transarc-style paths which are translated to
the configured paths by the install target. The path /usr/afs/local in
the BosConfig pod file is interpreted as @afslocaldir@, not the correct
@afsbosconfigdir@.
Change the BosConfig POD text to trigger a special substitution case in
the install-man script. This case is is already in use to correctly
translate paths of the BosConfig.new and BosConfig files the bosserver
man page.
/usr/afs/local/BosConfig -> @afsbosconfigdir@/BosConfig
Using this rule requires a change to the text to show the fully
qualified path to the BosConfig file, instead of just the directory
name.
Change-Id: If1c5872dd86c7c1a5de98fb37daef903cd10b26b
Reviewed-on: https://gerrit.openafs.org/14908
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Sun, 10 May 2020 22:26:27 +0000]
FBSD: Check VOP_ISLOCKED for LK_EXCLUSIVE
A couple of places in the code check if a vnode is locked by the
current thread by simply checking 'if (VOP_ISLOCKED(vp))'. But
VOP_ISLOCKED() doesn't just return a simple 1 or 0, it returns LK_*
constants (or 0). LK_EXCLUSIVE indicates that the calling thread holds
an exclusive lock on the vnode, but LK_SHARED means someone holds a
shared lock (possibly not the current thread), and LK_EXCLOTHER
indicates that a different thread holds an exclusive lock.
Because of this, it's possible for us to skip grabbing the vnode lock
for certain operations, if someone else holds the lock at the same
time. For example, this can happen when we call vinvalbuf() inside
afs_GetVCache(), and FreeBSD will warn us that we didn't lock the
vnode:
#0 0xffffffff80bf6557 at kdb_backtrace+0x67
#1 0xffffffff80c7a337 at assert_vop_locked+0x77
#2 0xffffffff80c7a273 at vinvalbuf+0x23
#3 0xffffffff8285aa2d at afs_GetVCache+0x25d
#4 0xffffffff828d3325 at afs_root+0x145
#5 0xffffffff80c70296 at lookup+0x8c6
#6 0xffffffff80c6f599 at namei+0x4a9
#7 0xffffffff80c872e4 at sys_lpathconf+0x54
#8 0xffffffff81074581 at amd64_syscall+0x291
#9 0xffffffff8104cde0 at fast_syscall_common+0x101
vnode 0xfffff8012a62bc58: tag afs, type VDIR
usecount 2, writecount 0, refcount 2 mountedhere 0
flags (VV_ROOT|VI_ACTIVE)
lock type afs: UNLOCKED
#0 0xffffffff80b81fc2 at lockmgr_lock_fast_path+0x1e2
#1 0xffffffff811fa9f6 at VOP_LOCK1_APV+0x96
#2 0xffffffff80c8c705 at _vn_lock+0x65
#3 0xffffffff80c7c066 at vget+0xa6
#4 0xffffffff828d3437 at afs_root+0x257
#5 0xffffffff80c70296 at lookup+0x8c6
#6 0xffffffff80c6f599 at namei+0x4a9
#7 0xffffffff80c872e4 at sys_lpathconf+0x54
#8 0xffffffff81074581 at amd64_syscall+0x291
#9 0xffffffff8104cde0 at fast_syscall_common+0x101
vc 0xfffffe002be00000 vp 0xfffff8012a62bc58 tag afs, fid: 1.
536870924.1.1, opens 0, writers 0
To fix this, change our "islocked"-style checks to check if
VOP_ISLOCKED() returns LK_EXCLUSIVE specifically.
Change-Id: If322f62dc443ee9acc2349a23c6c618afd3e29d4
Reviewed-on: https://gerrit.openafs.org/14204
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Mark Vitale [Tue, 22 Jun 2021 04:04:23 +0000]
libadmin: skip authentication setup for tests that don't need it
src/libadmin/test/afscp is a testbed with subcommands to test many
libadmin functions. Almost all of these subcommands call
SetupCommonArgs to add authentication specification arguments (e.g.
-noauth, -cell <cell>, etc). These common args are checked in
MyBeforeProc to obtain authentication before processing the actual test
command.
There are a few afscp subcommands which should not require any
authentication setup:
UtilErrorTranslate -error <code>
UtilNameToAddress -host <hostname>
Yet these will segfault in MyBeforeProc unless a valid authentication
argument is specified.
Instead, do not call SetupCommonArgs for these subcommands; this will
cause MyBeforeProcs to skip authentication setup.
Change-Id: Iea5067b11e9ad0086acd8f2007e08ed92b45021f
Reviewed-on: https://gerrit.openafs.org/14647
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Mark Vitale [Tue, 22 Jun 2021 04:28:54 +0000]
libadmin: allow tests to skip authentication setup
src/libadmin/test/afscp is a testbed with subcommands to test many
libadmin functions. Almost all of these subcommands call
SetupCommonArgs to add authentication specification arguments (e.g.
-noauth, -cell <cell>, etc). These common args are checked in
MyBeforeProc to obtain authentication before processing the actual test
subcommand.
However, some afscp subcommands shouldn't need any authentication setup,
for example:
UtilErrorTranslate -error <code>
UtilNameToAddress -host <hostname>
In preparation for a future commit, modify MyBeforeProc to skip
authentication setup for subcommands that haven't called SetupCommonArgs
to define authentication options.
Change-Id: I3d6be062c8264ece8eb27c3b2b72c8c45aacae56
Reviewed-on: https://gerrit.openafs.org/14646
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Mark Vitale [Sat, 29 Jan 2022 03:39:06 +0000]
remove vestigial reference to 'sia'
Commit
21006bb844a3 oops-sias-dead-
20080906 removed references to 'sia'
from the tree, but overlooked the reference in the clean2 rule. This
results in a harmless error from 'make clean', or any target with
'clean' as a dependency:
/bin/sh: line 0: cd: sia: No such file or directory
make[1]: [clean2] Error 1 (ignored)
Remove this last reference to eliminate the error.
Change-Id: Ic2827998e3b272acc7714238d0755c5ec2ad2b95
Reviewed-on: https://gerrit.openafs.org/14890
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Thu, 10 Feb 2022 16:02:35 +0000]
doc: Update INSTALL w/info on overriding dirpaths
Fix a typo in INSTALL for 'afslogsdir'.
Add a note with information that it is possible to override the
directory paths via environment variables.
The added documentation is targeting distro maintainers so they are
aware that the directory paths can be configured without patching.
Change-Id: Ia94d8525db798fe01866126f1f315499296717c9
Reviewed-on: https://gerrit.openafs.org/14888
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ralf Brunckhorst <rbrunckhorst@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Thu, 27 Jan 2022 20:49:15 +0000]
UKERNEL: Remove socket -> usr_socket redirection
Currently, src/afs/UKERNEL/sysincludes.h #defines 'socket' to
'usr_socket', in order for 'struct socket' declarations to use struct
usr_socket. Redefining a simple word/function like 'socket' can easily
cause issues, and currently makes it difficult to introduce libroken
callers in UKERNEL code. There are already several instances of
'#undef socket' in the tree for UKERNEL, suggesting that this wasn't a
good idea to start with.
Fortunately, this redefinition of 'socket' in UKERNEL seems
unnecessary, since the only place 'struct usr_socket' is actually
deferenced is inside src/rx/UKERNEL/rx_knet.c. So we can treat 'struct
usr_socket' as a struct definition that's just internal to rx_knet.c,
and no other code even needs to know about the struct, or think that
it's equivalent to 'struct socket'.
Most code in rx_knet.c already explicitly casts between 'struct
socket' and 'struct usr_socket'. The only exception is rxi_Recvmsg
starting in commits near
27c42be1 (ukernel-rx-knet-deref-
20060126),
but this is easily fixed by adding an additional explicit cast.
Change-Id: I4a2af32b33a86a10750d569ac3c91d0c79f49459
Reviewed-on: https://gerrit.openafs.org/14887
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Cheyenne Wills [Fri, 28 Jan 2022 21:10:46 +0000]
Linux-5.17: Kernel build uses -Wcast-function-type
The linux 5.17 commit:
"Makefile: Enable -Wcast-function-type" (
552a23a0)
added the -Wcast-function-type compiler flag for kernel module builds.
This change catches a type mismatch in the external files obtained from
heimdal: hcrypto/evp.c and hcrypto/evp-algs.c and produces the following
type of compile time error messages.
src/libafs/MODLOAD-.../evp.c: In function ‘hc_EVP_md_null’:
src/libafs/MODLOAD-.../evp.c:501:2: error: cast between incompatible
function types from ‘void (*)(void *)’ to ‘int (*)(EVP_MD_CTX *)’
{aka ‘int (*)(struct hc_EVP_MD_CTX *)’}
[-Werror=cast-function-type]
501 | (hc_evp_md_init)null_Init,
| ^
Use AX_APPEND_COMPILE_FLAGS to create a CFLAGS_NOCAST_FUNCTION_TYPE
macro to disable this warning and update the CFLAGS for these 2 files
for the Linux libafs build.
Update the CODING documentation to add the new exceptions. In addition
add a brief description on how to set up autoconf to add a new build
macro to suppress compiler warnings.
Note: upstream heimdal has committed a fix for this in:
hcrypto: Fix return type for null_Init, null_Update and null_Final
(
fc4b3ce49b)
Change-Id: I05b716867016a33ca02a791ed6bc5a7d846de608
Reviewed-on: https://gerrit.openafs.org/14881
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Andrew Deason [Fri, 21 Jan 2022 23:54:48 +0000]
afs: Organize setpag() declarations better
The current declarations for setpag() are a mess (not to be confused
with many other setpag functions, like afs_setpag()), accumulated
across various commits over time. Shuffle the #ifdef logic around, so
this becomes a much more straightforward #ifdef ladder, with one
declaration per conditional. And move the LINUX declaration to be next
to all of the others (even the LINUX setpag() is declared in
osi_groups.c, not osi_misc.c, so it's in the wrong spot anyway).
The resulting #ifdef logic should be identical to the original code,
but is now easier to follow. For the BSDs, it may look like we have
changed the conditional for the case of "XBSD && !DFBSD && !FBSD &&
!NBSD", but that's a very roundabout way of saying OBSD (OpenBSD).
Change-Id: I062a2537ccf89b6d2535fe2919ca04ef16a84e4a
Reviewed-on: https://gerrit.openafs.org/14883
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Fri, 28 Jan 2022 03:19:17 +0000]
Linux-5.17: kernel func complete_and_exit renamed
Handle the Linux kernel function rename made in commit
"exit: Rename complete_and_exit to kthread_complete_and_exit"
(
cead1855)
Add a new autoconf test for the linux function kthread_complete_and_exit
and if not found use a define to map kthread_complete_and_exit to
complete_and_exit.
Replace calls to complete_and_exit with kthread_complete_and_exit.
Change-Id: If8db2d0abb1de8b08f511e9ff67612ef605cd603
Reviewed-on: https://gerrit.openafs.org/14882
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Tue, 11 Jan 2022 01:11:58 +0000]
afs.h: fix out of tree build failures
There are several compiler errors and warnings when building an out of
tree program that includes "afs/afs.h".
- Errors for unknown type names 'afs_ucred_t' and 'wait_queue_head'
.../afs/afs.h:1542:16: error: unknown type name ‘afs_ucred_t’
... | afs_set_cr_uid(afs_ucred_t *cred, uid_t uid) {
.../afs/afs.h:1605:5: error: unknown type name ‘wait_queue_head_t’
... | wait_queue_head_t cond;
- Warnings about declaring structures within missing declarations for
the structs: osi_File, dcache and afs_FetchOutput
.../afs/afs.h:1486:36: warning: ‘struct osi_file’ declared inside
parameter list will not be visible outside of this definition or
declaration
... | int (*read)(void *rock, struct osi_file *tfile,
afs_uint32 offset,
- Unable to find the file for the include opr/jhash.h
The missing type name 'afs_ucred_t' is due to miss-placed declarations
for some kernel only functions.
The type name 'wait_queue_head' is a data type for Linux kernel modules.
The warnings for the missing declarations are due to either references
to the structures before they are declared, or because they are not
available in any of the other public header files.
To fix the unknown type name afs_ucred_t, relocate the function
declarations that reference 'afs_ucred_t' into the KERNEL only section
(since afs_ucred_t is a kernel specific type).
To fix the unknown type name 'wait_queue_head', relocate the afs_event
structure and the afs_evhasht variable to be within the KERNEL only
section.
To resolve the warnings associated with the structures, simply declare
the structure names before they are referenced. All references that
are resulting in the warnings are declarations for pointers.
Relocate the include for opr/jhash.h and the define for VCSIZE into the
kernel block.
Change-Id: I4135ff25b76d3221c7779c279ed829000ce31f1c
Reviewed-on: https://gerrit.openafs.org/14857
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Mans Nilsson [Thu, 16 Dec 2021 20:36:22 +0000]
Add sysname, files and header entries for FreeBSD 12.3
Created a new sysname "amd64_fbsd_123" in src/config/afs_sysnames.h
and added "param" files with minimal changes:
modified: src/config/afs_sysnames.h
new file: src/config/param.amd64_fbsd_123.h
new file: src/config/param.i386_fbsd_123.h
This mod builds on 12.3 with all tests passing.
Change-Id: Iccf9cfe75362511337b1c09267489d258a5913cb
Reviewed-on: https://gerrit.openafs.org/14860
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Thu, 1 Apr 2021 05:12:43 +0000]
tests: Add test keys in afstest_BuildTestConfig
Change afstest_BuildTestConfig to add the local keys into the
generated config dir, unless the info->skipkeys is set. This just
makes afstest_BuildTestConfig a little easier to use for the common
case of generating a fully-usable config dir with usable keys (only
some callers want to skip generating keys in order to test
key-populating functionality).
Change-Id: I1ce9d062ea30c391a93562fc90bc18997de75383
Reviewed-on: https://gerrit.openafs.org/14835
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Sun, 3 May 2020 15:33:28 +0000]
afs: Drop GLOCK for various Rx calls
Most calls into Rx from libafs do so without the AFS_GLOCK, but a few
pieces of code still hold AFS_GLOCK while making some Rx calls. A few
calls into Rx also currently require AFS_GLOCK, but drop AFS_GLOCK
internally, which is somewhat confusing/inconsistent. Calling Rx
functions with AFS_GLOCK held can potentially cause locking/allocation
problems on various platforms, such as FreeBSD where we get WITNESS
warnings about acquiring sleepable Rx locks while holding the
non-sleepable AFS_GLOCK.
Fix a variety of Rx calls from libafs to drop AFS_GLOCK before calling
into Rx. Specifically, this commit handles calls to rxi_GetIFInfo,
rx_InitHost, rx_StartServer, rx_ServerProc, rx_GetConnection,
rx_DestroyConnection/rx_PutConnection, and
rx_SetConnSecondsUntilNatPing.
For calls made via afs_start_thread, adjust afs_start_thread to accept
a new argument that says whether to acquire AFS_GLOCK for the relevant
function or not.
For a call to rx_InitHost inside afs_InitSetup, dropping GLOCK makes
it possible for another thread to also enter afs_InitSetup while we're
running, before afs_InitSetup_done is set. To prevent two threads from
running afs_InitSetup in parallel, introduce afs_InitSetup_running
(which is set while afs_InitSetup is running), and simply wait for it
to be cleared if it is set when we enter afs_InitSetup.
This commit does not handle strictly all calls into Rx from libafs,
since many Rx calls don't do anything interesting besides set some
internal variables, and so AFS_GLOCK doesn't really matter for them,
and dropping/reacquiring it around those calls may have performance
impact.
Change-Id: Ib6344f08593182ad0f812ea42eb8c91d8f082356
Reviewed-on: https://gerrit.openafs.org/14184
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Cheyenne Wills [Tue, 2 Nov 2021 15:18:51 +0000]
autoconf: Remove/update obsolete autoconf macros
Autoconf 2.70 (released in 2020-12) produces warning messages about
obsolete constructs by default.
Running regen.sh with autoconf 2.70 installed produces the following
warnings:
..
configure.ac:7: warning: The macro `AC_CONFIG_HEADER' is obsolete.
configure.ac:21: warning: AC_PROG_LEX without either yywrap or noyywrap
is obsolete
configure.ac:21: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:21: warning: The macro `AC_HEADER_TIME' is obsolete.
..
Replace AC_CONFIG_HEADER with AC_CONFIG_HEADERS
Add the noyywrap parameter to AC_PROG_LEX. Use the noyywrap option
since we already provide a yywrap function in the .l sources.
Remove AC_HEADER_STDC. There are no references to the the autoconf
variable set by this macro. This macro was marked as obsolete prior to
autoconf 2.64 with the following note:
"This macro is obsolescent, as current systems have conforming header
files. New programs need not use this macro."
AC_HEADER_TIME was marked as obsolete prior to autoconf 2.64 with the
following note:
"This macro is obsolescent, as current systems can include both files
when they exist. New programs need not use this macro."
The only reference that requires AC_HEADER_TIME is within the external
roken code pulled from heimdal. Compiles that use the external upstream
heimdal packages result in a build error if TIME_WITH_SYS_TIME is not
defined:
building src/crypto/hcrypto
src/external/heimdal/hcrypto/camellia.c
include/roken.h:803:58: error: ‘struct tm’ declared inside
Update autoheader.m4 so a define for TIME_WITH_SYS_TIME is created. This
avoids modifying the external heimdal/roken code.
Change-Id: If4d6c0650aac617f535b35f81994b54a3b8ac021
Reviewed-on: https://gerrit.openafs.org/14838
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Tue, 16 Nov 2021 17:55:30 +0000]
LINUX-5.16: Use linux/stdarg.h if available
Global use of the compiler option '-isystem' was removed from the top
level Makefile with Linux commit ('isystem: delete global -isystem
compile option'
04e85bbf7). This results with an error due to not
finding "stdarg.h" when building the openafs kernel module.
.../src/rx/rx_kcommon.h:143:12: fatal error: stdarg.h: No such file or
directory
143 | # include "stdarg.h"
| ^~~~~~~~~~
Linux-5.15, introduced a copy of stdarg.h as 'linux/stdarg.h' in commit
('isystem: ship and use stdarg.h'
c0891ac15)
Add a test for the linux/stdarg.h include file and if available, use
"linux/stdarg.h" instead of "stdarg.h" within the Linux kernel module.
Change-Id: I5215182c8240034bd739688a88a9410b74f93c8f
Reviewed-on: https://gerrit.openafs.org/14844
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Benjamin Kaduk [Sun, 3 Oct 2021 22:44:05 +0000]
prdb.txt: correct fixed header length
It is decimal 64, not hex 64.
Change-Id: Iee51f4536e8e811bd6ba7e2b86bdde5183227928
Reviewed-on: https://gerrit.openafs.org/14824
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Thu, 17 Sep 2020 04:05:07 +0000]
tests: Check for vlserver startup
Currently, afstest_StartVLServer waits for a fixed amount of time (5
seconds) for the vlserver to startup. This means each test that runs a
vlserver takes at least 5 seconds, which adds up very quickly when new
tests are added for vlserver functionality.
Instead of waiting 5 seconds each time, change afstest_StartVLServer
to check if the vlserver has started up, and to wait a much shorter
time if it hasn't finished starting up yet. Specifically, wait until
the "Starting AFS vlserver" message appears in VLLog, and the
UBIK_RECHAVEDB recovery state bit is set. This allows vlserver-based
tests to run much more quickly.
Change-Id: I74015670a301980e6d89b3149ed9f2a6c1a40523
Reviewed-on: https://gerrit.openafs.org/14804
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Sat, 24 Apr 2021 21:08:38 +0000]
tests: Introduce afstest_MyHostAddr
Several places resolve the local hostname into an IP address.
Consolidate these into a single function (gethostaddr), and add the
function afstest_MyHostAddr, which caches the IP and bails if we can't
resolve our hostname.
Change-Id: I7f71cd136796e4395c639eed8dd8eb19a7b9beec
Reviewed-on: https://gerrit.openafs.org/14802
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Mark Vitale [Tue, 14 Apr 2020 21:13:02 +0000]
afs: record afs_CacheTruncateDaemon stats indirectly
In preparation for a future commit, record the CTD_stats through a
pointer.
No functional change is incurred by this commit.
Change-Id: Id0cb97daf06535bad2d14be19bc8d957d6816808
Reviewed-on: https://gerrit.openafs.org/14199
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Mark Vitale [Wed, 1 Apr 2020 18:48:37 +0000]
afs: export internal stats for afs_CacheTruncateDaemon
In preparation for a future commit, redefine CTD_stats so they can be
reported externally. While here, move and rename the struct.
While here, also remove an old comment concerning AIX.
No functional change is incurred by this commit.
Change-Id: If68e44f9dfae5a227d3a24f9fe34932ead1972d1
Reviewed-on: https://gerrit.openafs.org/14198
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Mark Vitale [Fri, 22 May 2020 22:31:56 +0000]
afs: consolidate disk block calculations
Similar code is used in several places to calculate the number of 1KiBi
blocks required for a cache chunk, rounded up to the nearest
afs_fsfragsize. Coalesce these into a single inline function,
afs_round_to_fsfragsize.
No functional change should be incurred by this commit.
Change-Id: I1f58ad28426b786fc9809df01d409c8137437012
Reviewed-on: https://gerrit.openafs.org/14227
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Mark Vitale [Mon, 4 May 2020 19:55:07 +0000]
Add static assert for size of osi_timeval32_t
OpenAFS code requires osi_timeval32_t to have 32-bit sizes for members
tv_sec and tv_usec - a total of 8 octets. One symptom of a
misdefinition may be incorrect operation of xstat_cm_test, which relies
on wire representations of time being 8 bytes on both the client and
server side.
In order to prevent incorrect sizes of osi_timeval32_t, add a static
assert.
Change-Id: Iff487da792aec5aae5e32b2d3409d8639a7ea51a
Reviewed-on: https://gerrit.openafs.org/14195
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Sun, 3 May 2020 02:01:50 +0000]
FBSD: Drop GLOCK when grabbing vnode locks
In a few places, we try to vn_lock() or VOP_LOCK() while holding
AFS_GLOCK (or do something like vrele(), which internally acquires the
vnode lock). This is against the FBSD locking rules, since our
AFS_GLOCK is a non-sleepable 'struct mtx' lock, and vnode locks are
sleepable lockmgr locks.
So, drop AFS_GLOCK while acquiring vnode locks.
Change-Id: I0ca449bb6398aa8ededd5bb67d56a7d3f13688f0
Reviewed-on: https://gerrit.openafs.org/14182
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Cheyenne Wills [Wed, 7 Jul 2021 17:08:10 +0000]
Remove kdump
Remove the obsolete kdump debugging tool from the tree. Remove and
clean up the preprocessor tests associated with KDUMP, KDUMP_RX_LOCK and
KDUMP_KERNEL. Clean up the autoconf and Makefiles to remove kdump and
the associated autoconf and Makefile vars XLIBELFA and XLIBKVM.
The kdump utility has not been well maintained; for some platforms it
fails to build (e.g. Solaris 11). For Linux, the makefile does not
even try to compile the kdump source but instead creates the kdump file
via touch.
The intended functionality of kdump has been replaced by various kernel
debugging tools, such as dtrace or systemtap.
Change-Id: I23fd82f2b96ba58d1b431af76fdf0afe7d7274b9
Reviewed-on: https://gerrit.openafs.org/14623
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Sun, 3 May 2020 01:56:46 +0000]
FBSD: use sx(9) locks for rx afs_kmutex_t
On FBSD, afs_kmutex_t is defined as a struct mtx, which is a
non-sleepable lock. If we hold one of these locks and then try to
acquire a sleepable lock, there is the potential for deadlock, and
WITNESS complains.
One way this is a problem is that we acquire IFNET_RLOCK in
rxi_GetIFInfo(), which is a sleepable lock. We enter this function
via rxi_FindPeer -> rxi_InitPeerParams, which is encountered while
holding a variety of different Rx locks in different situations, such
as rx_peerHashTable_lock and rx_connHashTable_lock.
Another way this is a problem is that we allocate memory in a variety
of situations whole holding various Rx locks. Currently many of these
are sleepable allocations (which could cause deadlocks); we could
avoid that if they were converted to non-sleepable allocations, but
then the allocations may fail and we'd need to adjust all of the
relevant code paths to accommodate.
To avoid these issues, define Rx's afs_kmutex_t locks to sx(9) locks,
which are sleepable. Drop the use of MTX_DUPOK/SX_DUPOK during lock
init, since we shouldn't be acquiring duplicate locks.
This does not appear to introduce any new issues, except where we
acquire Rx locks while holding the libafs AFS_GLOCK, which we probably
shouldn't be doing and is fixed in subsequent commits. Note that other
platforms also tend to use sleepable locks for afs_kmutex_t: for
example, on LINUX, we use struct mutex (which is sleepable).
Change-Id: I78ede8eb6ba8935d0082925c5475c42260eb7d59
Reviewed-on: https://gerrit.openafs.org/14183
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Fri, 18 Sep 2020 01:54:54 +0000]
ubik: Skip sleep on first pass in urecovery loop
When running a dbserver without any remote sites, we become the sync
site immediately, since there aren't any other sites so we don't need
to do any processing of votes. The ubik database can thus be accessed
immediately, except we cannot start ubik write transactions right
away, since UBIK_RECHAVEDB will not be set, causing
urecovery_AllBetter() to fail.
UBIK_RECHAVEDB is not set immediately, because urecovery_Interact
sleeps 4 seconds at the beginning of its loop, so no recovery flags
will be set for the first 4 seconds during startup. This makes it
impossible to start any ubik write transactions for the first 4
seconds, even if we're the only site. That may not be a significant
amount of time for a user (since a dbserver daemon doesn't startup too
frequently), but this can cause huge delays for automated testing of
dbservers.
To get rid of this unnecessary delay, just skip this delay the first
time we go through the urecovery_Interact loop.
Change-Id: Ie6653b7b742dcf37798a6bf340b29c283ac3bc4c
Reviewed-on: https://gerrit.openafs.org/14803
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Benjamin Kaduk [Fri, 8 Oct 2021 04:11:12 +0000]
prdb_check: fix -pheader output
This is prdb_check, so we will print the PRDB header, not the
KADB header.
Change-Id: Id956400794ce866875c1772791301122cc4e1413
Reviewed-on: https://gerrit.openafs.org/14827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Thu, 7 Oct 2021 17:15:58 +0000]
LINUX 5.14: explicitly set set_page_dirty to default
Linux 5.14 commit: 'mm: require ->set_page_dirty to be explicitly wired
up' (
0af573780b0b13) removed calling __set_page_dirty_buffers when the
address_space_operations structure member set_page_dirty was NULL.
A kernel RIP error can occur when the set_page_dirty operation is
requested. (Reproducible by running 'iozone -B -a')
Update the definition for afs_file_aops to explicitly set the
'set_page_dirty' member to '__set_page_dirty_buffers'.
There are no functional changes, since this commit is using the same
function that the Linux kernel was using if set_page_dirty had been
NULL.
Problem originally reported by "Andrej Filipcic"
<andrej.filipcic@ijs.si> in the openafs-info mailing list. The Linux
5.14 commit causing the openafs failure was identified by "Michael Laß"
<lass@mail.upb.de> also on in the openafs-info mailing list.
Note: The declaration for the function '__set_page_dirty_buffers' was
moved from linux/mm.h into linux/buffer_head.h in Linux 2.6.19. Since
this is close to the minimum supported Linux version 2.6.18, we are not
introducing an additional autoconf test to determine which header file
the declaration for __set_page_dirty_buffers resides in.
Change-Id: I8f2a00e374635ab1aa69d6eaef8cf97bb449d089
Reviewed-on: https://gerrit.openafs.org/14826
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Tested-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Ralf Brunckhorst <rbrunckhorst@sinenomine.net>
Tested-by: Ralf Brunckhorst <rbrunckhorst@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Jeffrey Altman [Sat, 24 Feb 2018 01:10:27 +0000]
CVE-2018-7168 RXAFS_StoreACL deprecate 134 introduce 164
There exist in the wild AFS3 clients that improperly construct access
control lists which are then stored to directories via RXAFS_StoreACL
(opcode 134). These clients add negative access control entries (if any)
to the normal rights list.
As there is no method by which a fileserver can determine that the
ACL is improperly constructed, the only method to defend the storage of
broken ACLs is to identify clients that are known to properly construct
ACLs by introducing a new RXAFS_StoreACL opcode (164).
This change:
* Renames RXAFS opcode 134 to RXAFS_OldStoreACL
* Introduces RXAFS opcode 164 as RXAFS_StoreACL
* Implements SRXAFS_OldStoreACL and SRXAFS_StoreACL in the fileserver
via a common_StoreACL() function that accepts the executed opcode
as input.
* To avoid breaking changes in stable release branches,
SRXAFS_OldStoreACL will still be allowed by default, with an option
to cause it to be failed by default with error EPERM/UAEPERM.
A follow-up commit will cause SRXAFS_OldStoreACL to fail by default
on the master branch.
* When opcode 134 is called, the a FileLog entry will be generated
at log level 0 instead of 1 and the entry will contain the string
"CVE-2018-7168".
* Modifies the format of the ACL logged to the FileLog and the audit
stream. Previously the AFSOpaque format was used directly. The
problem with this format is that it uses newlines as the ACE
separator. Since the FileLog and file audit log is intended to
be one line per log entry, the newlines break the file formats.
This change replaces the newlines with spaces for display purposes
unless the process is unable to allocate the additional memory.
* Introduces a new fileserver command line switch -cve-2018-7168-enforce
which when specified causes SRXAFS_OldStoreACL RPCs to be failed.
[kaduk@mit.edu: switch en/disable-by-default behavior and fix argument parsing]
Change-Id: Ic92ef45314d75fbc2b8ff574223fab2d398a1d60
FIXES: 134485
Reviewed-on: https://gerrit.openafs.org/12942
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Mon, 28 Dec 2020 20:14:54 +0000]
tests: Add existing-database test for pt_util
Our current tests for pt_util use pt_util to generate a prdb, and then
check the output of pt_util against that created database. Add a new
test that runs pt_util against an existing database (with the same
test data), to make sure that pt_util is still using the same db
format.
Change-Id: I4dbe7f3b5080ee6ff1f9509992b5686fc8381da0
Reviewed-on: https://gerrit.openafs.org/14801
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Mon, 14 Jun 2021 22:13:57 +0000]
rx: Cleanup rx.h
Fix up indentation and white space within preprocessor statements.
Remove multiple blank lines
Fix #endif comments so they match the #if
Split long #define lines
RX_PACKET_TYPES
rx_MaxUserDatasize,
RXS_OP
RXS_SetConfiguration
Note, this commit does not refactor any preprocessor statements.
Change-Id: I327e9588e96bba9d768ccf345650aced7e824328
Reviewed-on: https://gerrit.openafs.org/14629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Mon, 28 Dec 2020 19:12:59 +0000]
tests: Introduce afstest.pm
Create a perl module for some generic common code for our tests
written in perl: afstest.pm. With this commit, the module just
contains a couple of functions to calculate paths in our src and obj
trees (src_path(), obj_path()), analogous to afstest_src_path and
afstest_obj_path in our C helper library, libafstest_common.la.
Convert all existing perl test code that uses C_TAP_SOURCE/C_TAP_BUILD
to use these new functions.
Change-Id: I5e4d45e3d2d59449bbfc426476cb29b710c73bc1
Reviewed-on: https://gerrit.openafs.org/14800
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Marcio Barbosa [Thu, 1 Jul 2021 13:47:50 +0000]
fs: add option to evaluate symlink or mtpt
Currently, several fs subcommands for Windows offer an option (-literal)
to evaluate symlink / mount point rather than the object it refers to.
Provide the same option on Unix for fs_getfid.
Change-Id: I55ab5f96d5b9e63efbe7e938647edba05a1787ed
Reviewed-on: https://gerrit.openafs.org/14542
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Sun, 22 Dec 2019 06:43:07 +0000]
FBSD: Use GENERIC kernel headers by default
Currently, if --with-bsd-kernel-build is not specified during
configure, we do not set KERNBUILDDIR during the libafs build at all.
This means that we do not use an opt_global.h during the build.
For the GENERIC kernel, in the past this has worked well enough to
produce a working kernel module, but with FreeBSD 12, the GENERIC
kernel turns on the VIMAGE option by default. If our kernel module is
built without VIMAGE defined, our kernel module cannot be loaded into
GENERIC, since VIMAGE changes the definitions of some symbols that we
use (for example, trying to load such a libafs fails with the message
"link_elf_obj: symbol in_ifaddrhead undefined").
To allow the build to work by default for GENERIC kernels, without
needing any additional configure flags, change the libafs Makefile to
use the headers for the GENERIC kernel if no kernel build dir is
given. To do this, we create a directory in our build tree and
generate the opt_*.h headers in there (using config(8)), and specify
that directory as the kernel build dir.
This approach only works for GENERIC kernels, of course, but that is
the most common scenario. Users that want to build for a custom kernel
configuration still need to specify the actual kernel build dir with
--with-bsd-kernel-build.
Change-Id: If716d3f8ded9596d8e5e98bf2e58888921fc5f7f
Reviewed-on: https://gerrit.openafs.org/14001
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Sat, 2 Oct 2021 02:02:42 +0000]
afs: Call afs_FindVCache with DO_STATS, not 1
Several callers pass the bare literal 1 to afs_FindVCache, instead of
the named constant DO_STATS. Use the constant, for clarity.
Change-Id: I0c70ee17f48c773dcb3f4d42ec106f440c5bed2c
Reviewed-on: https://gerrit.openafs.org/14823
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Mon, 25 May 2020 21:48:34 +0000]
IRIX: Remove pre-65 code
Commit
d1923139 (irix kill efs and start pruning pre-65) removed all
files that defined AFS_SGI64_ENV and earlier, but didn't remove that
code that depended on those defines. In addition, there has been code
in the tree that checks for AFS_SGI53_ENV since OpenAFS 1.0, but
nothing has ever defined Irix 5.3 support in OpenAFS.
Remove all of this obsolete code. Change all references to
AFS_SGIXX_ENV to AFS_SGI_ENV, and assume AFS_SGI_ENV is defined in all
IRIX dirs. Consolidate some of the resulting ifdef logic
appropriately.
Change-Id: I9dd426296e04801980b805a5e195063762b23189
Reviewed-on: https://gerrit.openafs.org/14230
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>