We define static_inline to just 'static' on AIX, presumably because
old xlc versions could not handle 'static inline'. The clang-based xlc
17.1 can, though, so allow the normal 'static inline' if we detect
clang being used.
Doing this is not required to build, but it gets rid of a lot of noisy
-Wunused-function warnings when building.
Change-Id: I44d165549dbd0002a733318daa32da23c9e51a29
Reviewed-on: https://gerrit.openafs.org/15444
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
We currently only allocate 50 or 100 (depending on platform) dir
buffers for the buffer cache, which seems very low. Raise it to 2048,
and make it consistent for all platforms, to give the buffers a chance
at actually usefully caching data.
Change-Id: If95eafde771993532dac08057cbd1e1a8cef915c
Reviewed-on: https://gerrit.openafs.org/13532
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Commit beff42414ae (aix-5-update-20041207) added -qlanglvl=stdc99 to
our CFLAGS for libuafs, apparently to handle __file__ (or __FILE__) in
afs_osi_pag.c.
The clang-based xlc 17.1 on AIX does not understand this argument,
which causes an error:
CC .../src/libuafs/afs_osi_pag.lo
.ibm-clang: error: unknown argument: '-qlanglvl=stdc99'
afs_osi_pag.c doesn't directly use __FILE__. Various other files in
src/afs indirectly reference __FILE__, so this probably is not needed
at all anymore. Just remove it.
Change-Id: Iae33a80dd96aef94e3be2f97590e40ffa1c6ba29
Reviewed-on: https://gerrit.openafs.org/15447
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
In various places, we make direct libafs syscalls. On platforms with a
dedicated libafs syscall number, this involves passing AFS_SYSCALL to
a generic OS-provided function that issues the given syscall (usually
called syscall()).
On AIX, there is no generic syscall() function for issuing system
calls. Instead, system calls are treated like function calls, and are
translated into system calls at link-time. So our calls to e.g.
lpioctl() and lsetpag() are issuing system calls on AIX, and we have
no userspace definition of these functions.
Along with lpioctl() and lsetpag(), libafs also defines a system call
confusingly named 'syscall'. Since this is our system call, of course
the system headers provide no declaration for it, and so this causes
errors when building using the clang-based xlc 17.1, such as:
.../src/volser/volmain.c:195:2: error: call to undeclared function 'syscall'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
syscall(AFS_SYSCALL /* AFS_SYSCALL */ , 28 /* AFSCALL_CALL */ , a3,
^
To avoid these errors, declare a prototype for syscall(). But be clear
that this is a function (technically a system call) provided by
OpenAFS, not by the OS.
Ideally our prototype would match the definition of syscall() in
afs_syscall.c, but our various callers pass a varying number of
arguments (as is normal for syscall() on other platforms). So at least
for now, declare it as a function with unspecified args.
Change-Id: Ica43e56e19f59155fe21fe8fdeb52525b2f678e9
Reviewed-on: https://gerrit.openafs.org/15446
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
We currently define COMPAT_43 for AIX. This causes some socket-related
structures and functions to be defined to be compatible with BSD 4.3,
but causes us to not get function prototypes for recvmsg() and
sendmsg(). When using the clang-based XLC 17.1, this causes errors:
.../src/rx/rx_lwp.c:414:12: error: call to undeclared function 'recvmsg'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
code = recvmsg(socket, msg_p, flags);
^
.../src/rx/rx_lwp.c:432:12: error: call to undeclared function 'sendmsg'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
while (sendmsg(socket, msg_p, flags) == -1) {
^
To avoid this, don't define COMPAT_43. To try to make sure we don't
change anything when using the old xlc, still define COMPAT_43 when
we're not using clang.
Change-Id: I4971df46f0b8e10463c42938d12fa27dff514da7
Reviewed-on: https://gerrit.openafs.org/15445
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Commit 6b96a49eb6 "Retire AFS_MOUNT_AFS" removed all AFS_MOUNT_AFS
references. However, a few were inadvertently reintroduced with the
following commits:
f379e1b255 "macos: Add support for MacOS 14.X (Sonoma)"
e5a97ef2b4 "macos: Add support for MacOS 13.0 (Ventura)"
7a862f940b "macos: Add support for MacOS 12.0"
39b74c2c37 "macos: Refactor param.x86_darwin_200.h"
acc955bc17 "macos: add support for MacOS 11.0"
Remove them.
No functional change is incurred by this commit.
[mmeffie: Remove ones added by 14.x too]
Change-Id: Iaf93e27eabbe23a9054d695bc13a43163943f5b1
Reviewed-on: https://gerrit.openafs.org/15453
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
If we're going to call rcu_read_lock(), we're also going to need to
call rcu_read_unlock(). Make sure both functions are available before
saying that rcu_read_lock is available.
Without this, trying to use rcu_read_lock/unlock can result in errors
during the kernel build for kernels where rcu_read_unlock calls
rcu_read_unlock_strict (a GPLONLY function). This started in Linux
commit aa40c138cc8f (rcu: Report QS for outermost PREEMPT=n
rcu_read_unlock() for strict GPs), which was included in Linux 5.10.
Change-Id: I1d2d5272c722d60ec55dcfd6c07b79e4edfc995b
Reviewed-on: https://gerrit.openafs.org/14876
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Get rid of some remaining references to bcopy, bzero, and bcmp. In a
few places (such as ka-forwarder.c, and linked_list.c), these were
being called without including strings.h, which causes errors on AIX
when using the clang-based xlc 17.1 compiler.
Remove references even inside comments or documentation, to make it
easier to make sure they've all been removed.
Leave some references inside platform-specific or kernel code, since
those are more likely to need bcopy() et al, and tend to only impact
that platform.
Note that most references to bcopy() et al were removed by commit
c5c521af0e
(convert-from-bsd-to-posix-string-and-memory-functions-20010807).
Change-Id: I28d1b139348c2a4b2259a259de0c93997c684c40
Reviewed-on: https://gerrit.openafs.org/15432
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Add the -localauth option to the libadmin rxstat sample programs which
require a token. This allows the use of these rxstat commands on the
server when the cache manager is not available.
Change-Id: If0d4d12abc80df73da5898ebb0052fb61d23cb48
Reviewed-on: https://gerrit.openafs.org/12376
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Add a libadmin function to support the -localauth option instead
of retrieving a token from the cache manager.
Change-Id: Ie6aa6f3f48e39e0b8dbab7fec83369e41d441e45
Reviewed-on: https://gerrit.openafs.org/12375
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Use the libcmd library to parse rxstat_* command line arguments, instead
of custom code in each program. The positional argument syntax is
unchanged by this commit. Optional command line switches for the
arguments are now supported, as a feature of libcmd.
This also fixes the incorrect usage messages in several of the commands.
Change-Id: I5df9b9a439bc12e7c1090abc9713e5245d666c1b
Reviewed-on: https://gerrit.openafs.org/12374
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Various parts of dumpscan use ctime(), time(), etc, but don't include
time.h. This causes errors on AIX when using the clang-based xlc 17.1,
such as:
.../src/tools/dumpscan/parsevol.c:286:35: error: call to undeclared function 'ctime'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
printf("%s%s", field->label, ctime(&when));
^
Include time.h in these files, so we have declarations for these
functions.
Change-Id: I0247a55952640585ff3b27d2b0e47e09dea531a0
Reviewed-on: https://gerrit.openafs.org/15435
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
The AIX-specific tweak_config() clearly doesn't return a value, so
don't say it does.
Change-Id: I8b4535427438cb05c4243b4ef2a875c685c7bb76
Reviewed-on: https://gerrit.openafs.org/15434
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
The AIX-specific functions aix_vmount() and vmountdata() are missing
return types, and vmountdata is referenced before we declare it. These
cause errors when using the clang-based xlc 17.1:
.../src/afsd/afsd_kernel.c:386:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
aix_vmount(const char *cacheMountDir)
^
int
.../src/afsd/afsd_kernel.c:407:5: error: call to undeclared function 'vmountdata'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
vmountdata(vmountp, "AFS", cacheMountDir, "", "", "", "rw");
^
.../src/afsd/afsd_kernel.c:415:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
vmountdata(struct vmount * vmtp, char *obj, char *stub, char *host,
^
Declare these 'static' and with proper return types, and move
aix_vmount() so it's after vmountdata().
Change-Id: Ie31dddaae515c914087a34efacfe3427eda22d0b
Reviewed-on: https://gerrit.openafs.org/15433
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
kaserver.c redefines vfprintf in terms of the historical _doprnt
function, presumably to work around quirks of old platforms. This
should not be necessary anymore, since we call vfprintf() normally in
various other places throughout the tree without trouble.
Using _doprnt causes problems on various platforms (as can be seen by
the long #ifdef before it), including now AIX when using the
clang-based xlc 17.1:
.../src/kauth/kaserver.c:99:5: error: call to undeclared function '_doprnt'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
vfprintf(stderr, fmt, pvar);
^
.../src/kauth/kaserver.c:60:35: note: expanded from macro 'vfprintf'
#define vfprintf(stream,fmt,args) _doprnt(fmt,args,stream)
^
Instead of adding more conditions to the #ifdef, just get rid of this
weird workaround altogether.
Change-Id: Ie4e965229ed8e8636c6e6405cc33a4937e2ccabc
Reviewed-on: https://gerrit.openafs.org/15431
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
For most platforms, LWP_CreateProcess2 is #define'd to be the same as
LWP_CreateProcess. For AFS_AIX32_ENV, it is actually a different
function, but we don't declare it in a header. The clang-based xlc
17.1 complains about this:
.../src/lwp/iomgr.c:670:6: error: call to undeclared function 'LWP_CreateProcess2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
LWP_CreateProcess2(p, stackSize, LWP_NORMAL_PRIORITY,
^
.../src/lwp/iomgr.c:670:6: note: did you mean 'LWP_CreateProcess'?
.../src/lwp/lwp.h:262:12: note: 'LWP_CreateProcess' declared here
extern int LWP_CreateProcess(void *(*ep)(void *), int stacksize, int priority,
^
Declare this in lwp.h, like we do for the normal LWP_CreateProcess.
Change-Id: I18e6d4436ae4c58f3ffb6fe57158e6869f0b36b5
Reviewed-on: https://gerrit.openafs.org/15430
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Fix the indentation of a closing brace that was accidentally
extra-indented in e93786b01b3 (vol: remove OPENAFS_VOL_STATS).
Change-Id: I25627531fe9f4f07138a917b6c576f6ab22dd036
Reviewed-on: https://gerrit.openafs.org/15464
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Since the original IBM code import, this file has not been built or
referenced. Remove it.
No functional change is incurred by this commit.
Change-Id: Iee8a077767bf7774f7f6b586501aea8a0fc88a3f
Reviewed-on: https://gerrit.openafs.org/15677
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
For 64-bit Solaris 11 kernel builds on SPARC, use '-m64' instead of the
long-deprecated "-xarch=v9". This will eliminate the warning:
Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
The two options are functionally equivalent, so no functional change
should be incurred by this commit.
Change-Id: I6a4043a9e6dfad509fe1be3dd4071e5e77d31133
Reviewed-on: https://gerrit.openafs.org/15360
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Since its introduction in commit 5ec5ad5dcca8 'New GetToken pioctl',
PGetTokens2 has had a stray semicolon after its closing '}'. This may
generate a compiler warning:
warning: syntax error: empty declaration
Remove the superfluous semicolon.
No functional change is incurred by this commit.
Change-Id: I49c220781d8d9c8d65a28996fbc0dbad803ca49b
Reviewed-on: https://gerrit.openafs.org/15357
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
When building with Solaris Studio, we receive warnings about the type of
the event passed to the LWP functions.
CC /export/home/vagrant/openafs/src/vol/volume.o
"volume.c", line 662: warning: argument #1 is incompatible with prototype:
prototype: pointer to void : ".../include/lwp.h", line 273
argument : pointer to function(enum {volumeSalvager(7), ...)
returning int (E_ARG_INCOMPATIBLE_WITH_ARG_L)
In particular, this happens in src/vol/volume.c because our "events" are
function pointers and the LWP functions expect a pointer to a void.
As needed, cast the event pointer to the expected (void *) to eliminate
the warnings.
[mmeffie: Rebase and update commit message.]
Change-Id: I619a52326914aeff66263e62490de3b6d3b0c9ac
Reviewed-on: https://gerrit.openafs.org/15356
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
The following fields in struct vcache are never used (despite what
some comments suggest):
- next_seq_offset
- next_seq_blk_offset
- xlatordv
- protocol
- vpacRock
Remove them, to reduce the memory impact of our vcaches. While we're
here, also move around some fields to reduce the amount of unnecessary
padding and reduce #ifdefs:
- diskSlot
- activeV
- vstates
- multiPage
- callback
- vc_error
- dchint
- dcreaddir
- pagewriter_lock
- pagewriters
On amd64 RHEL7, this commit reduces the size of struct vcache by 40
bytes (from 1024 to 984).
Change-Id: I0cb6aedacc3cee56b952b3c5a6ec6a2d318043a8
Reviewed-on: https://gerrit.openafs.org/15211
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Convert all hardcoded $(AR) options to use configuration variable
ARFLAGS.
No functional change should be incurred by this commit.
Change-Id: I3a0840e58d8996d60c119c6d5df1ab8d985ba0d8
Reviewed-on: https://gerrit.openafs.org/14896
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Commit e4c2810f41cc 'Remove support for Solaris pre-8' overlooked some
references to pre-8 SunOS versions in lwp/Makefile.in. Remove them.
Change-Id: I3ca5498444569134e1e9720efb96c84c61cdf799
Reviewed-on: https://gerrit.openafs.org/15366
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
We currently do not build 'fc_test' or any of the programs in
src/rxkad/test, and they've bitrotted as a result. Clean them up so
they can build again, and make them all built by default.
Some of these programs depend on higher-level libraries (like
libafsauthent) that depend on rxkad, so we cannot build the test
programs during the top-level 'make rxkad' target. So instead, create
a new top-level target called 'rxkad_test' that just builds the test
programs. Move 'fc_test' into the test subdir to make it easier to
build with the other test programs.
Change-Id: Ic5570efd9076e3e4feec18002d67ce8d58f321d1
Reviewed-on: https://gerrit.openafs.org/14750
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Since the original IBM code import, libbubasics.a has been built with a
hardcoded 'ar' instead of the customary $(AR).
For consistency with the rest of the tree (and in preparation for a
future commit), convert this to use $(AR) instead.
While here, also change the options from 'r' to the more typical 'crv'.
Change-Id: If74e4b92188af9de7f504e3f588b7ee1070425fc
Reviewed-on: https://gerrit.openafs.org/14895
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Currently, when sleeping on LINUX, we either block all signals
(afs_osi_Sleep), or do not block signals at all (afs_osi_SleepSig).
The only caller of afs_osi_SleepSig() is afs_read(), with the
intention that a user can interrupt the process while it's waiting for
data from an unresponsive server.
This can cause problems when afs_read() is called during a paging
request. In this case, if we are interrupted by a signal, we'll return
an error (EINTR) from afs_linux_readpage(), which causes a SIGBUS to
be sent to the process if it's not already dying.
If we're interrupted by a fatal signal, the process is already dying
so this is fine. But if we're interrupted by a non-fatal signal with
an installed signal handler, the SIGBUS almost always causes the
process to die immediately (and maybe dump core), where it otherwise
would have been fine.
This can be very confusing to a user when it happens, since it's not
immediately obvious that AFS was involved at all; the dumped core
often just shows the SIGBUS generated during a mundane memory load or
store. This situation is most easily seen when running golang out of
/afs, but has also been seen with git and other programs. Anything
that makes heavy use of signals while data is being fetched from /afs
is likely to trigger the behavior.
This problem in general may not be specific to Linux, since the
relevant code path is in cross-platform code (afs_read ->
afs_osi_SleepSig). But notably, this does not happen on Solaris[1];
other platforms may have their own quirks that prevent this from
becoming a problem.
To avoid this for Linux, block all signals except SIGKILL when we're
sleeping via afs_osi_SleepSig(). This allows the process to be killed
if needed, but prevents interruption from any non-fatal signal.
Ideally we would put our process in TASK_KILLABLE state, using
functions like wait_event_killable() or wait_event_state() instead of
blocking signals. But these functions have evolved over time, making
this approach complex or even impossible for various Linux versions in
our current design. Future commits may improve this; for now, do the
simpler fix and just block signals.
We could theoretically still allow non-fatal signals to interrupt
sleeps when called from a syscall like read(). But this is difficult
with the current structure of our Linux integration (syscall i/o is
implemented on top of the paging system, like most Linux filesystems),
and other filesystems tend to not do this.
Also, interrupting a stalled afs_read() in general doesn't currently
work very well anyway. The only callers of afs_osi_SleepSig() look
like this, to wait for a background fetch (BOP_FETCH) to complete:
while (!code && tdc->mflags & DFFetchReq) {
/* other locks, etc */
ReleaseReadLock(&tdc->lock);
code = afs_osi_SleepSig(&tdc->validPos);
ObtainReadLock(&tdc->lock);
}
A signal will cause afs_osi_SleepSig() to return, but then we must
wait to get tdc->lock. The background BOP_FETCH operation will keep
tdc->lock write-locked for the entire fetch from the fileserver
(afs_CacheFetchProc()), so we won't be able to continue until the
fetch completes.
Future commits may improve this, but for now just avoid the
unnecessary SIGBUS errors.
[1] On Solaris, the equivalent code path (afs_GetOnePage()) does not
go through afs_read() with noLock==0, but instead calls
afs_GetDCache() to handle fetching data. It does call afs_ustrategy()
to fill a page, which does technically call afs_read(), but with
noLock==1, and so avoids the case where we submit a BOP_FETCH and
wait for it. Fetching data from the network happens in the
afs_GetDCache() call, and so does not use afs_osi_SleepSig().
Change-Id: Ic9c0c35bd1a2a8fd1901d91dae10cb7719194d25
Reviewed-on: https://gerrit.openafs.org/15637
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The output for 'fs getfid' was changed in commit d390df097c (fs getfid
output changed for consistency with Windows implementation), but the
manpage still had the old output in its examples. Update the manpage
to reflect the current behavior of 'fs getfid'.
Change-Id: Iea7a92cdb30ca6f935121aba26a072288b404567
Reviewed-on: https://gerrit.openafs.org/15587
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Instead of having afs_osi_Sleep() call afs_osi_SleepSig() directly,
have both afs_osi_Sleep() and afs_osi_SleepSig() call a common helper
function, afs_linux_sleep(). This makes it easier for future commits
to alter the behavior for the _Sleep and _SleepSig variants.
This commit should incur no noticeable change in behavior. We now
manipulate the signal mask outside of AFS_GLOCK, but this doesn't matter
because 'current' and the signal mask are unrelated to any of our locks.
The signal mask is protected by SIG_LOCK (a wrapper from osi_machdep.h
for various different locks for different kernel versions), and is
handled in this commit the same as it was before.
Change-Id: Id14c44b22cf2a1883deaf6ceec66f71f3f4778a6
Reviewed-on: https://gerrit.openafs.org/15636
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Commit d1923139e6 (irix kill efs and start pruning pre-65) removed
most pre-6.5 Irix code, but there are still numerous references laying
around. Get rid of them.
Change-Id: I5e8b092374c616ccec84d195021a8bee78a4cea2
Reviewed-on: https://gerrit.openafs.org/15455
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Commit f896be7dd587 dirpath-mrafs-additions-20010212 inadvertently
introduced duplicate entries for several AFS path definitions via a
cut-and-paste mistake.
Remove the duplicate definitions.
While here, move a server definition into the correct category.
No functional change is incurred by this commit.
Change-Id: Icf88ee9f74f8a7c72cd7cd2abf8b128f5651f4b5
Reviewed-on: https://gerrit.openafs.org/15420
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Add a makefile target to start an interactive subshell with the
environment required to run tests directly from the command line. Tests
can also be run from a debugger or from the "runtests" front-end test
runner.
Example usage:
$ make shell
...
Starting a shell to run tests. Run 'exit' when done.
# Set the subshell prompt (optional).
$ PS1="(tests) $PS1"
# Run tests directly or with a debugger.
(tests) $ rx/perf-t
...
(tests) $ file rx/perf-t
rx/perf-t: Perl script text executable
(tests) $ perl -d rx/perf-t
...
# End the subshell.
(tests) $ exit
$
The shell started will be the one discovered by configure, which may not
be the preferred shell for interactive use. To specify a different
shell, define SHELL when running make:
$ make shell SHELL=/path/to/my/shell
If you use this feature often, you may want to update your shell profile
to automatically set the PS1 when running the test subshell. For
example, you can append this to your bashrc file:
# OpenAFS unit test subshell.
if [[ $MAKECHECK -eq 1 ]]; then
PS1="(tests) $PS1"
fi
Thanks to Ben Kaduk for the suggestion.
Change-Id: I8d949d21153396c0da8db186fd35477ad0383f12
Reviewed-on: https://gerrit.openafs.org/15730
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Commit b0818fcdb227c8b291eb7b23e504fd1d2240eea6 'Cleaned most warning
OSX OpenAFS preference and completed the AFSBackgrounder implementation'
removed mention of afsltd.m from the xcode project, but neglected to
remove the actual source code file afsltd.m.
Remove the dead code.
No functional change is incurred by this commit.
Change-Id: I85f9a0842187c39a40cb8492e60a9371d6ff041d
Reviewed-on: https://gerrit.openafs.org/14591
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Add makefile variables to specify if we are to build the userspace
and/or kernel module (kmod) packages. Continue to build both by
default.
Change-Id: Idc20d5140fcb60cbe84a500b2a7580866008e3e0
Reviewed-on: https://gerrit.openafs.org/15407
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Currently, when building the source RPM with make, the release notes and
change log are empty, and the CellServDB file is downloaded from
grand.central.org.
Instead, by default, package the NEWS file for the release notes, the
ChangeLog generated by the 'make-release' script, and a CellServDB file
in the source tree.
Add the RPM_RELNOTES and RPM_CHANGELOG makefile variables so we can
override the defaults if builders want to provide their own release
notes and change log files. Builders can specify empty values on the
make command line to fallback to empty files for the RELNOTES and
ChangeLog (which was the old behavior before this change).
Add the RPM_CELLSERVDB makefile variable to specify the local CellServDB
file to be packaged. By default, package src/afsd/CellServDB from the
working tree (which matches the one specified in the openafs.spec.in
used to build the source rpm). Builders can specify an empty
RPM_CELLSERVDB on the make command line to have makesrpm.pl download the
CellServDB file from grand.central.org (which was the old behavior
before this change).
Change-Id: Idf1afd1683d87d882d2c7e49058cbf18839e5c9e
Reviewed-on: https://gerrit.openafs.org/15406
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
The 'packages' directory is created by the top makefile when building
source tarballs and RPM package files. Remove this directory when
running 'make clean', just like we already do for the output of the
legacy 'make dest' target.
Change-Id: Icc912e8025d15dd2f3f52c9ffaa9d29f8c19268b
Reviewed-on: https://gerrit.openafs.org/15475
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
In Makefile.config.in, the Makefile variable TOP_JLIBDIR is set to the
autoconf variable TOP_JLIBDIR. Except, we don't export anything called
TOP_JLIBDIR from autoconf, and never have. So, TOP_JLIBDIR gets set to
the literal string @TOP_JLIBDIR@, which is useless.
To get rid of this cruft, just remove references to this variable in
the top-level Makefile.in and Makefile.config.in, where it was clearly
not working.
[mmeffie: Updated commit message after rebase.]
Change-Id: Ic7e64d3743c99065dea8371bdc1007835c94edbd
Reviewed-on: https://gerrit.openafs.org/13810
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Permissions granted by host-based ACLs and non-host-based ACLs are
calculated separately (and transmitted somewhat differently, via
AnonymousAccess). So, if a caller is granted permissions via normal
user-based access, those permissions cannot be removed by host-based
entries in a negative ACL. And conversely, permissions granted by
host-based entries cannot be removed by negative ACLs for
non-host-based entries.
Both negative ACLs and host-based ACLs are uncommon and recommended
against, so this should not be a common combination. But this
limitation is not documented anywhere, so try to mention it in the
fs_setacl manpage, near some other text related to negative ACLs, to
give affected users a chance to figure out why it isn't working.
Change-Id: I13ba2adda1474a5e72271d3e843bb03feec29b67
Reviewed-on: https://gerrit.openafs.org/15340
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The OpenAFS preferences for MacOS provide two ways to start or stop the
cache manager:
- Preference pane button: [Startup] or [Shutdown]
- AFS Menu item: 'Startup AFS' or 'Shutdown AFS'
Only one choice (startup or shutdown) is displayed in each UI element,
based on the current state of the cache manager according to
checkAfsStatus().
Unfortunately, checkAfsStatus() determines cache manager state by
issuing a 'df' command and searching the output for AFS_FS_MOUNT "AFS".
This heuristic is fragile and easily fooled by any "AFS" string in the
output.
For example, the OpenAFS installer .dmg mounts itself as "OpenAFS". The
presence of "AFS" causes checkAfsStatus to believe that AFS is mounted.
Therefore the OpenAFS GUI will display only the "Shutdown" choice,
regardless of the true state of AFS. If AFS is already shutdown, it is
impossible to start the cache manager via the GUI until the installer
image is ejected.
Modify checkAfsStatus to use a more robust method of determining the
state of AFS: Iterate over the mounted devices to search for a mounted
AFS filesystem.
Change-Id: I3144de9d53aed0a8673cc8d869107f012728fd7c
Reviewed-on: https://gerrit.openafs.org/14587
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Several locations within vos use strcpy without verifying the length
of the source string which could lead to potential string buffer
overflows.
There are 2 cases where the string buffer can be replace with a pointer
to the string that was being copied.
Replace the string buffers with pointers where possible.
Replace the remaining uses of strcpy with strlcpy and and where
appropriate add checks to detect and report on possible string
truncations.
Change-Id: I4189f0ad1858065acf5bac7dfa83ce662e11fa4b
Reviewed-on: https://gerrit.openafs.org/15478
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
The afs_Analyze() function can lead to excessive retries in cases where
a recoverable error cannot be resolved, or when a process is signaled to
terminate (e.g., with SIGKILL). This can cause unnecessary floods of
kernel messages or RPC requests.
afs_Analyze() analyzes RPC results, indicating if a retry is appropriate
for "recoverable" errors. Some recoverable errors may persist for an
extended period of time (e.g., a busy volume that may require time to
recover or an unavailable service). A user may desire to cancel the
request in these cases. Normally when retrying an operation there is a
sleep between retries (using VSleep() or similar functions). On Linux
systems when there is pending SIGKILL, sleep will return immediately,
so the operation is retried immediately without any delay.
For most recoverable errors, there is a limit on the number of times the
request is retried; for instance, VBUSY errors are retried 100 times
before giving up. But for network errors when hardmount is enabled,
there is no limit on the number of retries, so it is possible that
retries will be done immediately forever, possibly making the machine
slow or even unusable until the error goes away or hardmount is
disabled.
In afs_Analyze() add a call to afs_kill_pending() to check if the
process is being terminated. If the process is pending termination,
return a status indicating that the RPC request should not be retried.
Change-Id: I972931790bf680a181f1ebc45dfe7d355f7641cd
Reviewed-on: https://gerrit.openafs.org/15747
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The kernel module build can be disabled with the configure option
--disable-kernel-module ever since commit 62994d919d (allow-disabling-
kernel-module-compilation-20010705). That commit also added a feature
to automatically disable the Linux kernel module build when the Linux
kernel headers are not found.
Unfortunately, even when --enable-kernel-module is specified, configure
will disable the Linux kernel module build when the Linux headers are
not found, instead of failing configure. The build will complete
successfully, but the kernel module will be missing. When installing
from a source build, the build and install will complete without errors,
but the client will fail to start due to the missing kernel module.
Change the --enable-kernel-module to be an autodetect option by default.
When --enable-kernel-module is specified and no Linux kernel headers are
found, configure will fail (AC_MSG_ERROR), instead of disabling the
kernel module build.
This change makes --enable-kernel-module to be more consistent with the
other --enable-feature options which do probing, keeps the build system
behavior the same by default, and allows builders to specify
--enable-kernel-module to indicate the build must result in a kernel
module.
This commit keeps the check to fail configure when a path to the Linux
kernel header files are specified with the --with-linux-kernel-headers
but the headers were not found. Change the error message to avoid
printing the old /usr/src/linux path, since that was incorrect.
Add a check to fail configure when a path to the Linux kernel build
directory is specified with --with-linux-kernel-build but the Linux
kernel build files are not found. This check was probably missed when
the --with-linux-kernel-build option was added.
Move the OPENAFS_LINUX_KERNEL_PATH macro to be after the AC_MSG_RESULT
so the "checking your OS" is resolved before checking the Linux kernel
header and build paths. This cleans up the output when there is a
warning or error and will make it possible to add AC_MSG_CHECKING() in
OPENAFS_LINUX_KERNEL_PATH in the future.
Rename the existing OPENAFS_LINUX_KERNEL_PATH to the internal macro
_OPENAFS_LINUX_KERNEL_PATH, and add a new OPENAFS_LINUX_KERNEL_PATH
macro which checks and resolves the --enable-kernel-module option. The
_OPENAFS_LINUX_KERNEL_PATH macro can be improved in a future change.
Change the configure summary to check the ENABLE_KERNEL_MODULE (upper
case) variable instead of the enable_kernel_module (lower case) to
indicate when the kernel module build is enabled. This avoids the need
to change enable_kernel_module on non-Linux platforms.
Change-Id: Ieebc98425e0dea5de36f213b0c168db3202af644
Reviewed-on: https://gerrit.openafs.org/15050
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Introduce a function that checks to see if the current kernel task has
a pending kill (e.g. SIGKILL) that will terminate the process when it
returns to userspace.
Add afs_kill_pending() that uses an osi level function,
osi_kill_pending() to determine if the process has a pending
termination. If the osi level function has not been implemented, just
return 0.
Add a Linux implementation of osi_kill_pending() that calls Linux's
fatal_signal_pending() (if it's available).
Update Linux's "filter_enoent()" function in osi_vnodeops.c to use
afs_kill_pending().
A future commit will expand the use of afs_kill_pending().
Fix minor white space in an adjacent lines.
Change-Id: Ib215639d36f4baa7a1dffda3cc314d2d447c6e96
Reviewed-on: https://gerrit.openafs.org/15746
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The function afs_Analyze() currently has a common exit label `out` that
is not used consistently.
Refactor afs_Analyze() to branch to `out` instead of returning. Update
the code at `out` to only call afs_PutConn() if aconn is not NULL.
Move the call to afs_FinalizeReq() so it's earlier in the code path to
simplify early returns.
Replace a cast of 0 as a pointer with NULL.
Minor white space cleanup.
Change-Id: I552d84dd653a483774551dad1c05d7a692ac9d14
Reviewed-on: https://gerrit.openafs.org/15745
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
In order to eliminate the following warnings:
warning: initializer does not fit or is out of range: ...
change the test uuids to unsigned chars.
Change-Id: Ic75d4d8d292b309a25713979935f8e82985590b6
Reviewed-on: https://gerrit.openafs.org/15355
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Currently our perl tests use Test::More, which sends diag() messages
to stderr, including when reporting why a test failed.
Our 'runtests' harness from c-tap-harness discards stderr from test
programs, unless we run in single-test mode (-o). As a result, when we
run tests with 'runtests -v' and a test fails, we can't see any
diagnostic information if the test was using perl's Test::More,
including why a test failed. If the test is written in C using
c-tap-harness bindings, diag() goes to stdout, and this problem
doesn't happen.
To make sure we can see diag() messages from perl tests, change the
default behavior for Test::More to print diag() messages to stdout,
where they will be read by 'runtests' and shown by 'runtests -v'. The
diag messages are still discarded when running in non-v (and non-o)
mode.
Change-Id: I971a61cb9c83e85949ba6adf9af0ee54b0b23680
Reviewed-on: https://gerrit.openafs.org/15734
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
To mitigate potential build problems in the future due to redundant
inclusion of the roken header, add include guards to the generated
roken.h file, just like the real roken.h has. The addition of these
guards ensures that the header is included only once, safeguarding
against potential future build issues.
Change-Id: Ia22076038d22e60aaaa8e20ab0265d5288c54f2d
Reviewed-on: https://gerrit.openafs.org/15678
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>