Commit 248da50aa5 'icl 64 bit platform
rationalization' introduced support for 64-bit ICL_TYPE_POINTER and
ICL_TYPE_LONG for fstrace running on DARWIN kernels. However, it
neglected to make the matching change in the fstrace utility itself,
which reads and reports these trace entries. The result is that all
fstrace records which contain 64-bit pointers or longs are misreported
as 32-bit values. Furthermore, any subsequent values in the same
fstrace record are also misreported because the offsets are now
incorrect.
Move the definition of ICL_LONG from afs_icl.c to icl.h so fstrace.c may
share the ICL_LONG logic and value.
Modify fstrace to use logic similar to the recording logic in afs_icl.c
so that the correct size and offsets are maintained while decoding the
contents of each fstrace record.
We can use the build-time value of ICL_LONG (rather than the runtime
value of afs_sizeofLong) because the difference only matters for SGI62
32-bit kernels. It is unknown whether the existing code works correctly
for SGI62 32-bit mode, but this commit should not affect that support
either way.
Change-Id: I240f76fed4618822b774451c5184b1160f17221d
Reviewed-on: https://gerrit.openafs.org/14558
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
SIGFPE is normally a synchronous signal, which would not be handled by
opr softsig. However, bosserver uses SIGFPE as an asynchronous signal
to modify the local restricted mode. So allow SIGFPE in softsig
handlers, so bosserver can use softsig.
Change-Id: I413edbed967babb3e60c6fa97f89b40b8d7b3ad7
Reviewed-on: https://gerrit.openafs.org/14080
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Almost all of our opr locking primitives assert that they did not
receive an error from pthreads. opr_cv_timedwait is the exception to
this, since it needs to return two possible codes that aren't
internal failures: 0 and ETIMEDOUT. As a result, most callers assert
that our returned code is one of these two values.
To make opr_cv_timedwait act more like our other locking primitives,
removing the need to add opr_Assert()s everywhere, change
opr_cv_timedwait to check that the returned code is 0 or ETIMEDOUT,
and remove the relevant asserts from its callers.
Change-Id: Ie9a62f2edb23969d66e4ed821af37077bc6400c4
Reviewed-on: https://gerrit.openafs.org/14079
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Several callers use OS_SIZE(fdP->fd_fd) instead of just calling
FDH_SIZE(fdP). Right now these calls are equivalent, but change all of
these callers to use FDH_SIZE, to make it easier to possibly change
the behavior of FDH_SIZE in the future.
Change-Id: If846c160c71f11935de8c0e4634afa2c7f7ee53f
Reviewed-on: https://gerrit.openafs.org/14657
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
A couple of places in namei_ops.c use "fake" linkHandle FdHandle_t's.
Make sure these are initialized, so we don't accidentally use
uninitialized fields in the FdHandle_t.
Currently, the code never uses any fields that are not explicitly set
in this same code path, but this seems rather fragile, and future
commits may change the fields in an FdHandle_t.
Change-Id: I9372f03a4d3b68afd3ab24a27ae669cba92e0abe
Reviewed-on: https://gerrit.openafs.org/14656
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
As a debugging aid, add a -debug option to the dump subcommand to
display each trace record in raw hex format as well as the normal
decoded format.
Change-Id: I80dd675a07e048e25749a9afb584515effcbc08a
Reviewed-on: https://gerrit.openafs.org/14557
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Ever since it was introduced in commit 5ec5ad5 (New GetToken pioctl),
extractPioctlToken has incorrectly freed pioctlToken by passing
'&pioctlToken' to xdr_free (instead of 'pioctlToken').
This causes xdr_ktc_tokenUnion to interpret &pioctlToken (which is a
struct ktc_tokenUnion **) as a struct ktc_tokenUnion *. This doesn't
cause any corruption or panics, since ktc_tokenUnion doesn't contain
any freeable fields unless its at_type is 2 (AFSTOKEN_UNION_KAD). So
as long as the bogus 'at_type' from the misinterpreted pointer is not 2,
the xdr_free call will just not free anything (and return an error,
which we ignore).
If the bogus at_type is 2, this would probably cause some memory
corruption or other nastiness. For this to happen on 32-bit systems,
the value of the 'pioctlToken' pointer itself would need to be 0x2.
On 64-bit systems, the top or bottom 32-bits of the pointer would need
to be 0x2 (depending on endianness). Those situations seem impossible
or very unlikely on most systems, and have never been seen in the
wild.
FIXES 135238
Change-Id: Id14571d090570cfacfa920048f41c3b1e434f31c
Reviewed-on: https://gerrit.openafs.org/14651
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Since the original IBM code import, the cmd_Dispatch processor has
avoided calling beforeProc and afterProc for the built-in 'help' and
'apropos' commands. This is important, because these procs may rely on
application-defined common arguments (e.g., -cell <cell> or -noauth) for
proper operation. However, application common arguments are not defined
for built-in commands 'help' and 'apropos'.
Unfortunately, when a new built-in 'version' command was added
(350c140d89 libcmd-support-version-switch-20060630), it was not
exempted from the before and after procs.
In order to avoid a segmentation fault in 'libadmin/test/afscp
version', modify cmd to also avoid calling beforeProc and afterProc for
the 'version' command.
Change-Id: Ic899397de808fd6c4a5f66a0f5add102340064e6
Reviewed-on: https://gerrit.openafs.org/14645
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The bos client provides fixed sized buffers on the stack for RPC output
strings instead of letting xdr allocate output strings. Unfortunately,
the fixed sized buffers do not account for the terminating nul char when
the output string is the maximum size defined for the bozo RPCs.
To avoid potential buffer overflows, and to allow for larger xdr string
sizes in the future, convert these to xdr allocated strings. Be sure to
always free the xdr allocated strings.
The following bozo RPCs have xdr output strings, and are addressed in
this commit:
BOZO_EnumerateInstance
BOZO_GetCellHost
BOZO_GetCellName
BOZO_GetInstanceInfo
BOZO_GetInstanceParm
BOZO_GetInstanceStrings
BOZO_GetStatus
BOZO_ListSUsers
Thanks to Cheyenne Wills for pointing out this issue.
Change-Id: I7fb48ff6766420a2d84723e1663ff24e86313ccf
Reviewed-on: https://gerrit.openafs.org/14650
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
FDH_READV and FDH_WRITEV have been unused since commit
335ccb40 (ihandle positional read and write). Remove a couple of
lingering references to them.
Change-Id: I640d411782440958a823ef0e2aa810bddd8ceee2
Reviewed-on: https://gerrit.openafs.org/14655
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
We pass 'offset' to FDH_LOCKFILE here, but 'offset' is calculated a
few lines below. The compiler doesn't catch this, since FDH_LOCKFILE
is a macro that ignores the second argument (except on WINNT).
Just move the calculation a few lines above, to ensure 'offset' is set
before it's actually used, to avoid issues if and when FDH_LOCKFILE is
changed to use the second argument.
Change-Id: If858005cb83370ca905f93f9d3d7eed2941ddf99
Reviewed-on: https://gerrit.openafs.org/14654
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
These two lines have been ifdef'd out since commit 8f2df21ffe
pull-prototypes-to-head-20020821. Remove them.
No functional change is incurred by this commit.
Change-Id: I5d1d97d285ad50777bc5a26a53d6e0357140941d
Reviewed-on: https://gerrit.openafs.org/14335
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
In most functions, the libadmin library provides fixed sized buffers for
RPC output strings instead of letting xdr allocate the output string.
Unfortunately the fixed sized buffers do not account for the terminating
nul char when the output string is the maximum length possible for the
xdr output strings.
To avoid potential buffer overflows, and to allow for larger xdr string
sizes in the future, convert these to xdr allocated strings and use safe
string functions to copy the results to the application buffers. Fail
with an error if the application buffer is too small, instead of
overflowing the buffer or truncating results.
Thanks to Cheyenne Wills for pointing out this issue.
Change-Id: I963e1b790417863c036e897811c86a634d1d4e7f
Reviewed-on: https://gerrit.openafs.org/14626
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This routine has been dead code since the original IBM code import. It
was ifdef'd out in commit 45376df63f util-warning-cleanup-20011005.
Remove the dead code from the tree.
No functional change is incurred by this commit.
Change-Id: I33689db8e016e1dd5abb88910af8da6208a75ce6
Reviewed-on: https://gerrit.openafs.org/14334
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This routine has been dead code since the original IBM import. It was
ifdef'd out in commit 8f2df21ffe pull-prototypes-to-head-20020821.
Remove it from the tree.
No functional change is incurred by this commit.
Change-Id: Ie81bd8ed1764026e872dcf07e0b12e3c8a31c64d
Reviewed-on: https://gerrit.openafs.org/14333
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
These routines have been dead code since the original IBM code import.
They were ifdef'd out in commit 1d93f2da22
'rx-warnings-and-prototyping-20010623'
Remove them from the tree.
No functional change is incurred by this commit.
Change-Id: I958c07487e2453690535acd01b92c59fcecd1189
Reviewed-on: https://gerrit.openafs.org/14332
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
In order to avoid repeated requests for the user's password, klog.krb5
caches and reuses it whenever necessary. However, with the introduction
of commit 3a9a5783cd, klog.krb5 always
requests a TGT regardless of the state of writeTicketFile, eliminating
the need for possible extra requests for the user's password.
Moreover, krb5_get_init_creds_password() does not accept a custom
prompter on macOS (returns EINVAL). Consequently, if the -password
argument is omitted, klog.krb5 fails with the following error:
klog: Invalid argument Unable to authenticate in realm <REALM>
Given that the user won't be prompted for a password multiple times,
remove the "save and reuse password" logic and use krb5_prompter_posix()
as the prompter function (instead of klog_prompter).
Relevant issue identified by gangovind@in.ibm.com.
Change-Id: Ia994a18d1d166893f12ee78d3e6f25192ff327ee
Reviewed-on: https://gerrit.openafs.org/14643
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ganesh G. Chaudhari <gangovind@in.ibm.com>
Tested-by: Ganesh G. Chaudhari <gangovind@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
For "pretty" V=0 builds, change 'make check' to run 'runtests' in
non-verbose mode, so we just get a summary of test results, instead of
the raw test output. Without V=0, the default is unchanged, so we
still print out all test output by default.
Change-Id: I554f9d32ed5a9cd27e83fef6245af589d91e801f
Reviewed-on: https://gerrit.openafs.org/14619
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>
Currently 'make check' always runs all tests. We can run individual
tests manually, but doing so is a bit cumbersome to do under the same
environment as 'make check', since doing so means running something
like this:
$ MAKECHECK=1 $(abs_top_srcdir)/tests/libwrap @TOP_OBJDIR@/lib \
./runtests opr/fmt util/ktime
To make it easier to run single tests introduce a way of calling 'make
check' like this:
$ make check TESTS='opr/fmt util/ktime'
Which will run the same commands as 'make check', but will run
runtests with only the specified tests, instead of running the default
list.
Some makefiles currently use a "TESTS" or "tests" variable to list
their test binaries; rename them all to "BINS" to avoid conflicting
with this new use for "TESTS" and to make our makefiles a little more
consistent.
Change-Id: I427f83be0d4571794644a97123bcd1f32427bd05
Reviewed-on: https://gerrit.openafs.org/14317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Retain the factual description of what the file/flag does, but remove
the suggestion that it is useful in favor of a disclaimer that it is
not needed, and replace the emergency-recovery procedure with a short
description using -localauth.
Change-Id: I18b0dad9740f01515717d572a0374cd2f77fc02d
Reviewed-on: https://gerrit.openafs.org/14638
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Do not document that there are cases when this file should exist;
there are not.
Installation no longer needs this file, and key emergencies can
be handled using asetkey or, on 1.8.x, the kerberos tooling to modify
rxkad.keytab.
Change-Id: I0c3ba15f3ffca8660be2d8b092f10053258742e6
Reviewed-on: https://gerrit.openafs.org/12142
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
There is some code in tests/rpctestlib that appears to be for testing
fileserver RPCs and callback processing, added in commit 262a678d (An
RPC test dispatch library for vice). However, it has never been used,
it seems unlikely that it will be used anytime soon, and it's not
clear if it even works (it contains many hard-coded references to
interfaces and IP addresses).
Just remove the unused code, and some references to rpctestlib. It can
always be added back if needed (or more likely, reimplemented to be
more in line with our current test framework in tests/ ).
Change-Id: Ied3be7474581d8ee75ae000815bb7364d143fd31
Reviewed-on: https://gerrit.openafs.org/14617
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
A few pieces of opr and util have no callers, have never been used
since they were added, and are not expected to be used in the near
future. Remove the unused code; if we ever want to use any of this
again, it can be re-added when we actually need it.
Specifically, this removes:
- 'stoupper' in src/opr/casestrcpy.c, added in e117599f
(fileserver-hates-pruclient-20060626)
- 'opr_ffsll' and 'opr_flsll' in src/opr/ffs.h, added in d4369917
(opr: implement the BSD ffs() functions)
- src/util/thread_pool.c and related headers, added in 4ca57f3f
(Provide an abstract thread pool object)
Change-Id: Id098cb86318ac9e2412937f4b63b5d99e35be568
Reviewed-on: https://gerrit.openafs.org/14547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The autoconf function OPENAFS_HAVE_STRUCT_FIELD can produce a compiler
warning for an implicit function definition for memset, however with
macOS 11 (Big Sur) the default compiler flags have been changed
(-Werror=implicit-function-declaration) so that this is now flagged as an
error. As an error this can lead to an incorrect result returned by
OPENAFS_HAVE_STRUCT_FIELD.
Add an include for <string.h> to provide the necessary definition for
memset.
Note, both gcc and clang can produce the implicit function definition
warning.
Change-Id: I05ea43e1712c0450b7d1a78d4e953bfad9be28b9
Reviewed-on: https://gerrit.openafs.org/14631
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>
In afs_LoopServers and PCallBackAddr, we loop over our known servers
to issue an RPC, but we skip over servers on various conditions. For
most of those, we skip over the server before creating the relevant
conn (via afs_ConnBySA), but not for the
SRVADDR_ISDOWN/afs_HaveCallBacksFrom check. If we skip over the server
for that reason, we'll create an afs_conn and rx_connection, and then
release our refs without using them.
This doesn't cause any big problems, but it does create extra
connections and peers that linger around for at least a couple of
hours (until they get cleaned up by afs_GCUserData).
It's very easy to avoid these extra useless conns; just perform the
SRVADDR_ISDOWN/afs_HaveCallBacksFrom check before we call
afs_ConnBYSA. This also makes the check a bit more consistent with the
other checks we do.
Change-Id: Ie49b87e5dd755f77364502528a02c14944e8c23d
Reviewed-on: https://gerrit.openafs.org/14637
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The commit cf: Disable swig if shared libraries are disabled (0e84b7405)
contains a typo in a test: "x$enable_shared" != "yes". This causes
configure to exit due to incorrectly testing --enable-shared.
Update swig.m4 to correct the typo.
Change-Id: I0d769ec41e2e7896f2232965b5eaa19734033c83
Reviewed-on: https://gerrit.openafs.org/14628
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
This is a very old perl script (with accompanying documentation) to
install AFS. It has not been maintained at all since the license was
updated in 2000.
Remove it from the tree.
Change-Id: I8fb4ce9d969b8bd246f7f640b8fd63921556a529
Reviewed-on: https://gerrit.openafs.org/14624
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
When building with the option --disable-shared and swig is also enabled
(either explicitly, or autodetected) a build failure occurs when trying
to link libuafs/PERLUAFS/ukernel.so
Update the configure test for swig to disable the swig autodetection
when --disable-shared was specified, as well as emitting a notice
message stating that the swig autodetection has been disabled.
If --with-swig=yes was specified along with --disable-shared, generate a
configure error stating --with-swig is incompatible with
--disable-shared.
Change-Id: I766cf13b41c1d160e98eb160e0f907d5de2472c9
Reviewed-on: https://gerrit.openafs.org/14606
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Since commit "rx: Remove delays in multi_End_Ignore", multi_End_Ignore
and multi_Finalize_Ignore are unused in the tree, and should not be
used by callers. Remove the dead functions.
This commit bumps LT_current in libafsrpc to 3, because we are
removing the exported symbol multi_Finalize_Ignore.
Change-Id: I4d298f5118a69cfd04de44c3f268691a87a6d9a7
Reviewed-on: https://gerrit.openafs.org/14425
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
When using our multi_Rx mechanism, callers can use either multi_End or
multi_End_Ignore at the end of the multi_Rx block. Among other things,
these macros run 'rx_EndCall(call, code)' for each call in the
multi_Rx invocation that hasn't already ended. For multi_End, 'code'
is RX_USER_ABORT, and for multi_End_Ignore, 'code' is 0; the macros
are otherwise equivalent.
When multi_End is used, this means any un-ended calls are aborted with
RX_USER_ABORT, and the call immediately ends. But when
multi_End_Ignore is used, the call is not aborted, and so we must wait
for the peer to acknowledge that it has received our packets before
ending (done via an rxi_ReadProc call in rx_EndCall).
This means that if a caller multi_Abort's out of a multi call and uses
multi_End_Ignore, we'll wait for the peer to acknowledge our packets
for all of the calls we haven't processed. Waiting for that is a
complete waste of time, since we don't care about the results of those
calls (since we multi_Abort'd). This doesn't matter much if those
calls are responded to promptly, but if the peer is not up or is just
slow, it can cause us to wait several seconds until we timeout.
There are currently only three users of multi_End_Ignore:
- DoProbe in src/ubik/recovery.c
- MultiBreakCallBackAlternateAddress_r in src/viced/callback.c
- MultiProbeAlternateAddress_r in src/viced/callback.c
All of these use multi_Rx to try and probe multiple IPs for the same
machine in parallel, and so some of the calls may very well be trying
to contact unreachable IPs; we only need one to work for the call to
succeed.
To avoid the unnecessary delays in these codepaths, convert them to
use multi_End. Change multi_End_Ignore to be the same as multi_End,
and multi_Finalize_Ignore to the same as multi_Finalize, to make sure
the bad behavior is not used. The _Ignore macros/functions are now
unused in the tree, but keep them around for now since
multi_Finalize_Ignore is exported by libafsrpc.
Thanks to mbarbosa@sinenomine.net for discovering this weird behavior.
Change-Id: I65536a0975bd7a16bb805555943c032c5e6afdf3
Reviewed-on: https://gerrit.openafs.org/14595
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Commit 3be5880d (afs: Avoid panics in afs_InvalidateAllSegments) added
an assert to check that vcache->lock is write-locked before we call
afs_InvalidateAllSegments_once from a background operation.
However, afs_InvalidateAllSegments_once should always be called with
vcache->lock write-locked; there's nothing specific about the
backgrounded call that requires this. So to make sure we catch all
cases, move this assert to afs_InvalidateAllSegments_once itself.
Also remove the conditional check for WriteLocked(&avc->lock) in here,
since clearly avc->lock must be write-locked (and actually is, since
change Ic309e4006bf47bcb38fa2b53bf103e0c645a856d "afs: write-lock
vcache->lock in afs_InactiveVCache").
Add some comments to this function while we're here, to more clearly
indicate what locks are needed.
Change-Id: I10c47021e94220879cd79c0f7390c52a13ee0eee
Reviewed-on: https://gerrit.openafs.org/14592
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Since the original IBM code import, the comments for
afs_InvalidateAllSegments indicate that vcache->lock W should be held at
entry. However, even back then, only LINUX and IRIX honored this
requirement when the 'inactive' vnode operation reached
afs_InvalidateAllSegments.
Over the years, a number of commits have changed the operation and
locking for the LINUX inactive vnode op:
5293aa3561 linux-iput-and-glock-changes-20010130
e859133460 linux-osi-clear-inode-locking-fix-20010816
652f3bd9cb linux-dynamic-inodes-20050710
e0d9e434bb put-inode-speedup-20050815
b21c13dc3a linux-dentry-iput-20060813
Eventually, ac52e2f3c0
linux-dont-lock-around-inactivevcache-20061010 removed the vcache->lock
from afs_dentry_iput (the current OpenAFS handler for inactive vcaches).
The commit message states:
"iafs_InactiveVCache() [sic] calls afs_InvalidateAllSegments() which says
it should be called with the vnode locked. so the lock should
probably be moved to afs_InactiveVCache() so it can be droppped
before calling afs_remunlink()."
Unfortunately, the vcache->lock was never moved to afs_InactiveVCache.
Finally, 3be5880d1d 'afs: Avoid panics in
afs_InvalidateAllSegments' introduced a background operation
BInvalidateSegments that contains an assert for vcache->lock. This
assert has exposed the existing lack of proper locking for some paths to
afs_InvalidateAllSegments by causing a kernel panic:
d_iput -> afs_dentry_iput -> afs_InactiveVCache ->
afs_InvalidateAllSegments -> afs_BQueue(BOP_INVALIDATE_SEGMENTS..) ->
BInvalidateSegments -> osi_Assert(WriteLocked(&vcache->lock))
Prevent the panic by modifying afs_InactiveVCache to obtain vcache->lock
W before calling afs_InvalidateAllSegments, and dropping it before
calling afs_remunlink.
Thanks to Chaskiel Grundman for reporting and diagnosing the problem.
Change-Id: Ic309e4006bf47bcb38fa2b53bf103e0c645a856d
Reviewed-on: https://gerrit.openafs.org/14584
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
In several places, we look for documentation source files in e.g.
'doc/man-pages', 'doc/xml', etc. But if we are running an objdir
build, those directories won't exist relative to the current working
directory; we need to look in $srcdir to find them.
So, if we're running an objdir build, our man pages and other
documentation won't be installed. We don't report any error in this
case (the relevant steps are just skipped), since building the
documentation is optional, in case the doc sources are not present.
To fix this, look in $srcdir in the various places that reference doc
source files. Fixing the 'for' loops in the 'dest' and 'install'
targets in doc/man-pages requires some extra cd'ing around, because $M
is used as part of another path in the body of the loop.
Change-Id: Ic3c90ab5e64aeefe6235efb6f6ec26080d7b3a70
Reviewed-on: https://gerrit.openafs.org/14622
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Currently, any code that wants to perform a cold shutdown must first set
global afs_cold_shutdown = 1, then call afs_shutdown(void).
Instead, modify afs_shutdown() to accept a single parm which specifies
AFS_WARM or AFS_COLD shutdown, and to set the value of global
afs_cold_shutdown based on this parm. Remove all other assignments for
afs_cold_shutdown. Modify all callers of afs_shutdown() to specify
AFS_WARM or AFS_COLD as needed to maintain equivalent function.
This should make it much easier to tell at a glance what type of
shutdown is being requested by each caller to afs_shutdown().
No functional change should be incurred by this commit.
Change-Id: I921eca5b4d2659209154fbe37d575db69bf708b8
Reviewed-on: https://gerrit.openafs.org/12182
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Since the original IBM code import, the variable afs_shutdown has been
set but never read.
Remove it from the code base.
No functional change is incurred by this commit.
Change-Id: Iac603465ee911fa3601010b67f3f34f22d7b0e3f
Reviewed-on: https://gerrit.openafs.org/14380
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Somehow there were two. Now there is but one.
Change-Id: I60c793cf3b13508e89020e9f19847a41de4d0277
Reviewed-on: https://gerrit.openafs.org/12181
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
'afsd -shutdown' always invokes syscall(AFSOP_SHUTDOWN)
with parm2 set to 1 to indicate a "cold" shutdown.
(There are no other callers to AFSOP_SHUTDOWN).
AFSOP_SHUTDOWN sets global variable afs_cold_shutdown
based on the value of parm2. Then it checks to see if
AFS is still mounted; if so, we return early with EACCES.
However, global afs_cold_shutdown remains set.
Therefore, the next successful 'umount' after a "failed"
'afsd -shutdown' will always trigger a "cold" shutdown.
This is contrary to the intent of the current implementation,
which is to perform a "warm" shutdown upon 'umount' for
most platforms. (Exceptions: AIX, OBSD, NBSD always
specify a cold shutdown upon 'umount').
This bug would never be noticed on the "cold" exception
platforms, but on the "warm" platforms the inconsistency
of seeing an unexpected "COLD" shutdown may be confusing
and surprising.
Make shutdown operation more self-consistent by modifying
AFSOP_SHUTDOWN to defer setting of afs_cold_shutdown until
after the mount test.
Change-Id: If4ddb592d0b8fc8098f7ef96cec82f9f545b9099
Reviewed-on: https://gerrit.openafs.org/12180
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
DInit() allocates 'Buffers' with afs_max_buffers = 4*nbuffers
worth of buffer structs to allow for run-time expansion.
But shutdown_bufferpackage() free 'Buffers' as if it only had
nbuffers worth of buffer structs.
Correct the size of Buffers passed to afs_osi_Free().
Discovered during Solaris shutdown testing with kmem_flags=x0f.
This bug is not Solaris-specific, but it may be symptomless on other
platforms.
Introduced by commit e7c966354c 'Flexible
client buffer growth'; this only affected cold shutdowns (afsd
-shutdown).
After commit 2336164d1b 'afs: Actually
free resources during warm shutdown', this bug also affects warm
shutdowns (the default when /afs is unmounted).
Change-Id: I6b77f4f8f432a1c20efb1ff2349e349b46a9d58d
Reviewed-on: https://gerrit.openafs.org/12183
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
In a clean workspace, a 'make libuafs' fails to build due a missing
header file 'rx/rxgk_types.h' since the file rxgk_types.h was not
installed in the includes directory. The libuafs target consumes
rxgk_types.h (installed by rxgk_depinstall) indirectly via
auth/cellconfig.p.h that includes rxgk_types.h.
make libuafs
...
In file included from .../src/afs/UKERNEL/afs_usrops.c:27:
.../include/afs/cellconfig.h:49:10: fatal error: rx/rxgk_types.h:
No such file or directory
Add rxgk_depinstall to the list of dependencies for the auth_depinstall
target in the top Makefile to reflect the header dependency.
Change-Id: I01239396c4a5c162b75a29a8e6aaf602b3c1ebb9
Reviewed-on: https://gerrit.openafs.org/14609
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
As part of Apple's ongoing effort to modernize macOS, improve security
and reliability, the deprecation of kernel extensions was officially
announced at WWDC19. According to this announcement, Kernel programming
interfaces will be deprecated as alternatives become available, and
future OS releases will no longer load kernel extensions that use
deprecated KPIs by default.
Unfortunately, the following KPIs, extensively used by rx, are included
in the list of deprecated KPIs as of macOS 10.15:
- sock_receivembuf
- sock_close
- sock_send
- sock_socket
- sock_setsockopt
- sock_bind
To workaround this problem, delegate calls to the functions mentioned
above to bkg daemons forked by afsd. Notice that the ifadd_* and ifnet_*
functions are also deprecated. Fortunately, these calls can be avoided
enabling AFS_USERSPACE_IP_ADDR.
Thanks to Andrew Deason for his assistance (ideas, suggestions,
documentation, etc).
Change-Id: I916b66455bec73138c55e2764cc1146b998cb19f
Reviewed-on: https://gerrit.openafs.org/14431
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit introduces the new set of changes / files required to
successfully create the dmg installer on OS X 11.0 "Big Sur".
Change-Id: I600aba528305d8d42393e90fd56e98e4557d9233
Reviewed-on: https://gerrit.openafs.org/14430
Reviewed-by: Yadavendra Yadav <yadayada@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit introduces the new set of changes / files required to
successfully build the OpenAFS source code on OS X 11.0 "Big Sur".
While here, refactor the code that checks if the "-Xlinker -kext"
system-specific linker option is needed.
Change-Id: I9895ce97143aec500a5bbb4a9502eca19769c85e
Reviewed-on: https://gerrit.openafs.org/14429
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Like most OpenAFS components that work with ihandles, salvager relies on
implicit invocation of ih_PkgDefaults via the one-shot in the first call
to IH_INIT.
Unfortunately, there is at least one reachable code path in salvager
that asserts (panics) because vol_io_params has not yet been
initialized. This is when salvaging a volume group that does not have a
link table; the salvager then panics while attempting to create a new
link table:
SalvageFileSys -> SalvageFileSys1 -> DoSalvageVolumeGroup ->
CreateLinkTable -> IH_CREATE -> namei_icreate -> icreate ->
namei_SetLinkCount -> FDH_SYNC -> ih_fdsync -> osi_Assert(0)
This path was discovered while testing the non-dafs salvager, but it has
also been observed in the field with the DAFS salvageserver. It is
possible that there are additional undiscovered paths where
vol_io_params are required but uninitialized.
Add an implicit ih_PkgDefaults call to icreate to avoid triggering the
assert via the code path above.
Change-Id: If348d7f8ab2d34d55727b5a6d78db6e1c8e14cdf
Reviewed-on: https://gerrit.openafs.org/14378
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Instead of repeating the oneshot check in each caller of ih_PkgDefaults,
move the oneshot check into ih_PkgDefaults itself.
While here, ensure that ih_PkgDefaults does its work under IH_LOCK.
Finally, make ih_PkgDefaultsSet a local static variable (no longer
exported).
Change-Id: I66717de12cb5cc70de0507a768f968f6afbd38f8
Reviewed-on: https://gerrit.openafs.org/14383
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
We must be holding AFS_GLOCK at this point in the code, since we're
calling functions like ObtainSharedLock, which require AFS_GLOCK to be
held. Remove the call to ISAFS_GLOCK and the relevant conditionals, to
get rid of some visual noise.
The call to ISAFS_GLOCK was added in commit cb9e0292 (unix cm
rx-oblivious connection pooling), in which it was also unnecessary.
Change-Id: I9281108453359acf079828c1625556e2380c3a51
Reviewed-on: https://gerrit.openafs.org/14581
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Since libtool support was introduced for 1.8.x in commit 69f26ece (Add
libtool support), we've run LT_INIT or AFS_LT_INIT early on in
configure.ac.
If CC isn't set, AFS_LT_INIT defaults to using gcc when it's available.
On Solaris, we set CC and CFLAGS ourselves later (in osconf.m4) to use
the Solaris Studio compiler, but this doesn't change the compiler that
AFS_LT_INIT already chose. As a result, on Solaris if no value for CC is
given during configure and gcc is available, some libtool commands will
try to use gcc with CFLAGS intended for the Solaris Studio compiler,
which will fail.
/bin/sh ../../libtool --quiet --mode=link --tag=CC ... -mt ...
gcc: error: unrecognized command line option '-mt'; did you mean '-t'?
To fix this, move AFS_LT_INIT into osconf.m4 after our platform-specific
macros have had a chance to set CC. Also move our checks for AR, AS,
etc. to after AFS_LT_INIT, since AFS_LT_INIT sets those.
Note. Without GCC installed on a Solaris system, libtool will find the
Solaris Studio compiler (assuming that PATH is set up correctly) and the
build will proceed successfully. Just installing the GCC package is
sufficient to break the build.
This commit fixes a regression from 1.6.x where having the GCC package
installed on the system would not break the build.
Change-Id: I6458739fa5050eb98e6980e8d7b0ebfcc62d493f
Reviewed-on: https://gerrit.openafs.org/14585
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The UV_ functions UV_AddVLDBEntry, UV_ZapVolumeClones, and
UV_GenerateVolumeClones are not called by anyone in the tree. Remove
the dead code.
Change-Id: I8dfd0f183702d9f059cd5a71fb72272d0864ecc0
Reviewed-on: https://gerrit.openafs.org/14580
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The check for the '-cores none' parameter is incorrect resulting in the
parameter to be taken as a directory path.
Update the string comparison.
Change-Id: I0d72c1add52d36e40f75981a86c16b5689d38fd8
Reviewed-on: https://gerrit.openafs.org/14559
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>