Michael Meffie [Mon, 9 Apr 2018 23:50:28 +0000 (19:50 -0400)]
autoconf: remove uss from configure summary
Commit 00a33b26d74aa067086ddc340efb82184715857f (uss: always build uss)
made the uss build unconditional. Remove it from the list of optional
items in the configure summary.
Reviewed-on: https://gerrit.openafs.org/13004 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 85e9db22b265f9bb3745246fea3a07158b8a8c0e)
Change-Id: I345752f0739edc3d621b39a50157adb23923e256
Reviewed-on: https://gerrit.openafs.org/13111 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Joe Gorse <jhgorse@gmail.com> Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Pat Riehecky [Wed, 23 May 2018 20:50:45 +0000 (15:50 -0500)]
Add braces to empty conditional blocks
GCC 7+ is able to quickly optimize away empty if/else blocks if the braces are
provided. While this adds some additional syntax, it should also result
in faster optimization, so change our empty blocks after conditionals to use
braces.
FIXES 134377
Reviewed-on: https://gerrit.openafs.org/13081 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit a411366f57dcf39cc17b6d61d8332e520dff57d1)
Michael Meffie [Mon, 25 Apr 2016 15:19:10 +0000 (11:19 -0400)]
Windows: define AFS_IHANDLE_PIO_ENV for ihandle pio
Support for positional i/o in the ihandle package was added to the
windows platform in commit 50b6a116a1c412d0e6d7442d13d6e92c9dbb35ee
using native windows functions. That commit also defined HAVE_PIO in
the windows version of the afsconfig.h file. Unfortunately, that
definition of HAVE_PIO is not limited to the ihandle package.
Remove the project-wide HAVE_PIO definition from the windows afsconfig.h
file and define the new AFS_IHANDLE_PIO_ENV symbol when position i/o
support is available in the ihandle package.
Build the fallback ih_pread and ih_pwrite functions (which use lseek)
only when positional i/o is not available in the ihandle package for the
current platform.
Use AFS_IHANDLE_PIO_ENV instead of HAVE_PIO in ih_open() to determine
when it is is safe to share ihandles among threads.
Reviewed-on: https://gerrit.openafs.org/12270 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 759f29cfdfabed4dc5c1b96a0b2b79a3f83c08e3)
Michael Meffie [Sat, 28 Apr 2018 02:59:57 +0000 (22:59 -0400)]
vol: check for bad partition names
Currently, servers attempt to attach any partition name starting with
"/vicep", even partition names which map to out of range partition ids.
Examples of such misnamed partitions are "/vicepzz", "/vicep0", and
others.
The presence of these misnamed partitions cause the server processes to
crash on startup, since the out of range partition ids are used as an
index.
Add a check for the bad partition names in VCheckPartitions to avoid
attaching them. Log a warning for such partitions to let the admins know
why the partitions are not attached.
Reviewed-on: https://gerrit.openafs.org/13038 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c0f2c26e9298d12209fbb5e523ea3173202316e5)
Change-Id: Id7dcbd80402b7c8ec1f0e2e5fa2ea0123a2da898
Reviewed-on: https://gerrit.openafs.org/13120 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Jeffrey Altman [Fri, 11 May 2018 19:44:24 +0000 (15:44 -0400)]
viced: SRXAFS_InlineBulkStatus set InterfaceVersion on error
AFSFetchStatus.InterfaceVersion is required to be "1" for any
of the fields in the structure to be considered valid. Therefore,
InterfaceVersion must be set to one when returning an 'errorCode'
value.
When RXAFS_InlineBulkStatus was introduced by OpenAFS in 362d26c733b086d26f013bd229af979a112098f5 not only wasn't
InterfaceVersion set but neither was the memory allocated
to OutStats initialized. As a result the InterfaceVersion field
value could be not only zero but random. The OutStats memory
was initialized to zeros beginning with 726e1e13ff93e2cc1ac21964dc8d906869e64406.
Reviewed-on: https://gerrit.openafs.org/13067 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f045de21a45fcc8f71e2b30e826c22c8a7b4d0f2)
Change-Id: I0d15147081f6e8744680c16e43b22075070647e4
Reviewed-on: https://gerrit.openafs.org/13117 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Marcio Barbosa [Tue, 15 May 2018 21:10:45 +0000 (17:10 -0400)]
ubik: clones should not request votes
Clones should not be able to become the sync-site. To make it possible,
regular sites do not vote for a site tagged as clone. In other words,
the clones ask for votes but they cannot be the sync-site. Knowing that
their requests for votes should be refused by the regular sites, they
should never have enough votes to win the election.
In addition to the unnecessary network traffic created by these
unnecessary requests, this current approach can be problematic in some
specific situations. As an example, consider the following scenario:
The user wants to turn a regular site, called host1, into a clone.
To do so, he runs the following commands on every single server:
After that, he restarts the servers, one by one. Depending on the delay
between the restarts, a clone can become the sync-site. This is possible
because the clones request votes from the other sites. If enough regular
sites are not aware (yet) that the request for vote came from a clone,
the clone in question can get enough votes to win the election.
To fix the problems mentioned above, do not request votes if you cannot
be the sync-site.
Reviewed-on: https://gerrit.openafs.org/12654 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3cc22a442e1dad628f0b11a32c4037fc7174dde4)
Change-Id: Ifa748546aec6928eb4ca988a036d0bf8fb70f6f8
Reviewed-on: https://gerrit.openafs.org/13116 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Marcio Barbosa [Thu, 10 May 2018 03:46:01 +0000 (00:46 -0300)]
afs: alloc openafs_lck_grp before osi_Init() on darwin
Commit a27bed59cae1a4244429c752edfde0a8363c8a3b moved init_hckernel_init
to osi_Init. On Darwin (AFS_DARWIN80_ENV), MUTEX_INIT
(called by init_hckernel_init) uses openafs_lck_grp as the argument of
one of the functions called during the initialization of the mutex in
question. Since openafs_lck_grp was not allocated yet, we crash.
To fix this problem, call MUTEX_SETUP() before osi_Init() on Darwin.
Reviewed-on: https://gerrit.openafs.org/13065 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8e740aed774d4507e656e6ae743f6c6fe6c0e356)
Change-Id: Ic1c58b5e2baeedd1cd24c364dd2907761064c8a9
Reviewed-on: https://gerrit.openafs.org/13115 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Benjamin Kaduk [Sat, 5 May 2018 20:42:51 +0000 (15:42 -0500)]
Rename getDirPath to afs_getDirPath in preparation for export
The symbol name getDirPath is rather generic and we probably shouldn't
squat on it in the application's namespace. In preparation for exporting
this functionality from the Unix shared libraries, rename it to
afs_getDirPath.
Retain a Windows-only wrapper getDirPath that can continue to be
exported from libafsauthent on Windows, for ABI compatibility.
New consumers should use afs_getDirPath.
Reviewed-on: https://gerrit.openafs.org/13058 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Anders Kaseorg <andersk@mit.edu> Tested-by: Anders Kaseorg <andersk@mit.edu> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 554c38473d1465af4c4613209229c274807fffd8)
Benjamin Kaduk [Sat, 5 May 2018 18:11:00 +0000 (13:11 -0500)]
opr: install afs/opr.h and opr/lock.h
These headers are (transitively) referenced from rx_pthread.h, which is pulled
in from rx.h when AFS_PTHREAD_ENV is defined. As such, we are presenting an
incomplete public API without this header.
Reviewed-on: https://gerrit.openafs.org/13054 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Anders Kaseorg <andersk@mit.edu> Tested-by: Anders Kaseorg <andersk@mit.edu> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 792dd44ac57032a3f2a4743c83c8a0208a08ecec)
Mark Vitale [Fri, 19 May 2017 20:34:21 +0000 (16:34 -0400)]
ubik: remove redundant memset from udisk_write
When udisk_write is extending the database, DRead will return a null
buffer. udisk_write then calls DNew to get a brand new buffer for the
extension write, and clears it with memset. However, this is redundant,
since DNew has already cleared the new buffer.
Remove the redundant memset.
No functional change should be incurred by this commit.
Reviewed-on: https://gerrit.openafs.org/12621 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 845c8927ef20e245bb88bc783dc2e581b61fbaba)
Change-Id: I58d4052c69c16e4758c6accfbb2a0b1ac2aa413f
Reviewed-on: https://gerrit.openafs.org/13124 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 [Thu, 10 May 2018 21:23:48 +0000 (16:23 -0500)]
ubik: Make udisk_Log* functions static
Nothing uses the udisk_Log* functions outside of disk.c. Declare these
static to make sure they stay that way, to make it easier to change
their semantics.
Reviewed-on: https://gerrit.openafs.org/13069 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f1d389e80367c7ea532441f9aa27a6cc3e2853a7)
Change-Id: I9c1cae678fc099f1eabe4aa6a661dcbc4ea72648
Reviewed-on: https://gerrit.openafs.org/13119 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>
Mark Vitale [Fri, 25 May 2018 21:05:28 +0000 (17:05 -0400)]
afs: fix broken volume callbacks (e.g. vos release)
Commit e99bfcfaa3bca3e65f03928718c2c9eb5eff7c8c ('afs: use jenkins hash
for dcache, vcache tables') introduced new hashing implementations for
the dcache and vcache hash tables. Unfortunately, a typo introduced a
bug into the VCHashV hash function; instead of hashing by volume id, it
currently hashes by vnode.
The most common symptom is that volume callbacks (RXAFSCB_Callback with
fid <volid>:0:0) fail to find and invalidate all the files for the
specified volume. This typically manifests as persistent stale RO
content after a 'vos release' for new RW content.
This bug only affects the Unix cache manager; the Windows cache manager
implementation of RXAFSCB_Callback was unaffected.
Reviewed-on: https://gerrit.openafs.org/13090 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 1dc9bb4e7362029db073250f23a09f949e1655de)
Benjamin Kaduk [Fri, 13 Apr 2018 13:07:59 +0000 (08:07 -0500)]
BSD: Work around panic in FlushVCache
Commit 64cc7f0ca7a44bb214396c829268a541ab286c69 created the very useful
afs_StaleVCache() helper function, but unfortunately it also introduced
a subtle change into how we check for whether a vcache may be a directory.
Previously, we just used the low bit of the Fid's Vnode number, since files
have an even number and non-files an odd number. The new version uses
that check but also explicitly checks `vType(avc)` against VDIR, and this new
check involves consulting information stored in the associated vnode entry,
not the vcache directly. The afs_FlushVCache() implementation for
XBSD and DARWIN NULLs removes the cross-linkage between vcache and vnode,
so that AFSTOV(avc) becomes NULL. Just a few lines later, it calls
afs_StaleVCacheFlags(), at which point vType() dereferences a bad pointer
(offset from a NULL pointer) and panics. This would happen during shutdown,
or other periodic reclaim/flush events that can be scheduled.
Reviewed-on: https://gerrit.openafs.org/13014 Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 54e84a98f9747bb5bb2ad4b8031115ad7684c914)
Mark Vitale [Wed, 17 May 2017 20:32:20 +0000 (16:32 -0400)]
ubik: death to orphaned signals
ubik has a few very old "orphaned" LWP events that are signalled via
LWP_NoYieldSignal, but have no matching waits (LWP_WaitProcess).
Each "signal" runs the LWP waiting element list for each LWP on the
blocked queue; this may add up to substantial wasted overhead on a
heavily loaded ubik server.
Remove the orphaned signals.
No functional difference should be incurred by this commit.
Reviewed-on: https://gerrit.openafs.org/12620 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit e4c7321560acf0bd34eeee7d46269818d82fdb44)
Change-Id: I4303542683aaa62895b73a5ea93bc3d0ac82804a
Reviewed-on: https://gerrit.openafs.org/13123 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Sun, 21 Jan 2018 23:38:11 +0000 (18:38 -0500)]
Suppress statement not reached warnings under Solaris Studio
Solaris Studio issues warnings for statements which can not be reached,
such as statements following an infinite loop. For example, the return
statement will generate a 'statement not reached' warning in the
following code:
while (1) {
/* no breaks or gotos in this body */
}
return 0;
Suppress these warnings by conditionally removing such statements when
building under Solaris Studio.
Reviewed-on: https://gerrit.openafs.org/12958 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f47cb2d4a957910c3e7d4b755f41ddef5dd103c5)
Change-Id: I3ac84edbc18d7b6aebd568e9a1c4a3e47aba5512
Reviewed-on: https://gerrit.openafs.org/13107 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Ben Kaduk [Fri, 13 Dec 2013 21:17:54 +0000 (16:17 -0500)]
Export a few krb5 routines for rxgk
We need oafs_h_krb5_generate_random_block when generating random
keys and oafs_h_krb5_crypto_fx_cf2 for CombineTokens.
Having oafs_h_krb5_crypto_prf_length proves very convenient for
key derivation of transport keys, so move it to the public header
and export it.
oafs_h_krb5_enctype_keysize is needed so that we can tell whether or not we
need to pass through random_to_key() when making rxgk_keys.
oafs_h_krb5_random_to_key is needed for that random_to_key() operation.
Reviewed-on: https://gerrit.openafs.org/10936 Reviewed-by: Chas Williams <3chas3@gmail.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 348dc87bb2eeb66d1e683dc91ee36724ee18f1af)
Andrew Deason [Wed, 7 Mar 2018 19:28:34 +0000 (13:28 -0600)]
Avoid libtool 'nm' errors
Starting around Solaris 11.3, '/usr/bin/nm -p' starts reporting some
symbols with the 'C' code. libtool cannot handle this (libtool bug
#22373), which causes global_symbol_pipe in the generated libtool
script to be empty. This causes a rather confusing error when we go to
actually use libtool to link something ("syntax error near unexpected
token '|'"; see libtool bug #20947), and prevents the build from
continuing.
Address this in two ways:
For all Solaris 11 builds, default to /usr/sfw/bin/gnm over
/usr/bin/nm. This avoids any interop issues with libtool and nm, since
libtool of course works very well with GNU tooling.
In addition, try to catch any nm-related errors with libtool at
configure time, to provide a more helpful error message.
To implement these changes, create a wrapper around LT_INIT, called
AFS_LT_INIT.
Reviewed-on: https://gerrit.openafs.org/12945 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3e9ea6107973ccc4fa3d405f5b5d76666bfd624f)
Change-Id: I4a5a358857ec5bfbc31cd99fcca59f3390ad4d16
Reviewed-on: https://gerrit.openafs.org/13066 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Ian Wienand [Tue, 20 Mar 2018 03:01:43 +0000 (14:01 +1100)]
Remove warning "find_preferred_connection: no connection and !create"
find_preferred_connection() is called with !create via
afs_ConnByHost->afs_ConnBySA to determine if there is a cached
connection available. Don't warn, as it will next be called with the
create flag to create the connection anyway.
Reviewed-on: https://gerrit.openafs.org/12964 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 909d8358109445fdb316b68a8e55e17626cf17c9)
Change-Id: If2cb4fd25e98f5bbdde00f76e8b3850c53cb6358
Reviewed-on: https://gerrit.openafs.org/13025 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Marcio Barbosa [Mon, 14 May 2018 19:46:26 +0000 (16:46 -0300)]
rx: fix atomics on darwin
As described by commit b2a21422129ca1eeeb5ea1a1f7b08b537fd2a9f7, the API
used for atomic operations in kernel space is not the same as the one
used in user space. To fix this problem, the commit mentioned above
introduced macros to correct the name of these functions in kernel space.
Unfortunately, the return value of the functions used in kernel space is
not the same as the ones used in user space. Generally speaking, the
kernel space atomic functions return the original value of the variable
received as an argument before the operation in question. On the other
hand, the user space atomic functions return the new value, after the
operation has been performed. To fix this problem, this commit provides
a new set of inline functions (only used in kernel space) with the
expected return values.
Also, in order to get the inline implementations of the OSAtomic
interfaces in terms of the <stdatomic.h> primitives, commit 74f837fd943ddfa20d349a83d6286a0183cb4663 defines OSATOMIC_USE_INLINED
on OS X 10.12. However, the definition of this macro only affects the
user space legacy interfaces for atomic operations. The kernel space
interfaces for atomics are not deprecated and OSATOMIC_USE_INLINED does
not affect these functions. To fix this problem, only define
OSATOMIC_USE_INLINED in user space (OS X 10.12+).
Reviewed-on: https://gerrit.openafs.org/13063 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c16423ec4e678e5cb01dc99f4115065f8ef6caf7)
Andrew Deason [Wed, 7 Mar 2018 04:04:28 +0000 (22:04 -0600)]
SOLARIS: Check for map_addr() without 'vacalign'
Add a configure check to see if the map_addr() function contains the
'vacalign' argument or not. The argument was removed sometime around
Solaris 11.4.
Reviewed-on: https://gerrit.openafs.org/12947 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 00e12efa29659c28f0fd7b6acbfb57d91a6ca477)
Change-Id: I141ad3c54b2aa3e32311785f4320eba04d840bb2
Reviewed-on: https://gerrit.openafs.org/13102 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Wed, 7 Mar 2018 21:57:56 +0000 (15:57 -0600)]
hcrypto: Avoid arc4random in kernel
Our HAVE_ARC4RANDOM symbol represents the availability of arc4random()
in userspace, not in the kernel. On Solaris, we'll define
HAVE_ARC4RANDOM, but the built kernel module will be unusable, since
we cannot resolve the arc4random symbol.
To to avoid this, undef HAVE_ARC4RANDOM when building hcrypto for the
kernel, just like we do with HAVE_GETUID.
Reviewed-on: https://gerrit.openafs.org/12946 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6082243e42525c738239fe429bcb64e0e4f22207)
Change-Id: I41c4c6f65581aee3d53a7c4b8f6c108f88631e3f
Reviewed-on: https://gerrit.openafs.org/13101 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Mon, 19 Feb 2018 19:01:56 +0000 (14:01 -0500)]
venus: fix format overflow warning
Recent versions of gcc generate a format overflow warning on the dfstring
buffer in fs.c. Increase the size of the buffer to avoid a possible buffer
overflow.
fs.c: In function āAclToStringā:
fs.c:770:30: error: ā%sā directive writing up to 1024 bytes
into a region of size between 13 and 23 [-Werror=format-overflow=]
sprintf(dfsstring, " dfs:%d %s", acl->dfs, acl->cell);
^~
fs.c:770:2: note: āsprintfā output between 8 and 1042 bytes into
a destination of size 30
sprintf(dfsstring, " dfs:%d %s", acl->dfs, acl->cell);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reviewed-on: https://gerrit.openafs.org/12917 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit c84f36a9b8c6b6adb9c77bab1c814ccd3aaf6a5b)
Change-Id: I05bef3e09455377364a014b41de1e047f5322c8b
Reviewed-on: https://gerrit.openafs.org/13099 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Mon, 19 Feb 2018 18:57:16 +0000 (13:57 -0500)]
butc: fix format overflow warning
Recent versions of gcc generate an overflow warning in the butc DUMPNAME macro
when copying values into the finishedMsg1 buffer. Increase the size of the
destination buffer to avoid a possible buffer overflow.
dump.c:88:24: error: ā%sā directive writing up to 63 bytes into
a region of size 50 [-Werror=format-overflow=]
sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId);
^
dump.c:1294:5: note: in expansion of macro āDUMPNAMEā
DUMPNAME(finishedMsg1, nodePtr->dumpSetName, dparams.databaseDumpId);
^~~~~~~~
dump.c:88:6: note: āsprintfā output between 12 and 84 bytes into
a destination of size 50
sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dump.c:1294:5: note: in expansion of macro āDUMPNAMEā
DUMPNAME(finishedMsg1, nodePtr->dumpSetName, dparams.databaseDumpId);
^~~~~~~~
Reviewed-on: https://gerrit.openafs.org/12916 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit cec45d59440f55316097cfd6652d2ea26cd55233)
Andrew Deason [Sat, 7 Mar 2015 23:27:47 +0000 (17:27 -0600)]
Add support for arm64_linux26
Add support for the arm64/aarch64 architecture on Linux 2.6+. The
param header file is mostly combined from arm and amd64.
Note that the code for syscall interception has not been updated for
arm64, so this will not build on arm64 without support for kernel
keyrings. This also does not define any AFS syscall number, since no
number in the Linux arm64 syscall table is "free" for us to use, as
far as I am aware.
Adapted from initial patches from Micheal Waltz <mwaltz@qualcomm.com>.
Reviewed-on: https://gerrit.openafs.org/11940 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 4f7550dcaf9375046514cdd97cea0f667e955e9f)
Change-Id: I12988da1fbbc7e3733fddf4ca11ad65b96a9c02f
Reviewed-on: https://gerrit.openafs.org/13095 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Sun, 8 Mar 2015 16:47:28 +0000 (11:47 -0500)]
hcrypto: Avoid 'double' param in arm64 kernel code
Currently, the RAND_add function in hcrypto uses a floating point
argument (specifically, a 'double'), as well as any implementations of
RAND_add. On Linux arm64, we cannot use floating point code in the
kernel, since the kernel module is compiled with -mgeneral-regs-only,
which prevents the use of floating point registers. No code in the
tree actually makes use of this argument, but its mere presence is
enough to cause an error with at least some versions of gcc with
certain arguments.
To get around this, simply change all instances of 'double' in hcrypto
to be a void pointer instead. This allows the code to compile as long
as nobody actually uses that argument in the kernel. If the code is
changed such that we do actually use that argument, the argument will
be a void* and so will probably (hopefully) cause a compiler error,
and the code will need to be examined to make sure this workaround
doesn't break anything.
We already do this on Solaris, which has similar issues for different
compiler versions and compiler flags. Add arm64 Linux to the cases
where we do this, but restrict this to kernel code only, to try to
avoid doing this more often than necessary.
Reviewed-on: https://gerrit.openafs.org/11939 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit b792dea0f1f83673b0b045adf608412901b3024c)
Change-Id: I95a016ba4a3dc368680b512110eb0058fcfdb468
Reviewed-on: https://gerrit.openafs.org/13094 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Fri, 13 Mar 2015 15:33:05 +0000 (10:33 -0500)]
Do not set default AFS_SYSCALL
Currently, afs_args.h will define an AFS_SYSCALL value by default (31)
if the current platform does not define an AFS_SYSCALL value on its
own (via its param.h info).
This is dangerous, since if a platform does not define an AFS_SYSCALL,
or if it happens to not be defined for any reason, some code may try
to call syscall 31, which could be anything.
So get rid of this. If this breaks the build on any platform, then
that platform should define AFS_SYSCALL in its own platform-specific
header, or get rid of the problematic AFS_SYSCALL usage.
Reviewed-on: https://gerrit.openafs.org/11938 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 0a896b93c86e86f5b438880ef1634b4e39ee5779)
Change-Id: Ifcc17d5e26fde01302c43331ffdf005b6b9c3bd3
Reviewed-on: https://gerrit.openafs.org/13093 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Wed, 11 Mar 2015 17:55:42 +0000 (12:55 -0500)]
Do not require AFS_SYSCALL
Various parts of the code make use of AFS_SYSCALL in order to
communicate with the libafs kernel module. Even though most modern
platforms do not use an actual syscall anymore (instead using an
ioctl-based method or similar to emulate the traditional AFS syscall),
some code paths rely on AFS_SYSCALL as a fallback, or just use
AFS_SYSCALL because they were never updated to use the newer methods.
Even platforms that do not use the traditional AFS syscall still
define the AFS_SYSCALL number, in case someone still uses it for
something. However, some platforms do not have an AFS syscall number;
there is no "slot" allocated to us, so we cannot safely issue any
syscall.
For those platforms, we must not reference AFS_SYSCALL at all, or we
will fail to build. So, get rid of these references to AFS_SYSCALL if
it is not defined. In some places, we can just avoid the relevant code
making the syscall. In a few other places, we just pretend like the
libafs kernel module was not loaded and yield an ENOSYS error, to make
the code simpler.
Reviewed-on: https://gerrit.openafs.org/11937 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Ian Wienand <iwienand@redhat.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit ed513bb516acdb28fc6bbf01714ef2e1df422a8a)
Change-Id: I5e7e2381935eaa595f9fa796f963260b870dc72c
Reviewed-on: https://gerrit.openafs.org/13092 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>
Andrew Deason [Wed, 9 May 2018 00:09:42 +0000 (19:09 -0500)]
LINUX: Remove unused osi_fetchstore.c
Ever since commit ae5f411c (Linux 4.4: Do not use splice()), most of
osi_fetchstore.c has been '#if 0'd out. The only portion that isn't is
a function definition that is unreferenced (afs_linux_read_actor).
Remove the unused code, and other '#if 0' references to it; the code
can always be added back later when we can actually use it.
Reviewed-on: https://gerrit.openafs.org/13061 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 96a4bee20d42484148d163b85ca049dcc980a7a5)
Change-Id: I224a630f6f3f1d9e0d08a6cd7eae3d3b871b2bd6
Reviewed-on: https://gerrit.openafs.org/13074 Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Mon, 30 Apr 2018 22:58:43 +0000 (17:58 -0500)]
afs: WriteThroughDSlots: Avoid write error panic
Currently, afs_WriteThroughDSlots panics if our call to
afs_WriteDCache fails. Since afs_WriteThroughDSlots is called every
minute by a background daemon, this means that if our cache fs becomes
inaccessible (by being forced read-only, or for any other reason), we
are virtually guaranteed to panic relatively quickly.
To try to avoid this at least for some cases, change
afs_WriteThroughDSlots to return an error to our caller when we
encounter such an error. For our background task, we can just ignore
the error and retry the writes on a future iteration. During shutdown,
we still panic if we encounter an error, to try to avoid silently
allowing a corrupt cache to be used on subsequent boots.
Reviewed-on: https://gerrit.openafs.org/13047 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 46d5695a383b2b993fdd598b770f4e3c0e1a41f3)
Change-Id: Iccbec550c00ac725c0033b075ac3cd0b4e1c78c2
Reviewed-on: https://gerrit.openafs.org/13073 Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Mon, 30 Apr 2018 22:33:14 +0000 (17:33 -0500)]
afs: Avoid afs_GetDCache panic on cache open error
When we need to populate a dcache entry, afs_GetDCache calls
afs_CFileOpen to get a handle for our file backing that dcache.
Currently, if we cannot open the file, we panic.
To handle this a little more gracefully, just return an error from
afs_GetDCache instead. The relevant userspace request will probably
fail with EIO, but this is better than possibly crashing the whole
system.
Reviewed-on: https://gerrit.openafs.org/13046 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 22e64df8e043fa7bd78bff263866ee2bd6a6e13d)
Change-Id: Iddc7b0ebc56a64d792251f1f42c576603f2a86cf
Reviewed-on: https://gerrit.openafs.org/13072 Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Mon, 30 Apr 2018 22:30:56 +0000 (17:30 -0500)]
LINUX: Return NULL for afs_linux_raw_open error
Currently, afs_linux_raw_open (and by extension, LINUX's
implementation of osi_UFSOpen) panic when they are unable to open the
given cache file. To allow callers to handle the error more
gracefully, change afs_linux_raw_open and osi_UFSOpen to return NULL
on error, instead of panic'ing. Expand the language a little on the
message logged while we're here, since the system might keep running
after this situation now.
This commit also changes all callers that did not already handle
afs_linux_raw_open/osi_UFSOpen errors to assert on errors, so we still
panic for all situations where we encounter an error. More graceful
behavior will be added in future commits; this commit does not change
the behavior on its own.
An error on opening cache files can legitimately happen when there is
corruption in the filesystem backing the disk cache, but possibly the
easiest way to generate an error is if the filesystem has been
forcibly mounted readonly (which can happen at runtime due to
filesystem corruption or various hardware faults). The latter will
generate -EROFS (-30) errors, but of course other errors are probably
possible.
Reviewed-on: https://gerrit.openafs.org/13045 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f6af4a155d3636e8f812e40c7169dd8902ae64be)
Change-Id: I5f9a71a96cd9c875f4b024562dfa714f9cc27e2f
Reviewed-on: https://gerrit.openafs.org/13071 Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Jeffrey Altman [Fri, 23 Feb 2018 23:47:46 +0000 (18:47 -0500)]
rx: connection aborts send serial zero when no conn available
When no connection object is available, send serial number zero (0)
instead of one (1). There is no harm in sending one (1) but it might
be confused as the first packet sent on the connection. Multiple
connection aborts sent would all be sent with serial one (1).
Serial number zero (0) can be an indication to humans reading packet
traces that the sender has no knowledge of the connection.
Reviewed-on: https://gerrit.openafs.org/12932 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 09f31d4c21328bcdc1dccdedf7df53d77c22e3e3)
Change-Id: Ie5b8052903307be4bc932e57e45efae7dd75dec8
Reviewed-on: https://gerrit.openafs.org/13051 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
This change restores the prior behavior by passing a serial number
as a parameter to rxi_SendRawAbort() so that the serial number can
be obtained from the connection instead of hard coded as 1.
Reviewed-on: https://gerrit.openafs.org/12931 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit cacf2b646759132dbf21e9c04fb3cfc6c2f8f1f3)
Change-Id: I36925d4283ba0aaedc7bee0e878d0e18d9aa23a7
Reviewed-on: https://gerrit.openafs.org/13050 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Recent versions of rpm (the issue was found on Fedora 27) extract
the debuginfo data from a copy of the original files having the
package version-release as a suffix. This broke the original
change since the regular expression passed to find-debuginfo.sh
no longer matched the name of the openafs.ko file. The file list
for the -debuginfo package remained empty, which caused rpmbuild
to fail.
Relax the regex to match the previous and current file names we
are after. It is possible but unlikely that .*openafs\.ko.* will
ever match any file not being a kernel module.
Reviewed-on: https://gerrit.openafs.org/13030 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 076b73e06df8240f209470ea6ee19b66eb4166c3)
Change-Id: Ib8a683d586ad3bd5237f27546a95ce92dd9de04f
Reviewed-on: https://gerrit.openafs.org/13036 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Stephan Wiesand [Thu, 26 Apr 2018 17:50:06 +0000 (19:50 +0200)]
redhat: PACKAGE_VERSION macro no longer exists
Commit 0d0e7699c9f789214205fe6837cded1a4c95f9c0 replaced all uses
of the %PACKAGE_VERSION macro in the spec with the %version one, but
missed an instance in the kmodtool script. Fix this, to avoid a
warning during rpmbuild.
Reviewed-on: https://gerrit.openafs.org/13031 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit cfa74883e4996dfee2bd6ffaa3b967e5a7941e0b)
Change-Id: I2d57ddc3700f509da3255df1f952f55d8cd7f0e8
Reviewed-on: https://gerrit.openafs.org/13037 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Fri, 6 Apr 2018 03:43:34 +0000 (23:43 -0400)]
redhat: remove the openafs-kernel-version.sh script
Commit ec706b21530240d7fb66bad2f08513eff8f7c335 (Remove Linux 2.4 compat
from RedHat packaging) removed the use of the script
openafs-kernel-version.sh, which was used in the linux 2.4 days to look
up the current kernel version. Nowadays, we use the openafs-kmodtool
script to determine the kernel version.
Remove the unused openafs-kernel-version.sh script from the package
sources.
Reviewed-on: https://gerrit.openafs.org/12996 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 28ea20d03f8abd8109547d6825edad159748397a)
Michael Meffie [Fri, 6 Apr 2018 02:56:50 +0000 (22:56 -0400)]
redhat: remove extra kernel version check
Commit a1c072ac562ccf74e5afb8449db1bcef86aef362 (redhat: fix rpmbuild command
line option defaults) added logic to set the default value of the kernvers
variable when not specified as an rpmbuild command line option.
This default value is not necessary, since 'kmodtool verrel' already returns
the current running kernel version by default. The result of 'kmodtool verrel'
sets the kverrel variable, which holds the value of the kernel version we are
building. The kernvers variable is only used as an argument to 'kmodtool
verrel' and may be empty by default to indicate the current version should be
returned.
Remove the unnecessary setting of the default value of kernvers.
Also update the information banner to show the value of kverrel, which is the
actual version we are building, instead of kernvers, which is empty be default.
Reviewed-on: https://gerrit.openafs.org/12995 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 9f0164f4254da39c3c31e0268da58ce7a6ccda1d)
Stephan Wiesand [Wed, 4 Apr 2018 15:09:39 +0000 (17:09 +0200)]
FBSD: param.h consistency
Commit 88dc4d93f5ef080da8f56fac453f095e6c79d4a0 ("Add param.h
files for recent FreeBSD") introduced an inconsistency between
the i386 and amd64 param.h files for 11.1 and 12.0 regarding
the *_FBSD101_ENV #defines.
Citing Benjamin Kaduk: "Traditionally we have the param.h for
a FreeBSD N.0 release include the (N-1).Y values that existed
at the time of the N.0 release, and freeze that set of (N-1).Y
values for the lifetime of FreeBSD N.x, if that makes sense."
Given that FreeBSD 11.0 was released shortly after 10.3, and
12.0 is not yet released, consistently #define
*_FBSD10{1..3}_ENV for 11.1 and *_FBSD10{1..4}_ENV for 12.0
Reviewed-on: https://gerrit.openafs.org/12990 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 154512831966d12c1e32e6271d4ab1440a25b96e)
Stephan Wiesand [Mon, 26 Mar 2018 18:21:19 +0000 (20:21 +0200)]
redhat: Create unique debuginfo packages for kmods
Commit 443dd5367e0cd9050ad39a6594c5be521271b4e9 ("redhat:
separate debuginfo package for kmod rpm") introduced the
creation of separate debuginfo packages for the kmod packages.
As such, this is useful, but all debuginfo packages for a given
OpenAFS release ended up with the same name/version/release for
the kmod debuginfo package, no matter which kernel release or
variant the kmod was built for.
Move the additional black magic from the spec into the kmodtool
script where we have the means to do better: Use the same naming
and versioning conventions as for the kmod-openafs packages
themselves.
Reviewed-on: https://gerrit.openafs.org/12977 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 387ae9536888419d7b101513e04e1c644e3218d6)
Change-Id: I220408eacd0c39449843240f225cfced163cbff7
Reviewed-on: https://gerrit.openafs.org/12986 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Wed, 7 Mar 2018 17:32:43 +0000 (11:32 -0600)]
ubik: Log sync site for SDISK_SendFile USYNC error
In SDISK_SendFile, we return a USYNC error if the caller is not the
sync site. Say who the sync site is when we do this, to possibly help
post-mortem debugging.
Reviewed-on: https://gerrit.openafs.org/12943 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c44f6f7a8052bdd1fb021e07bb6ae142b61e6b5b)
Change-Id: I398780c98ee5eade75e06a42d54637c169bc250a
Reviewed-on: https://gerrit.openafs.org/12948 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
The idea is that for a .sym file consisting of, for example:
foo
bar
We then generate a regex like (^foo$|^bar$). However, since the 'tr'
removes all newlines, the line given to the last 'sed' in the pipeline
has no trailing newline. On some systems, such as Solaris, this causes
sed to not output anything at all, resulting in a regex pattern of
just "()".
For example:
# on Debian
$ echo -n foo | sed -e 's/foo/bar/'
bar$
# on Solaris
$ echo -n foo | sed -e 's/foo/bar/'
$
To avoid this, we can change the sed pipeline to not remove the
newlines until the very end. Change the way we construct our regex to
this instead:
Marcio Barbosa [Thu, 22 Feb 2018 22:53:23 +0000 (17:53 -0500)]
ubik: don't set database epoch to 0 if not needed
If our attempt to receive a fresh database from a peer fails, we will
overwrite the version.epoch field of our current local copy of the
database with an invalid value, "0". The idea behind this approach is
to make sure that this database will not be seen as a legit copy if the
transfer is not completed properly. Although it is questionable if this
approach is still necessary (since the current version writes the data
into a temporary file), it is undisputed that the database version does
not have to be invalidated if the transfer fails in a early stage where
no data has been written and we could safely continue to reuse the local
copy for read-only queries. Early failures may happen if:
1. The peer sending the database to us is not the peer we believe to be
the sync site;
2. The sender is not authorized to call DISK_SendFile;
In both cases, the database epoch is invalidated. As a result of that,
we may have the following consequences:
1. Reads may not be allowed
Once the on disk epoch is invalidated, if the server in question is
rebooted, the invalid on disk epoch will be used to initialize the in
memory epoch. At this point, reads may not be allowed since
urecovery_AllBetter checks if the in memory epoch is greater than 1.
Reads should not be blocked forever since the sync-site will send a new
database to this remote and, as a result of that, the invalid version
will be corrected.
2. Data can be lost
If the site with the invalid epoch is the one with the most recent
database, the database can be rolled back to an earlier version during a
new quorum establishment. Consider the following scenario where we have
three sites:
Site A (up - database up to date) (sync-site)
Site B (up - database up to date)
Site C (down - old database)
The epoch of B is invalidated due to the problem fixed by this patch.
Then, A is turned off and C is turned on. In this scenario, the new
sync-site will distribute the old database held by C since its epoch is
greater than 0.
To fix the problem in question, do not set the database epoch to 0
if the local database was not modified.
Acknowledgements:
Hartmut Reuter <hartmut.reuter@gmx.de>
- found the problem;
- suggested a possible solution;
Benjamin Kaduk <kaduk@mit.edu>
- submitted the first version;
Andrew Deason <adeason@sinenomine.net>
- suggested changes;
Reviewed-on: https://gerrit.openafs.org/12924 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit bd6a2484011dad6298c4ce97dd0cd68e0834baa5)
Michael Meffie [Tue, 20 Feb 2018 16:51:01 +0000 (11:51 -0500)]
afs: improve -volume-ttl error messages
Change the afs call which sets the volume ttl value to return EFAULT
instead of EINVAL when given an out of range value for the volume ttl
parameter. This is more consistent with the other op codes, which
return EFAULT when given an out of range parameter and allows the caller
to distinguish between an invalid opcode and a bad parameter.
Move the volume ttl range constants to afs_args.h, which is where
constants related to the op codes are supposed to be defined. This makes
the constants available to the caller in afsd.c as well as the
implementation in afs_call.c.
Update afsd to print a more sensible error message when the volume ttl
set calls fails due to an out of range parameter.
Reviewed-on: https://gerrit.openafs.org/12918 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6d74e3d6a1becf86cec30efc2d01a5692167afe1)
Change-Id: I2cd86b6fbba31f74862bb902ac94b0874de8afac
Reviewed-on: https://gerrit.openafs.org/12936 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Benjamin Kaduk [Fri, 2 Mar 2018 02:28:23 +0000 (20:28 -0600)]
afs_pioctl: avoid -Wpointer-sign
Change the declaration of 'addr' to be a signed int, to match
RXAFS_CallBackRxConnAddr() and the afsd_pd_GetInt() used with it.
This was detected by clang 4.0 in FreeBSD 11.1, via -Wpointer-sign.
Reviewed-on: https://gerrit.openafs.org/12934 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 79f33b859aeb3c91f2cce7597fdc138978c4e1d9)
Change-Id: Iee85059bebfc8d6fbda3409b720576bd4f6c5f8f
Reviewed-on: https://gerrit.openafs.org/12938 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Mark Vitale [Fri, 2 Mar 2018 04:16:56 +0000 (23:16 -0500)]
LINUX: fix RedHat 7.5 ENOTDIR issues
Red Hat Linux 7.5 beta introduces a new file->f_mode flag
FMODE_KABI_ITERATE as a means for certain in-tree filesystems to
indicate that they have implemented file operation iterate() instead of
readdir(). The kernel routine iterate_dir() tests this flag to decide
whether to invoke the file operation iterate() or readdir().
The OpenAFS configure script detects that the file operation iterate()
is available under RH7.5 and so implements iterate() as
afs_linux_readdir(). However, since OpenAFS does not set
FMODE_KABI_ITERATE on any of its files, the kernel's iterate_dir() will
not invoke iterate() for any OpenAFS files. OpenAFS has also not
implemented readdir(), so iterate_dir() must return -ENOTDIR.
Instead, modify OpenAFS to fall back to readdir() in this case.
Reviewed-on: https://gerrit.openafs.org/12935 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c818f86b79a636532d396887d4f22cc196c86288)
Change-Id: I71386b17f0c751b69c86ef0f5766a5baf3dc36bd
Reviewed-on: https://gerrit.openafs.org/12950 Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Thu, 15 Feb 2018 22:41:33 +0000 (16:41 -0600)]
rxdebug: NUL-terminate version before printing
Currently, 'rxdebug -version' never initializes the buffer we read the
version string into. Usually this is not noticeable, since all OpenAFS
binaries tend to pad the Rx version response packet with NULs, so we
get back several NULs to terminate the string. However, this is not
guaranteed, and if we do not get back a NUL-terminated string, we can
easily read beyond the end of the buffer.
To avoid this, initialize the 'version' buffer with NULs before we do
anything, and set the last byte to NUL, in case we exactly filled the
buffer.
Reviewed-on: https://gerrit.openafs.org/12908 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit a66629eac4dda4eea37b4f06e0850641cb2a7387)
Andrew Deason [Thu, 15 Feb 2018 22:53:57 +0000 (16:53 -0600)]
doc: Edits to the 'afsd -volume-ttl' manpage
Make a few misc changes to the text for the new -volume-ttl option:
- Minor grammatical/typo fixes
- Emphasize a little more that the default behavior allows for vldb
info to be cached _forever_
- Provide some info on the effects of changing this value
- Provide a suggested "typical" value, to give some clue as to what
should be set here, so a curious user doesn't just set this to the
first value they see (10 minutes)
Reviewed-on: https://gerrit.openafs.org/12909 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit e6c2624249a6ab96053c1d1134aec8e3f6bcee9e)
Michael Meffie [Wed, 21 Feb 2018 01:31:11 +0000 (20:31 -0500)]
redhat: package libuafs perl bindings
Require the swig package as a build dependency. Build and package the
libuafs perl bindings. Place these libraries in the openafs-devel
package, along with the man page (moved from the openfs-client package).
This fixes an rpm build error when the swig package is present on the
build system,
Jeffrey Altman [Sat, 10 Feb 2018 15:47:24 +0000 (10:47 -0500)]
rx: Do not count RXGEN_OPCODE towards abort threshold
An RXGEN_OPCODE is returned for opcodes that are not implemented by the
rx service. These opcodes might be deprecated opcodes that are no
longer supported or more recently registered opcodes that have yet to
be implemented. Clients should not be punished for issuing unsupported
calls. The clients might be old and are issuing no longer supported
calls or they might be newer and are issuing yet to be implemented calls
as part of a feature test and fallback strategy.
This change ignores RXGEN_OPCODE errors when deciding how to adjust the
rx_call.abortCount. When an RXGEN_OPCODE abort is sent the
rx_call.abortCount and rx_call.abortError are left unchanged which
preserves the state for the next failing call.
Note that this change intentionlly prevents the incrementing of the
abortCount for client connections as they never send delay aborts.
Reviewed-on: https://gerrit.openafs.org/12906 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f82d1c7d5aeae148305e867c1f79c6ea2f9e0a2a)
Marcio Barbosa [Wed, 21 Jun 2017 20:24:05 +0000 (16:24 -0400)]
ubik: check if epoch is sane before db relabel
The sync-site relabels its database at the end of the first write
transaction. The new label will be equal to the time at which the
sync-site in question first received its coordinator mandate. This time
is stored by a global called ubik_epochTime. In order to make sure that
the new database label is sane, only relabel the database if
ubik_epochTime is within a specific range.
Reviewed-on: https://gerrit.openafs.org/12640 Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Andrew Deason <adeason@dson.org> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit f5c289d00aaf7c5525b477da5b89f6675456c211)
Change-Id: I78ebd2b8aeae01ef5e3b826ad6f1de5a5c1db79e
Reviewed-on: https://gerrit.openafs.org/12886 Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Benjamin Kaduk [Sat, 9 Dec 2017 17:37:59 +0000 (11:37 -0600)]
Replace <rpc/types.h> with <rx/xdr.h>
Our in-tree xdr.h appears to have started life as a concatenation of
rpc/types.h and rpc/xdr.h, and should include all the needed functionality.
Indeed, commit 7293ddf325b149cae60d3abe7199d08f196bd2b9 even indicates
that we expect to be using our in-tree XDR everywhere anyway, so the
system XDR is superfluous.
Note that afs/sysincludes.h (not afsincludes.h!) already includes
rx/xdr.h ifndef AFS_LINUX22_ENV.
This change should help systems running glibc 2.26 or newer, which has
stopped providing the Sun RPC headers by default.
While here remove some duplicate includes of rpc/types.h in the
AIX-specific sources.
The Solaris NFS translator bits cannot really be changed, since the system
headers are used and have tight interdependencies.
Update rxgen to not emit rpc/types.h inclusion.
[mmeffie: squash 12801 to not emit rpc/types.h from rxgen]
Reviewed-on: https://gerrit.openafs.org/12800 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit e443a9fb67dbc29e6cc36661a4ac6e91af113f23)
Change-Id: I351e5c1e1223c49ca76e3d68c264ac1625abae60
Reviewed-on: https://gerrit.openafs.org/12894 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-on: https://gerrit.openafs.org/12884 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c7c71d2429cf685f3ffad6b2e6d102d900edc197)
Change-Id: I271cfeb6aea888ae40539e248a18131b0affeda8
Reviewed-on: https://gerrit.openafs.org/12901 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Mark Vitale [Tue, 30 Jun 2015 05:54:21 +0000 (01:54 -0400)]
SOLARIS: Avoid vcache locks when flushing pages for RO vnodes
We have multiple code paths that hold the following locks at the same
time:
- avc->lock for a vcache
- The page lock for a page in 'avc'
In order to avoid deadlocks, we need a consistent ordering for obtaining
these two locks. The code in afs_putpage() currently obtains avc->lock
before the page lock (Obtain*Lock is called before pvn_vplist_dirty).
The code in afs_getpages() also obtains avc->lock before the page lock,
but it does so in a loop for all requested pages (via pvn_getpages()).
On the second iteration of that loop, it obtains avc->lock, and the page
from the first iteration of the loop is still locked. Thus, it obtains a
page lock before locking avc->lock in some cases.
Since we have two code paths that obtain those two locks in a different
order, a deadlock can occur. Fixing this properly requires changing at
least one of those code paths, so the locks are taken in a consistent
order. However, doing so is complex and will be done in a separate
future commit.
For this commit, we can avoid the deadlock for RO volumes by simply
avoiding taking avc->lock in afs_putpages() at all while the pages are
locked. Normally, we lock avc->lock because pvn_vplist_dirty() will call
afs_putapage() for each dirty page (and afs_putapage() requires
avc->lock held). But for RO volumes, we will have no dirty pages
(because RO volumes cannot be written to from a client), and so
afs_putapage() will never be called.
So to avoid this deadlock issue for RO volumes, avoid taking avc->lock
across the pvn_vplist_dirty() call in afs_putpage(). We now pass a dummy
pageout callback function to pvn_vplist_dirty() instead, which should
never be called, and which panics if it ever is.
We still need to hold avc->lock a few other times during afs_putpage()
for other minor reasons, but none of these hold page locks at the same
time, so the deadlock issue is still avoided.
Benjamin Kaduk [Fri, 5 Jan 2018 04:00:15 +0000 (22:00 -0600)]
rx: remove trailing semicolons from FBSD mutex operations
Since the first introduction of FreeBSD support, the macros
(MUTEX_ENTER, etc.) for kernel mutex operations have included
trailing semicolons, unique among all the platforms.
This did not cause problems until the recent work on rx event
handlers, which put a MUTEX_ENTER() in the body of an 'if' clause
with no brackets, and attempted to follow it with an 'else' clause.
This results in the following (rather obtuse) compiler error:
Christof Hanke [Mon, 18 Dec 2017 15:58:39 +0000 (16:58 +0100)]
Avoid gcc warning
When using the configure option --enable-checking with gcc 7.2.1,
the compilation fails with
vutil.c:860:20: error: ā%sā directive writing up to 255 bytes into \
a region of size 63 [-Werror=format-overflow=]
This can be seen in the logs of the openSUSE Tumbleweed builder
for e.g. build 2368.
Avoid this warning by using snprintf which is provided by libroken
for all platforms.
Reviewed-on: https://gerrit.openafs.org/12813 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit fd4eaebb60dbefc27be98015fee23a3cf5d9752d)
Marcio Barbosa [Mon, 21 Aug 2017 18:21:54 +0000 (14:21 -0400)]
ubik: avoid DISK_Begin on sites that didn't vote for sync
As already described on 7c708506, SDISK_Begin fails on remotes if
lastYesState is not set. To fix this problem, 7c708506 does not allow
write transactions until we know that lastYesState is set on at least
quorum (ubik_syncSiteAdvertised == 1). In other words, if enough sites
received a beacon packet informing that a sync-site was elected, write
transactions will be allowed. This means that ubik_syncSiteAdvertised
can be true while lastYesState is not set in a few sites.
Consider the following scenario in a cell with frequent write
transactions:
Site A => Sync-site (up)
Site B => Remote 1 (up)
Site C => Remote 2 (down - unreachable)
Since A and B are up, we have quorum. After the second wave of beacons,
ubik_syncSiteAdvertised will be true and write transactions will be
allowed. At some point, C is not unreachable anymore. Site A sends a
copy of its database to C, but C did not vote for A yet (lastYesState ==
0). A new write transaction is initialized and, since lastYesState is
not set on C, DISK_Begin fails on this remote site and C is marked as
down. Since C is reachable, A will mark this remote site as up. The
sync-site will send its database to C, but C did not vote for A yet. A
new write transaction is initialized and, since lastYesState is not set
on C, DISK_Begin fails on this remote site and C is marked as down. In a
cell with frequent write transactions, this cycle will repeat forever.
As a result, the sync-site will be constantly sending its database to C
and quorum will be operating with less sites, increasing the chances
of re-elections.
To fix this problem, do not call DISK_Begin on remotes that did not
vote for the sync-site yet.
Reviewed-on: https://gerrit.openafs.org/12715 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 68ec78950a6e39dc1bf15012d4b889728086d0b7)
Marcio Barbosa [Mon, 21 Aug 2017 19:50:14 +0000 (15:50 -0400)]
ubik: update ubik_dbVersion during SDISK_SendFile
The ubik_dbVersion global represents the sync site's database version
and it is mostly used by the remote sites for sanity checks. Currently,
this global is updated when database changes are made on the sync site
(SDISK_Commit or SDISK_SetVersion), as well as every time we vote "yes"
for the sync-site in a beacon reply. Unfortunately, ubik_dbVersion is
not updated when a copy of the sync site's database is received via
DISK_SendFile, and it won't get updated until our next "yes" vote.
During this window, the current database version will not match
ubik_dbVersion. As a result, any write transaction during this time
frame will fail on the remote site in question.
To fix this problem, do not wait for the next beacon packet to update
ubik_dbVersion when the sync site's database is received; just update
it when we get the new database. Since no write transactions are
allowed while the db is transferring, ubik_dbVersion can be safely
updated.
Reviewed-on: https://gerrit.openafs.org/12716 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Andrew Deason <adeason@dson.org> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 50c1d1088d2adcbb37b6a9d23fdd63617b1267be)
Andrew Deason [Fri, 12 Jan 2018 03:27:28 +0000 (21:27 -0600)]
LINUX: Avoid locking inode in check_dentry_race
Currently, check_dentry_race locks the parent inode in order to ensure
it is not running in parallel with d_splice_alias for the same inode.
(For old Linux kernel versions; see commit b0461f2d: "LINUX:
Workaround d_splice_alias/d_lookup race".)
However, it is possible to hit this area of code when the parent inode
is already locked. When someone tries to create a file, directory, or
symlink, Linux tries to lookup the dentry for the target path, to see
if it already exists. While looking up the last component of the path,
Linux locks the directory, and if it finds a dentry for the target
name, it calls d_invalidate on it while the parent directory is
locked.
For a dentry with a NULL inode, we'll then try to lock the parent
inode in check_dentry_race. But since the inode is already locked, we
will deadlock.
From a user's point of view, the hang can be reproduced by doing
something similar to:
$ mkdir dir # succeeds
$ rmdir dir
$ ls -l dir
ls: cannot access dir: No such file or directory
$ mkdir dir # hangs
To avoid this, we can just change which lock we're using to avoid
check_dentry_race/d_splice_alias from running in parallel. Instead of
locking the parent inode, introduce a new global lock (called
dentry_race_sem), and lock that in check_dentry_race and around our
d_splice_alias call. We know that those are the only two users of this
new lock, so this should avoid any such deadlocks.
This does potentially reduce performance, since all tasks that hit
check_dentry_race or d_splice_alias will take the same global lock.
However, this at least still allows us to make use of negative
dentries, and this entire code path only applies to older Linux
kernels. It could be possible to add a new lock into struct vcache
instead, but using a global lock like this commit does is much
simpler.
Reviewed-on: https://gerrit.openafs.org/12868 Tested-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit ef1d4c8d328e9b9affc9864fd084257e9fa08445)
Caitlyn Marko [Thu, 9 Feb 2017 14:16:17 +0000 (09:16 -0500)]
SOLARIS: save kernel module function arguments for debugging
Add the -Wu,-save_args compiler option when building kernel modules
under Solaris 10 and 11 for the amd64 architecture.
Binaries generated with this option save function arguments on the stack
during function entry for debugging purposes. Up to six integer
arguments are saved on function entry, and are not modified during the
execution of the function.
[mmeffie: commit message update]
Reviewed-on: https://gerrit.openafs.org/12798 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 32d0493a7e4f74f5e5efdfde5eca29ed7d1bf3ec)
Marcio Barbosa [Mon, 5 Feb 2018 21:16:17 +0000 (21:16 +0000)]
autoconf: detect ctf-tools and add ctf to libafs
CTF is a reduced form of debug information similar to DWARF and stab. It
describes types and function prototypes. The principal objective of the
format is to shrink the data size as much as possible so that it could
be included in a production environment. MDB, DTrace, and other tools
use CTF debug information to read and display structures correctly.
This commit introduces a new configure option called --with-ctf-tools.
This option can be used to specify an alternative path where the tools
can be found. If the path is not provided, the tools will be searched
in a set of default directories (including $PATH). The CTF debugging
information will only be included if the corresponding --enable-debug /
--enable-debug-kernel is specified.
Note: at the moment, the Solaris kernel module is the only module
benefited by this commit.
Reviewed-on: https://gerrit.openafs.org/12680 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 88cb536f99dc58fdbeb9fa6c47c26774241a0cb6)
Michael Meffie [Sat, 30 Dec 2017 22:59:38 +0000 (17:59 -0500)]
autoconf: refactor linux-checks.m4
Further refactoring of the autoconf macros. Divy up the linux kernel
checks into smaller files.
This is a non-functional change. Care has been taken preserve the
ordering of the autoconf tests. Except for whitespace, the generated
configure file has not been changed by this refactoring. This has been
verified with a 'diff -u -w -B' comparison of the generated configure
file before and after applying this commit.
Reviewed-on: https://gerrit.openafs.org/12844 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6a2b85cd4c00a08e165cb96d2cb56bf87c6324bc)
Michael Meffie [Sat, 30 Dec 2017 17:12:59 +0000 (12:12 -0500)]
autoconf: refactor ostype.m4
Further refactoring of the autoconf macros. Move more linux and solaris
specific checks into their own files.
This is a non-functional change. Care has been taken preserve the
ordering of the autoconf tests. Except for whitespace, the generated
configure file has not been changed by this refactoring. This has been
verified with a 'diff -u -w -B' comparison of the generated configure
file before and after applying this commit.
Reviewed-on: https://gerrit.openafs.org/12843 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3c2e39bab7d927aa5f20d02a5e327927a4b2b553)
Michael Meffie [Fri, 29 Dec 2017 19:24:28 +0000 (14:24 -0500)]
autoconf: refactor acinclude.m4
The acinclude.m4 is very large and often requires to be changed for
unrelated commits. Divy up the large acinclude.m4 into a number of
smaller files to avoid so many contentions and to make the autoconf
system easier to maintain.
This is a non-functional change. Care has been taken preserve the
ordering of the autoconf tests. Except for whitespace, the generated
configure file has not been changed by this refactoring. This has been
verified with a 'diff -u -w -B' comparison of the generated configure
file before and after applying this commit.
Reviewed-on: https://gerrit.openafs.org/12842 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c72622a244e561173e86ffe88ee3c9a8c823a76a)
Michael Meffie [Wed, 17 Jan 2018 22:33:50 +0000 (17:33 -0500)]
redhat: fix conditional for kernel-debuginfo files directive
Commit 443dd5367e0cd9050ad39a6594c5be521271b4e9 added support for a
separate debuginfo package for the kernel module. Unfortunately, the
%files directive for the kernel module debuginfo package was incorrectly
placed in the %if stanza of the build_userspace condition, so the
rpmbuild fails when attempting to build just the kernel module.
Fix this by moving the new %files directive out of the build_userspace
conditional.
Reviewed-on: https://gerrit.openafs.org/12874 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f599e1ce6354c42a9c0c8f7205ba8a03c35ea72b)
Michael Meffie [Sat, 22 Jul 2017 02:30:43 +0000 (22:30 -0400)]
redhat: avoid rpmbuild exclude directives
Older versions of rpmbuild do not support the files exclude directive,
so fall back to the old way in which we remove the files to be excluded
and list the files to be included.
Reviewed-on: https://gerrit.openafs.org/12733 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit a71288a387095ccb4be83c1abae34ada80f53185)
Michael Meffie [Thu, 20 Jul 2017 08:13:04 +0000 (04:13 -0400)]
redhat: specify man pages without wildcards
Currently, some of the man pages are specified with the full name and
some are specified with a wildcard for the filename extension. Instead,
specify all the man pages without a wildcards to be more consistent and
to avoid putting incorrect man pages in packages.
This change removes a stray copy the klog.krb5.1 man page from
openafs-kauth-client subpackage and moves the AuthLog/AuthLog.dir man
pages to the optional openafs-kauth-server subpackage.
Reviewed-on: https://gerrit.openafs.org/12731 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 671db4ca5a76625d9b7133510cc1cbdda8a5d9b9)
Mark Vitale [Fri, 1 Dec 2017 01:26:46 +0000 (20:26 -0500)]
LINUX: Avoid d_invalidate() during afs_ShakeLooseVCaches()
With recent changes to d_invalidate's semantics (it returns void in Linux 3.11,
and always returns success in RHEL 7.4), it has become increasingly clear that
d_invalidate() is not the best function for use in our best-effort
(nondisruptive) attempt to free up vcaches that is afs_ShakeLooseVCaches().
The new d_invalidate() semantics always force the invalidation of a directory
dentry, which contradicts our desire to be nondisruptive, especially when
that directory is being used as the current working directory for a process.
Our call to d_invalidate(), intended to merely probe for whether a dentry
can be discarded without affecting other consumers, instead would cause
processes using that dentry as a CWD to receive ENOENT errors from getcwd().
A previous commit (c3bbf0b4444db88192eea4580ac9e9ca3de0d286) tried to address
this issue by calling d_prune_aliases() instead of d_invalidate(), but
d_prune_aliases() does not recursively descend into children of the given
dentry while pruning, leaving it an incomplete solution for our use-case.
To address these issues, modify the shakeloose routine TryEvictDentries() to
call shrink_dcache_parent() and maybe __d_drop() for directories, and
d_prune_aliases() for non-directories, instead of d_invalidate(). (Calls to
d_prune_aliases() for directories have already been removed by reverting commit c3bbf0b4444db88192eea4580ac9e9ca3de0d286.)
Just like d_invalidate(), shrink_dcache_parent() has been around "forever"
(since pre-git v2.6.12). Also like d_invalidate(), it "walks" the parent
dentry's subdirectories and "shrinks" (unhashes) unused dentries. But unlike
d_invalidate(), shrink_dcache_parent() will not unhash an in-use dentry, and
has never changed its signature or semantics.
d_prune_aliases() has also been available "forever", and has also never changed
its signature or semantics. The lack of recursive descent is not an issue for
non-directories, which cannot have such children.
[kaduk@mit.edu: apply review feedback to fix locking and avoid extraneous
changes, and reword commit message]
Reviewed-on: https://gerrit.openafs.org/12830 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit afbc199f152cc06edc877333f229604c28638d07)
Change-Id: I6d37e5584b57dcbb056385a79f67b92a363e08d2
Reviewed-on: https://gerrit.openafs.org/12851 Tested-by: BuildBot <buildbot@rampaginggeek.com> Tested-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>