openafs.git
5 years agorx: fix atomics on darwin 63/13063/3
Marcio Barbosa [Mon, 14 May 2018 19:46:26 +0000]
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+).

Change-Id: Ia6cbc76daa7068625dc9f6dff385d0568d6503bd
Reviewed-on: https://gerrit.openafs.org/13063
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

5 years agoLINUX: Remove unused osi_fetchstore.c 61/13061/4
Andrew Deason [Wed, 9 May 2018 00:09:42 +0000]
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.

Change-Id: Ifc062d5665393aa6693eb0db63aa23e4feb44df4
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>

5 years agoafs: WriteThroughDSlots: Avoid write error panic 47/13047/4
Andrew Deason [Mon, 30 Apr 2018 22:58:43 +0000]
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.

Change-Id: Ia5f180a5c709881c3e884629c02e9ff93729fa88
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>

5 years agoafs: Avoid afs_GetDCache panic on cache open error 46/13046/4
Andrew Deason [Mon, 30 Apr 2018 22:33:14 +0000]
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.

Change-Id: If570ecc7f0fd0aab8340b568fc6cb2e2d316f35a
Reviewed-on: https://gerrit.openafs.org/13046
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>

5 years agoUse afs_DestroyReq in afs_PrefetchNoCache() 60/13060/2
Benjamin Kaduk [Tue, 8 May 2018 23:04:21 +0000]
Use afs_DestroyReq in afs_PrefetchNoCache()

Since commit 76ad941902c650a4a716168d3cbe68f62aef109f we use afs_DestroyReq()
instead of osi_Free() directly.

Also update the UKERNEL version of the function to afs_CreateReq() properly.

FIXES 134533

Change-Id: I4a13f6232dbed12ee00ce219cb5f515529fff58c
Reviewed-on: https://gerrit.openafs.org/13060
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

5 years agoLINUX: Return NULL for afs_linux_raw_open error 45/13045/3
Andrew Deason [Mon, 30 Apr 2018 22:30:56 +0000]
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.

Change-Id: I1462ec43c76c0b07e9368b37a9dbaedf6b6f4409
Reviewed-on: https://gerrit.openafs.org/13045
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

5 years agoBSD: Work around panic in FlushVCache 14/13014/3
Benjamin Kaduk [Fri, 13 Apr 2018 13:07:59 +0000]
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.

Change-Id: I0800e5c743cedcbec628bfa8c8ea8978c2488c1c
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>

5 years agoredhat: PACKAGE_VERSION macro no longer exists 31/13031/2
Stephan Wiesand [Thu, 26 Apr 2018 17:50:06 +0000]
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.

Change-Id: I363241f45c5261aaf2fa0619fb159022f6dbd56a
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>

5 years agoredhat: Make separate debuginfo for kmods work with recent rpm 30/13030/2
Stephan Wiesand [Thu, 26 Apr 2018 17:33:31 +0000]
redhat: Make separate debuginfo for kmods work with recent rpm

Commit 443dd5367e0cd9050ad39a6594c5be521271b4e9 introduced the
creation of separate debuginfo packages for kmod packages, and
commmit 387ae9536888419d7b101513e04e1c644e3218d6 moved the code
from the spec into the kmodtool script.

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.

Change-Id: I57178ed2c593551ede6f4ab2679dd0360dc362cf
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>

6 years agorx: connection aborts send serial zero when no conn available 32/12932/3
Jeffrey Altman [Fri, 23 Feb 2018 23:47:46 +0000]
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.

Change-Id: I1951284f810170bd130e4f1d8ed93b903cd66659
Reviewed-on: https://gerrit.openafs.org/12932
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agorx: pass serial number to rxi_SendRawAbort 31/12931/3
Jeffrey Altman [Fri, 23 Feb 2018 23:26:24 +0000]
rx: pass serial number to rxi_SendRawAbort

The practice of stamping abort packets with the connection's next
serial number was altered by a0ae8f514519b73ba7f7653bb78b9fc5b6e228f8.

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.

Change-Id: I0fb516b2c596e675fa4bc44598a697de81d36d83
Reviewed-on: https://gerrit.openafs.org/12931
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoautoconf: add kernel module to the summary 05/13005/2
Michael Meffie [Mon, 9 Apr 2018 23:54:54 +0000]
autoconf: add kernel module to the summary

Add the kernel module to the list of optional build items in the
configure summary to indicate whether the kernel module build is
enabled.

Change-Id: I11d247ac66d8119910a90a0240b0ce5854449db4
Reviewed-on: https://gerrit.openafs.org/13005
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoautoconf: remove uss from configure summary 04/13004/2
Michael Meffie [Mon, 9 Apr 2018 23:50:28 +0000]
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.

Change-Id: Ia249451c574974b4f0892c4d6d626c57404ea8ce
Reviewed-on: https://gerrit.openafs.org/13004
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoautoconf: remove more linux 2.4 references 03/13003/2
Michael Meffie [Mon, 9 Apr 2018 20:42:41 +0000]
autoconf: remove more linux 2.4 references

Remove old linux 2.2 and 2.4 references in the autoconf macros left over
from the linux 2.2 and 2.4 days.

Change-Id: Ie859d938fa1fee1d98a035b55e5e41120b66bc69
Reviewed-on: https://gerrit.openafs.org/13003
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoredhat: remove the openafs-kernel-version.sh script 96/12996/2
Michael Meffie [Fri, 6 Apr 2018 03:43:34 +0000]
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.

Change-Id: I6494812004f7b59c786ff670ff37c2fdc354f371
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>

6 years agoredhat: remove extra kernel version check 95/12995/2
Michael Meffie [Fri, 6 Apr 2018 02:56:50 +0000]
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.

Change-Id: I45ded3b4f61ec60a64288b89c1d553df9fa7b867
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>

6 years agoRemove warning "find_preferred_connection: no connection and !create" 64/12964/2
Ian Wienand [Tue, 20 Mar 2018 03:01:43 +0000]
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.

Change-Id: I02c2150a04ef20c54da793926fb402b946311f9a
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>

6 years agoFBSD: param.h consistency 90/12990/4
Stephan Wiesand [Wed, 4 Apr 2018 15:09:39 +0000]
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

Change-Id: Ibb7e6c4caaab7aa97b32eeec7aa0bbe998bb57f7
Reviewed-on: https://gerrit.openafs.org/12990
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoautoconf: remove check for lorder 81/12981/2
Marcio Barbosa [Thu, 29 Mar 2018 18:52:12 +0000]
autoconf: remove check for lorder

Currently, lorder is not being used. Remove the conditional that checks
if this binary exists.

Change-Id: I5ccee8b34f33ba0bda38a1d0478ff7a46f73f79c
Reviewed-on: https://gerrit.openafs.org/12981
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoredhat: Create unique debuginfo packages for kmods 77/12977/3
Stephan Wiesand [Mon, 26 Mar 2018 18:21:19 +0000]
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.

Change-Id: Ibcb34e4c8efde13d0600005772751d8aeb8154aa
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>

6 years agoExport {Get,Set}ServiceSpecific from liboafs_rx.la 89/10589/15
Ben Kaduk [Fri, 13 Dec 2013 21:25:47 +0000]
Export {Get,Set}ServiceSpecific from liboafs_rx.la

rxgk will use service-specific data.

Change-Id: Id9e2d4b9920e771e1583b9362e61de6216c246b4
Reviewed-on: https://gerrit.openafs.org/10589
Reviewed-by: Daria Phoebe Brashear <dariaphoebe@auristor.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoAdd some time-related helpers 66/10566/16
Ben Kaduk [Mon, 9 Dec 2013 19:42:13 +0000]
Add some time-related helpers

RXGK_NOW(), a quick routine to get the current timestamp as an rxgkTime,
and secondsToRxgkTime for the more general scaling factor.

Change-Id: I0051b5c8e5ad61e35431d97454bf2741daba90cb
Reviewed-on: https://gerrit.openafs.org/10566
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoSuppress statement not reached warnings under Solaris Studio 58/12958/2
Michael Meffie [Sun, 21 Jan 2018 23:38:11 +0000]
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.

Change-Id: Ib4f465bf9c00eff0d603e5bd643db7d3a5aa0ba0
Reviewed-on: https://gerrit.openafs.org/12958
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoafs: squash empty declaration warning 57/12957/2
Michael Meffie [Sun, 14 Jan 2018 01:14:59 +0000]
afs: squash empty declaration warning

Remove spurious semi-colon which generates a warning when
building under Solaris Studio.

  "./src/afs/UKERNEL/sysincludes.h", line ...: warning: syntax error:  empty declaration

Change-Id: I022728ddfd4b8229db0a247de2470846c802a462
Reviewed-on: https://gerrit.openafs.org/12957
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agolibafs: git ignore build artifacts on Solaris 55/12955/2
Michael Meffie [Sat, 20 Jan 2018 23:34:18 +0000]
libafs: git ignore build artifacts on Solaris

Ignore build artifacts generated when building the kernel
module for Solaris:

src/libafs/inet
src/libafs/nfs
src/libafs/ufs

Change-Id: Ie791c45c48ffc15547864bee568f52f74ab6020f
Reviewed-on: https://gerrit.openafs.org/12955
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoExport a few krb5 routines for rxgk 36/10936/14
Ben Kaduk [Fri, 13 Dec 2013 21:17:54 +0000]
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.

Change-Id: Ia34c8028b07df203b3885157e2d46c6bb512f608
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>

6 years agoauth: Let superuser identities be superusers 75/10575/17
Ben Kaduk [Wed, 4 Dec 2013 18:03:15 +0000]
auth: Let superuser identities be superusers

We have a special rx_identity_kind for superusers, let it actually
be useful for something.

Change-Id: I1d551ed8e5fcfd6bdc29c6c27eee4c2ae67e1a89
Reviewed-on: https://gerrit.openafs.org/10575
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoSOLARIS: Check for map_addr() without 'vacalign' 47/12947/2
Andrew Deason [Wed, 7 Mar 2018 04:04:28 +0000]
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.

Change-Id: Id11c10cf849511635bd9490c97d978b4bdaa5e06
Reviewed-on: https://gerrit.openafs.org/12947
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agohcrypto: Avoid arc4random in kernel 46/12946/2
Andrew Deason [Wed, 7 Mar 2018 21:57:56 +0000]
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.

Change-Id: I17472420b35e7be6b4f698082714c2e51bdb064b
Reviewed-on: https://gerrit.openafs.org/12946
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoAvoid libtool 'nm' errors 45/12945/3
Andrew Deason [Wed, 7 Mar 2018 19:28:34 +0000]
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.

Change-Id: I7d47c17f9d9401dc5dcc9676279bf1e4f53554c4
Reviewed-on: https://gerrit.openafs.org/12945
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agovenus: convert fs.c to safer string functions 23/12923/4
Michael Meffie [Thu, 22 Feb 2018 18:23:18 +0000]
venus: convert fs.c to safer string functions

Convert string handling to safer functions to avoid buffer overflows.

Change-Id: Ibb4f18d78724d87a002e2b0458cba2cceee8670c
Reviewed-on: https://gerrit.openafs.org/12923
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agovenus: fix format overflow warning 17/12917/4
Michael Meffie [Mon, 19 Feb 2018 19:01:56 +0000]
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);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: Iead8b153a62f2928fabaeee1ed126535f67d7d49
Reviewed-on: https://gerrit.openafs.org/12917
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agobutc: convert butc/dump.c to safer string handling 22/12922/3
Michael Meffie [Thu, 22 Feb 2018 21:07:55 +0000]
butc: convert butc/dump.c to safer string handling

Convert butc/dump.c to safer string handling functions to avoid buffer
overflows.

Change-Id: I36338804ee5d0ac2eb818c42cf2671497cd5967f
Reviewed-on: https://gerrit.openafs.org/12922
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agobutc: fix format overflow warning 16/12916/2
Michael Meffie [Mon, 19 Feb 2018 18:57:16 +0000]
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);
         ^~~~~~~~

Change-Id: Iadf87a308ab6c500a8407a269bc0fd443ff0c735
Reviewed-on: https://gerrit.openafs.org/12916
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoubik: Log sync site for SDISK_SendFile USYNC error 43/12943/2
Andrew Deason [Wed, 7 Mar 2018 17:32:43 +0000]
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.

Change-Id: I62a3565fca20171be20481638c261c4659c68ab2
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>

6 years agoAvoid empty libtool -export-symbols-regex pattern 44/12944/2
Andrew Deason [Wed, 7 Mar 2018 19:11:03 +0000]
Avoid empty libtool -export-symbols-regex pattern

Currently, in LT_LDLIB_shlib_missing, we construct our
-export-symbols-regex pattern like so (with some escaping):

    "($(sed -e 's/^/^/' -e 's/$/$/' xxx.sym | tr '\n' '|' | sed -e 's/|$//'))"

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:

    "($(sed -e 's/^/^/' -e 's/$/$|/' -e '$ s/|$//' xxx.sym | tr -d '\n'))"

So the sed removes the extra '|' in the last element by looking at the
last line, instead of looking at the end of the line after the 'tr'
conversion.

Change-Id: Id382132f6b400bf961dbaa52138a9abd0168118d
Reviewed-on: https://gerrit.openafs.org/12944
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoLINUX: fix RedHat 7.5 ENOTDIR issues 35/12935/6
Mark Vitale [Fri, 2 Mar 2018 04:16:56 +0000]
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.

Change-Id: I242276150ab2a506e1e9c5c752e3f17d36c98935
Reviewed-on: https://gerrit.openafs.org/12935
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoafs_pioctl: avoid -Wpointer-sign 34/12934/3
Benjamin Kaduk [Fri, 2 Mar 2018 02:28:23 +0000]
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.

Change-Id: Ibd2679e6a4519db46f57693ff58221f18f6a2fe1
Reviewed-on: https://gerrit.openafs.org/12934
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoubik: don't set database epoch to 0 if not needed 24/12924/4
Marcio Barbosa [Thu, 22 Feb 2018 22:53:23 +0000]
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;

Change-Id: I4f6a6e92aa0bd4282fab4743ea622815a009fecf
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>

6 years agoafs: improve -volume-ttl error messages 18/12918/3
Michael Meffie [Tue, 20 Feb 2018 16:51:01 +0000]
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.

Change-Id: I6b3ab7d38a60464017daf06f70080a90d2a7a429
Reviewed-on: https://gerrit.openafs.org/12918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoredhat: package libuafs perl bindings 19/12919/2
Michael Meffie [Wed, 21 Feb 2018 01:31:11 +0000]
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,

    RPM build errors:
    Installed (but unpackaged) file(s) found:
    /usr/lib64/perl/AFS/ukernel.pm
    /usr/lib64/perl/ukernel.so

FIXES 134470

Change-Id: Ifa8a0938f0c16e6099cd2923a71dd6466052a4d8
Reviewed-on: https://gerrit.openafs.org/12919
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agorx: Do not count RXGEN_OPCODE towards abort threshold 06/12906/2
Jeffrey Altman [Sat, 10 Feb 2018 15:47:24 +0000]
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.

Change-Id: I87787e7ad0a85d52a01711bb75e2be1af9a868b8
Reviewed-on: https://gerrit.openafs.org/12906
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoRHEL: Add aarch64/arm64 to spec file 11/12911/2
Andrew Deason [Fri, 16 Feb 2018 00:40:07 +0000]
RHEL: Add aarch64/arm64 to spec file

Change-Id: I2247f40a839e976605e80cf468d7a023598d5dc5
Reviewed-on: https://gerrit.openafs.org/12911
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agodoc: Edits to the 'afsd -volume-ttl' manpage 09/12909/2
Andrew Deason [Thu, 15 Feb 2018 22:53:57 +0000]
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)

Change-Id: Ib6b2871b111c392260ea80e26273201b09d4c402
Reviewed-on: https://gerrit.openafs.org/12909
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Andrew Deason <adeason@sinenomine.net>

6 years agorxdebug: NUL-terminate version before printing 08/12908/4
Andrew Deason [Thu, 15 Feb 2018 22:41:33 +0000]
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.

Change-Id: I1b1ae546c01f018a9b4e198f918c2d9eb86015d6
Reviewed-on: https://gerrit.openafs.org/12908
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Andrew Deason <adeason@sinenomine.net>

6 years agoAdd support for arm64_linux26 40/11940/12
Andrew Deason [Sat, 7 Mar 2015 23:27:47 +0000]
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>.

Change-Id: I1ee239ded17d8fea3b91b70405215aa1b3f7a6e9
Reviewed-on: https://gerrit.openafs.org/11940
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agohcrypto: Avoid 'double' param in arm64 kernel code 39/11939/12
Andrew Deason [Sun, 8 Mar 2015 16:47:28 +0000]
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.

Change-Id: Ifd10786cd9ac6c9d5152b927e180b7362131f359
Reviewed-on: https://gerrit.openafs.org/11939
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoDo not set default AFS_SYSCALL 38/11938/11
Andrew Deason [Fri, 13 Mar 2015 15:33:05 +0000]
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.

Change-Id: I9583c8e5adc4106848a437d81306000490787ef3
Reviewed-on: https://gerrit.openafs.org/11938
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoDo not require AFS_SYSCALL 37/11937/11
Andrew Deason [Wed, 11 Mar 2015 17:55:42 +0000]
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.

Change-Id: I38e033caf7149c2b1b567f9877221ca8551db2ea
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>

6 years agoutil: Add the AFS_STRINGIZE() macro 93/12893/2
Andrew Deason [Mon, 5 Feb 2018 06:07:10 +0000]
util: Add the AFS_STRINGIZE() macro

Add a macro to help with easily printing the value of #define'd
constants, called AFS_STRINGIZE(). For example:

    printf("The value of AFS_SYSCALL is: " AFS_STRINGIZE(AFS_SYSCALL) "\n");

Change-Id: I19a3e9d930f1ca2085506957b4e96dff5bf1c22e
Reviewed-on: https://gerrit.openafs.org/12893
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ian Wienand <iwienand@redhat.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoSOLARIS: save kernel module function arguments for debugging 98/12798/5
Caitlyn Marko [Thu, 9 Feb 2017 14:16:17 +0000]
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]

Change-Id: I7ee50e5108a46685efa17d0380883c6d1702a5e4
Reviewed-on: https://gerrit.openafs.org/12798
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoautoconf: detect ctf-tools and add ctf to libafs 80/12680/8
Marcio Barbosa [Mon, 5 Feb 2018 21:16:17 +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.

Change-Id: If0a584377652a573dd1846eae30d42697af398d0
Reviewed-on: https://gerrit.openafs.org/12680
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoAdd .gitreview 84/12884/3
Ian Wienand [Thu, 1 Feb 2018 23:52:26 +0000]
Add .gitreview

git-review [1] makes it much easier to submit changes.  Add a default
configuration file.

[1] https://docs.openstack.org/infra/git-review/usage.html

Change-Id: I9615a81c9b199c86e8de2fedc710e3246deeac84
Reviewed-on: https://gerrit.openafs.org/12884
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoSOLARIS: Avoid vcache locks when flushing pages for RO vnodes 47/12247/6
Mark Vitale [Tue, 30 Jun 2015 05:54:21 +0000]
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.

[mmeffie: comments, and fix missing write lock, fix lock releases]
[adeason: revised commit message]

Change-Id: Iec11101147220828f319dae4027e7ab1f08483a6
Reviewed-on: https://gerrit.openafs.org/12247
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoadd rfc3961.h to kernel sources 82/12882/2
Michael Meffie [Wed, 31 Jan 2018 21:52:40 +0000]
add rfc3961.h to kernel sources

Export this header to the kernel sources in the libafs_tree, since it is
needed for the kernel module build.

FIXES 134476

Change-Id: Id359c6d065c259601d14ee5c02b93647f86a0288
Reviewed-on: https://gerrit.openafs.org/12882
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoCellServDB update 14 Mar 2017 80/12880/2
Michael Meffie [Mon, 8 Feb 2016 17:12:22 +0000]
CellServDB update 14 Mar 2017

Update all remaining copies of CellServDB in the tree, and make the
Red Hat packaging use it by default too.

Change-Id: I5a70a7c658ad0056cd10945bb730e84f0edfb730
Reviewed-on: https://gerrit.openafs.org/12880
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoAdd param.h files for recent FreeBSD 63/12863/4
Benjamin Kaduk [Tue, 9 Jan 2018 04:28:24 +0000]
Add param.h files for recent FreeBSD

Add files for FreeBSD 10.4, 11.1, and 12.0 (12-CURRENT), for i386 and amd64.

Change-Id: I904f576914bb965a659750e6302f011acf66ba81
Reviewed-on: https://gerrit.openafs.org/12863
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoFBSD: catch up to missing sysnames 62/12862/4
Benjamin Kaduk [Tue, 9 Jan 2018 03:27:04 +0000]
FBSD: catch up to missing sysnames

Add sysnames for i386 and amd64 10.4, 11.1, and 12.0 (12-CURRENT, at present).

Change-Id: If38ecca7b2b3e40c186b7e9321ce017b4711139c
Reviewed-on: https://gerrit.openafs.org/12862
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoubik: check if epoch is sane before db relabel 40/12640/3
Marcio Barbosa [Wed, 21 Jun 2017 20:24:05 +0000]
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.

Change-Id: I2408569e5de46d387f63cbc2fab05ea1264a505c
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>

6 years agoubik: update ubik_dbVersion during SDISK_SendFile 16/12716/3
Marcio Barbosa [Mon, 21 Aug 2017 19:50:14 +0000]
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.

Change-Id: Ide7a695a69cb3229ad585d9e56c5ddc2efb76dd7
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>

6 years agoLINUX: Avoid locking inode in check_dentry_race 68/12868/2
Andrew Deason [Fri, 12 Jan 2018 03:27:28 +0000]
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.

Change-Id: Ide0f21145c83d6fbb34c637d8a36c8cd21549940
Reviewed-on: https://gerrit.openafs.org/12868
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoredhat: fix conditional for kernel-debuginfo files directive 74/12874/2
Michael Meffie [Wed, 17 Jan 2018 22:33:50 +0000]
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.

That is, when running rpmbuild with the options:

    rpmbuild --define "build_userspace 0" --define "build_modules 1" ...

rpmbuild fails with:

    RPM build errors:
       Installed (but unpackaged) file(s) found:
       /usr/lib/debug/lib/modules/.../extra/openafs/openafs.ko.debug

Fix this by moving the new %files directive out of the build_userspace
conditional.

Change-Id: I46e74b660048022a4cc4327835c6055402a34ccf
Reviewed-on: https://gerrit.openafs.org/12874
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoautoconf: refactor linux-checks.m4 44/12844/4
Michael Meffie [Sat, 30 Dec 2017 22:59:38 +0000]
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.

Change-Id: I5ea4c9e3a0aeff1767ef561bdb8361781694ee28
Reviewed-on: https://gerrit.openafs.org/12844
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoautoconf: refactor ostype.m4 43/12843/4
Michael Meffie [Sat, 30 Dec 2017 17:12:59 +0000]
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.

Change-Id: Ib3e7b1270826970c541a695230f4e3cd13cf9e3d
Reviewed-on: https://gerrit.openafs.org/12843
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoautoconf: refactor acinclude.m4 42/12842/4
Michael Meffie [Fri, 29 Dec 2017 19:24:28 +0000]
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.

Change-Id: I70e7f846dea0055d00a60a47422aa73bff25c4c6
Reviewed-on: https://gerrit.openafs.org/12842
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agorx: remove trailing semicolons from FBSD mutex operations 53/12853/2
Benjamin Kaduk [Fri, 5 Jan 2018 04:00:15 +0000]
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:

   /root/openafs/src/rx/rx.c:3666:5: error: expected expression
       else
       ^

Which is more visible in the preprocessed source, as

   if (condition)
       expression;;
   else
       other_expression;

is clearly invalid C.

To fix the FreeBSD kernel module build, remove the unneeded semicolons.

Change-Id: I191009ad412852dcc03cd71a0982fe41a953301d
Reviewed-on: https://gerrit.openafs.org/12853
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agolibuafs: remove stale afs_nfsdisp.lo rule 02/12802/3
Benjamin Kaduk [Sat, 9 Dec 2017 17:44:51 +0000]
libuafs: remove stale afs_nfsdisp.lo rule

afs_nfsdisp.lo is not used, so we do not need a build rule for it.

Change-Id: I4ca53a4823b0ccd5bfd769867f6766bd05ea4ceb
Reviewed-on: https://gerrit.openafs.org/12802
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoReplace <rpc/types.h> with <rx/xdr.h> 00/12800/5
Benjamin Kaduk [Sat, 9 Dec 2017 17:37:59 +0000]
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]

Change-Id: I0b195216affa06ab9e259cb0bab0c8286a1636d9
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>

6 years agoLINUX: Avoid d_invalidate() during afs_ShakeLooseVCaches() 30/12830/7
Mark Vitale [Fri, 1 Dec 2017 01:26:46 +0000]
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]

Change-Id: Icb6138ee5785e0ef82a9b85b1d2651dfd0830043
Reviewed-on: https://gerrit.openafs.org/12830
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoLINUX: consolidate duplicate code in osi_TryEvictDentries 92/12792/5
Mark Vitale [Thu, 30 Nov 2017 22:56:13 +0000]
LINUX: consolidate duplicate code in osi_TryEvictDentries

The two stanzas for HAVE_DCACHE_LOCK are now functionally identical;
remove the preprocessor conditionals and duplicate code.

Minor functional change is incurrred for very old (before 2.6.38) Linux
versions that have dcache_lock; we are now obtaining the d_lock as well.

This is safe because d_lock is also quite old (pre-git, 2.6.12), and it
is a spinlock that's only held for checking d_unhashed.  Therefore, it
should have negligible performance impact.  It cannot cause deadlocks or
violate locking order, because spinlocks can't be held across sleeps.

Change-Id: I08faf204e6bd82c4401cdf6048d12cd551dd18fc
Reviewed-on: https://gerrit.openafs.org/12792
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@dson.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoLINUX: consolidate duplicate code in canonical_dentry 91/12791/5
Mark Vitale [Thu, 30 Nov 2017 21:51:32 +0000]
LINUX: consolidate duplicate code in canonical_dentry

The two stanzas for HAVE_DCACHE_LOCK are now identical;
remove the preprocessor conditionals and duplicate code.

No functional change should be incurred by this commit.

Change-Id: I15cd4631d1932dcfb920313acb82fcbe570087e8
Reviewed-on: https://gerrit.openafs.org/12791
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoLINUX: add afs_d_alias_lock & _unlock compat wrappers 90/12790/5
Mark Vitale [Thu, 30 Nov 2017 21:46:16 +0000]
LINUX: add afs_d_alias_lock & _unlock compat wrappers

Simplify some #ifdefs for HAVE_DCACHE_LOCK by pushing them down into
new helpers in osi_compat.h.

No functional change should be incurred by this commit.

Change-Id: Ia0dc560bc84c8db4b84ddcc77a17bab5fbf93af9
Reviewed-on: https://gerrit.openafs.org/12790
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoLINUX: create afs_linux_dget() compat wrapper 89/12789/5
Mark Vitale [Thu, 30 Nov 2017 21:08:38 +0000]
LINUX: create afs_linux_dget() compat wrapper

For dentry operations that cover multiple dentry aliases of
a single inode, create a compatibility wrapper to hide differences
between the older dget_locked() and the current dget().

No functional change should be incurred by this commit.

Change-Id: I2bb0d453417f37707018f6ba5859903c3d34c8ff
Reviewed-on: https://gerrit.openafs.org/12789
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoRevert "LINUX: do not use d_invalidate to evict dentries" 88/12788/5
Mark Vitale [Thu, 30 Nov 2017 18:45:27 +0000]
Revert "LINUX: do not use d_invalidate to evict dentries"

Linux recently changed the semantics of d_invalidate() to:
- return void
- invalidate even a current working directory

OpenAFS commit c3bbf0b4444db88192eea4580ac9e9ca3de0d286 switched libafs
to use d_prune_aliases() instead.

However, since that commit, several things have happened:
- RHEL 7.4 changed the semantics of d_invalidate() such that it
  invalidates the cwd, but did NOT change the return type to void.
  This broke our autoconf test for detecting the new semantics.
- Further research reveals that d_prune_aliases() was not the best
  choice for replacing d_invalidate().  This is because for directories,
  d_prune_aliases() doesn't invalidate dentries when they are referenced
  by its children, and it doesn't walk the tree trying to invalidate
  child dentries.  So it can leave dentries dangling, if the only
  references to thos dentries are via children.

In preparation for future commits, revert
c3bbf0b4444db88192eea4580ac9e9ca3de0d286 .

Change-Id: Iafbef23a6070180c0e21eb01a2d59385ef52f55c
Reviewed-on: https://gerrit.openafs.org/12788
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoRevert "LINUX: eliminate unused variable warning" 87/12787/4
Mark Vitale [Thu, 30 Nov 2017 19:04:48 +0000]
Revert "LINUX: eliminate unused variable warning"

This reverts commit 19599b5ef5f7dff2741e13974692fe4a84721b59
to allow also reverting commit
c3bbf0b4444db88192eea4580ac9e9ca3de0d286 .

Change-Id: I2780fe68d352f0f1def198f21127ec944d1d2c1d
Reviewed-on: https://gerrit.openafs.org/12787
Reviewed-by: Andrew Deason <adeason@dson.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoLinux 4.15: check for 2nd argument to pagevec_init 24/12824/3
Stephan Wiesand [Fri, 22 Dec 2017 13:40:32 +0000]
Linux 4.15: check for 2nd argument to pagevec_init

Linux 4.15 removes the distinction between "hot" and "cold" cache
pages, and pagevec_init() no longer takes a "cold" flag as the
second argument. Add a configure test and use it in osi_vnodeops.c .

Change-Id: Ia5287b409b2a811d2250c274579e6f15fd18fdbb
Reviewed-on: https://gerrit.openafs.org/12824
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoLinux: use plain page_cache_alloc 23/12823/2
Stephan Wiesand [Fri, 22 Dec 2017 13:17:09 +0000]
Linux: use plain page_cache_alloc

Linux 4.15 removes the distinction between "hot" and "cold" cache
pages, and no longer provides page_cache_alloc_cold(). Simply use
page_cache_alloc() instead, rather than adding yet another test.

Change-Id: I34e734223927030f7ff252acb61120366a808ad6
Reviewed-on: https://gerrit.openafs.org/12823
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoredhat: separate debuginfo package for kmod rpm 67/11867/4
Pat Riehecky [Thu, 12 Mar 2015 19:33:10 +0000]
redhat: separate debuginfo package for kmod rpm

Place the debuginfo for the kmod into its own rpm so that
it doesn't have to track against the userspace packages.

FIXES 132034

Change-Id: I60a753275d896a89c1f6896c653d78a4e1fe7e2c
Reviewed-on: https://gerrit.openafs.org/11867
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoAvoid gcc warning 13/12813/4
Christof Hanke [Mon, 18 Dec 2017 15:58:39 +0000]
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.

Change-Id: I6acd3a1c06760abc8144c0892812c3bb50477227
Reviewed-on: https://gerrit.openafs.org/12813
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agomacos: make the OpenAFS client aware of APFS 43/12743/2
Marcio Barbosa [Thu, 12 Oct 2017 15:42:40 +0000]
macos: make the OpenAFS client aware of APFS

Apple has introduced a new file system called APFS. Starting from High
Sierra, APFS replaces Mac OS Extended (HFS+) as the default file system
for solid-state drives and other flash storage devices.

The current OpenAFS client is not aware of APFS. As a result, the
installation of the current client into an APFS volume will panic the
machine.

To fix this problem, make the OpenAFS client aware of APFS.

Change-Id: Ib5ac88b87f348744864f4e33f1f222efbc852d41
Reviewed-on: https://gerrit.openafs.org/12743
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agomacos: packaging support for MacOS X 10.13 42/12742/3
Marcio Barbosa [Fri, 6 Oct 2017 13:01:12 +0000]
macos: packaging support for MacOS X 10.13

This commit introduces the new set of changes / files required to
successfully create the dmg installer on OS X 10.13 "High Sierra".

Change-Id: Id9da3cf959627a13d8cfd1d1d7412820e46ad63e
Reviewed-on: https://gerrit.openafs.org/12742
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agomacos: add support for MacOS 10.13 41/12741/3
Marcio Barbosa [Tue, 3 Oct 2017 20:01:56 +0000]
macos: add support for MacOS 10.13

This commit introduces the new set of changes / files required to
successfully build the OpenAFS source code on OS X 10.13 "High Sierra".

Change-Id: I51928279d97c9d86c67db7de5eb7fc9d317fd381
Reviewed-on: https://gerrit.openafs.org/12741
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoFix macro used to check kernel_read() argument order 08/12808/2
Benjamin Kaduk [Fri, 15 Dec 2017 01:54:57 +0000]
Fix macro used to check kernel_read() argument order

The m4 macro implementing the configure check is called
LINUX_KERNEL_READ_OFFSET_IS_LAST, but it defines a preprocessor symbol
that is just KERNEL_READ_OFFSET_IS_LAST.  Our code needs to check
for the latter being defined, not the former.

Reported by Aaron Ucko.

Change-Id: Id7cd3245b6a8eb05f83c03faee9c15bab8d0f6e8
Reviewed-on: https://gerrit.openafs.org/12808
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoOPENAFS-SA-2017-001: rx: Sanity-check received MTU and twind values
Benjamin Kaduk [Mon, 4 Dec 2017 23:20:57 +0000]
OPENAFS-SA-2017-001: rx: Sanity-check received MTU and twind values

Rather than blindly trusting the values received in the
(unauthenticated) ack packet trailer, apply some minmial sanity checks
to received values.  natMTU and regular MTU values are subject to
Rx minmium/maximum packet sizes, and the transmit window cannot drop
below one without risk of deadlock.

The maxDgramPackets value that can also be present in the trailer
already has sufficient sanity checking.

Extremely low MTU values (less than 28 == RX_HEADER_SIZE) can cause us
to set a negative "maximum usable data" size that gets used as an
(unsigned) packet length for subsequent allocation and computation,
triggering an assertion when the connection is used to transmit data.

FIXES 134450

Change-Id: I37698ff166da47a57aa0d1962ae8effc74e30851

6 years agoafs: Fix bounds check in PNewCell 82/12782/2
Benjamin Kaduk [Tue, 28 Nov 2017 04:17:28 +0000]
afs: Fix bounds check in PNewCell

Reported by the opensuse buildbot:

CC [M] /home/buildbot/opensuse-tumbleweed-i386-builder/build/src/libafs/MODLOAD-4.13.12-1-default-MP/rx_packet.o
/home/buildbot/opensuse-tumbleweed-i386-builder/build/src/afs/afs_pioctl.c: In function ‘PNewCell’:
/home/buildbot/opensuse-tumbleweed-i386-builder/build/src/afs/afs_pioctl.c:3075:55: error: ‘*’ in boolean context, suggest ‘&&’ instead [-Werror=int-in-bool-context]
     if ((afs_pd_remaining(ain) < AFS_MAXCELLHOSTS +3) * sizeof(afs_int32))
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

The bug was introduced in commit 718f85a8b6.

Change-Id: Iae55a99e35266aa763fb431f2acc4eba09fa5357
Reviewed-on: https://gerrit.openafs.org/12782
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agorx: fix call refcount leak in error case 81/12781/2
Benjamin Kaduk [Tue, 28 Nov 2017 04:07:53 +0000]
rx: fix call refcount leak in error case

The recent event handling normalization in commit
304d758983b499dc568d6ca57b6e92df24b69de8 had event handlers switch
to dropping their reference on the associated connection/call just
before return.  An early return case was missed in the conversion,
leading to a refcount leak in an error case.

Change-Id: Ie3d0bc9474fdbc09be9c753f4d0192c8cca68351
Reviewed-on: https://gerrit.openafs.org/12781
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoafs: fix kernel_write / kernel_read arguments 69/12769/3
Marcio Barbosa [Thu, 16 Nov 2017 22:24:03 +0000]
afs: fix kernel_write / kernel_read arguments

The order / content of the arguments passed to kernel_write and
kernel_read are not right. As a result, the kernel will panic if one of
the functions in question is called.

[kaduk@mit.edu: include configure check for multiple kernel_read()
variants, per linux commits bdd1d2d3d251c65b74ac4493e08db18971c09240
and e13ec939e96b13e664bb6cee361cc976a0ee621a]

FIXES 134440

Change-Id: I4753dee61f1b986bbe6a12b5568d1a8db30c65f8
Reviewed-on: https://gerrit.openafs.org/12769
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agotests: fix out of bounds access in the rx-event test 62/12762/3
Michael Meffie [Mon, 6 Nov 2017 22:37:46 +0000]
tests: fix out of bounds access in the rx-event test

Use the NUMEVENTS symbol which defines the array size instead of an
incorrect hard coded number when checking if a second event can be added
to be fired at the same time.  This fixes a potential out of bounds
access of the event test array.

Also update the comment which incorrectly mentions the incorrect number
of events in the test.

Change-Id: I4f993b42e53e7e6a42fa31302fd1baa70e9f5041
Reviewed-on: https://gerrit.openafs.org/12762
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

6 years agoSprinkle rx_GetConnection() for concision 72/12772/2
Benjamin Kaduk [Thu, 16 Nov 2017 10:49:49 +0000]
Sprinkle rx_GetConnection() for concision

Instead of inlining the body (taking the lock, incrementing the
refcount, and dropping the lock), use the convenience function
designed for this purpose.

Change-Id: I674d389e61e42710ef340e202992748e66c5e763
Reviewed-on: https://gerrit.openafs.org/12772
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agorx: fix mutex leak in error case 71/12771/2
Benjamin Kaduk [Thu, 16 Nov 2017 10:48:02 +0000]
rx: fix mutex leak in error case

Reported by Mark Vitale

Change-Id: I3269fbb0f87285bcb9af64f4ad81791177582e6d
Reviewed-on: https://gerrit.openafs.org/12771
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoAdd event-related mutex assertions 57/12757/5
Benjamin Kaduk [Wed, 1 Nov 2017 00:49:09 +0000]
Add event-related mutex assertions

In utility functions that access fields of type struct rxevent *,
assert that the appropriate lock is held for the access in question.

These assertions are only compiled in when built with -DOPR_DEBUG_LOCKS,
which can be enbled by --debug-locks at configure time.

Change-Id: I16885a4d37a0f094f0d365c54e8157ed92070c69
Reviewed-on: https://gerrit.openafs.org/12757
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoStandardize rx_event usage 56/12756/7
Benjamin Kaduk [Sun, 8 Oct 2017 03:42:38 +0000]
Standardize rx_event usage

Go over all consumers of the rx event framework and normalize its usage
according to the following principles:

rxevent_Post() is used to create an event, and it returns an event
handle (with a reference on the event structure) that can be used
to cancel the event before its timeout fires.  (There is also an
additional reference on the event held by the global event tree.)
In all(*) usage within the tree, that event handle is stored within
either an rx_connection or an rx_call.  Reads/writes to the member variable
that holds the event handle require either the conn_data_lock or call
lock, respectively -- that means that in most cases, callers of
rxevent_Post() and rxevent_Cancel() will be holding one of those
aforementioned locks.  The event handlers themselves will need to
modify the call/connection object according to the nature of the
event, which requires holding those same locks, and also a guarantee
that the call/connection is still a live object and has not been
deallocated!  Whether or not rxevent_Cancel() succeeds in cancelling
the event before it fires, whenever passed a non-NULL event structure
it will NULL out the supplied pointer and drop a reference on the
event structure.  This is the correct behavior, since the caller
has asked to cancel the event and has no further use for the event
handle or its reference on the event structure.  The caller of
rxevent_Cancel() must check its return value to know whether or
not the event was cancelled before its handler was able to run.

The interaction window between the call/connection lock and the lock
protecting the red/black tree of pending events opens up a somewhat
problematic race window.  Because the application thread is expected
to hold the call/connection lock around rxevent_Cancel() (to protect
the write to the field in the call/connection structure that holds
an event handle), and rxevent_Cancel() must take the lock protecting
the red/black tree of events, this establishes a lock order with the
call/connection lock taken before the eventTree lock.  This is in
conflict with the event handler thread, which must take the eventTree
lock first, in order to select an event to run (and thus know what
additional lock would need to be taken, by virtue of what handler
function is to be run).  The conflict is easy to resolve in the
standard way, by having a local pointer to the event that is obtained
while the event is removed from the red/black tree under the eventTree
lock, and then the eventTree lock can be dropped and the event run
based on the local variable referring to it.  The race window occurs
when the caller of rxevent_Cancel() holds the call/connection lock,
and rxevent_Cancel() obtains the eventTree lock just after the event
handler thread drops it in order to run the event.  The event handler
function begins to execute, and immediately blocks trying to obtain
the call/connection lock.  Now that rxevent_Cancel() has the eventTree
lock it can proceed to search the tree, fail to find the indicated event
in the tree, clear out the event pointer from the call/connection
data structure, drop its caller's reference to the event structure,
and return failure (the event was not cancelled).  Only then does the
caller of rxevent_Cancel() drop the call/connection lock and allow
the event handler to make progress.

This race is not necessarily problematic if appropriate care is taken,
but in the previous code such was not the case.  In particular, it
is a common idiom for the firing event to call rxevent_Put() on itself,
to release the handle stored in the call/connection that could have
been used to cancel the event before it fired.  Failing to do so would
result in a memory leak of event structures; however, rxevent_Put() does
not check for a NULL argument, so a segfault (NULL dereference) was
observed in the test suite when the race occurred and the event handler
tried to rxevent_Put() the reference that had already been released by
the unsuccessful rxevent_Cancel() call.  Upon inspection, many (but not
all) of the uses in rx.c were susceptible to a similar race condition
and crash.

The test suite also papers over a related issue in that the event handler
in the test suite always knows that the data structure containing the
event handle will remain live, since it is a global array that is allocated
for the entire scope of the test.  In rx.c, events are associated with
calls and connections that have a finite lifetime, so we need to take care
to ensure that the call/connection pointer stored in the event remains
valid for the duration of the event's lifecycle.  In particular, even an
attempt to take the call/connection lock to check whether the corresponding
event field is NULL is fraught with risk, as it could crash if the lock
(and containing call/connection) has already been destroyed!  There are
several potential ways to ensure the liveness of the associated
call/connection while the event handler runs, most notably to take care
in the call/connection destruction path to ensure that all associated
events are either successfully cancelled or run to completion before
tearing down the call/connection structure, and to give the pending event
its own reference on the associated call/connection.  Here, we opt for
the latter, acknowledging that this may result in the event handler thread
doing the full call/connection teardown and delay the firing of subsequent
events.  This is deemed acceptable, as pending events are for intentionally
delayed tasks, and some extra delay is probably acceptable.  (The various
keepalive events and the challenge event could delay the user experience
and/or security properties if significantly delayed, but I do not believe
that this change admits completely unbounded delay in the event handler
thread, so the practical risk seems minimal.)

Accordingly, this commit attempts to ensure that:

* Each event holds a formal reference on its associated call/connection.
* The appropriate lock is held for all accesses to event pointers in
  call/connection structures.
* Each event handler (after taking the appropriate lock) checks whether
  it raced with rxevent_Cancel() and only drops the call/connection's
  reference to the event if the race did not occur.
* Each event handler drops its reference to the associated call/connection
  *after* doing any actions that might access/modify the call/connection.
* The per-event reference on the associated call/connection is dropped by
  the thread that removes the event from the red/black tree.  That is,
  the event handler function if the event runs, or by the caller of
  rxevent_Cancel() when the cancellation succeed.
* No non-NULL event handles remain in a call/connection being destroyed,
  which would indicate a refcounting error.

(*) There is an additional event used in practice, to reap old connections,
    but it is effectively a background task that reschedules itself
    periodically, with no handle to the event retained so as to be able
    to cancel it.  As such, it is unaffected by the concerns raised here.

While here, standardize on the rx_GetConnection() function for incrementing
the reference count on a connection object, instead of inlining the
corresponding mutex lock/unlock and variable access.

Also enable refcount checking unconditionally on unix, as this is a
rather invasive change late in the 1.8.0 release process and we want
to get as much sanity checking coverage as possible.

Change-Id: I27bcb932ec200ff20364fb1b83ea811221f9871c
Reviewed-on: https://gerrit.openafs.org/12756
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoAdjust rx-event test to exercise cancel/fire race 55/12755/2
Benjamin Kaduk [Thu, 5 Oct 2017 04:03:44 +0000]
Adjust rx-event test to exercise cancel/fire race

We currently do not properly handle the case where a thread runs
rxevent_Cancel() in parallel with the event-handler thread attempting
to fire that event, but the test suite only picked up on this issue
in a handful of the Debian automated builds (somewhat less-resourced
ones, perhaps).

Modify the event scheduling algorithm in the test so as to create a
larger chunk of events scheduled to fire "right away" and thereby
exercise the race condition more often when we proceed to cancel
a quarter of events "right away".

Change-Id: I50f55fd532901147cfda1a5f40ef949bf3270401
Reviewed-on: https://gerrit.openafs.org/12755
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>

6 years agogtx: link against libtinfo if termlib is seperated 60/12760/4
Michael Laß [Thu, 2 Nov 2017 20:16:49 +0000]
gtx: link against libtinfo if termlib is seperated

If ncurses is built with "./configure --with-termlib=tinfo", gtx fails
to link because of an undefined reference to the LINES symbol which is
then provided by libtinfo.so and not libncurses.so.

If ncurses is present, additionally check whether LINES is provided by
ncurses or tinfo and set $LIB_curses accordingly.

This change is based on a patch provided by Bastian Beischer.

FIXES 134420

Change-Id: I3e29c61405d90d0b850bafe4c51125bef433452b
Reviewed-on: https://gerrit.openafs.org/12760
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoCorrect m4 conditionals in curses.m4 38/12738/2
Benjamin Kaduk [Mon, 16 Oct 2017 21:53:22 +0000]
Correct m4 conditionals in curses.m4

AS_IF does not invoke the test(1) shell builtin for us, so we must
take care to consistently use it ourself.

While here, sprinkle some missing double-quotes around variable
expansions in AS_IF statements in this file.

Submitted by Bastian Beischer.

FIXES 134414

Change-Id: Iccfe311011f17de6317cf64abdc58b0812b81b8c
Reviewed-on: https://gerrit.openafs.org/12738
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoLinux: Use kernel_read/kernel_write when __vfs variants are unavailable 29/12729/3
Damien Diederen [Mon, 18 Sep 2017 10:18:39 +0000]
Linux: Use kernel_read/kernel_write when __vfs variants are unavailable

We hide the uses of set_fs/get_fs behind a macro, as those functions
are likely to soon become unavailable:

> Christoph Hellwig suggested removing all calls outside of the core
> filesystem and architecture code; Andy Lutomirski went one step
> further and said they should all go.

    https://lwn.net/Articles/722267/

Change-Id: Ib668f8fdb62ca01fe14321c07bd14d218744d909
Reviewed-on: https://gerrit.openafs.org/12729
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoredhat: avoid rpmbuild exclude directives 33/12733/2
Michael Meffie [Sat, 22 Jul 2017 02:30:43 +0000]
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.

Change-Id: If64df382ef372aa1078f1703a34942a1930bdc88
Reviewed-on: https://gerrit.openafs.org/12733
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoredhat: move .krb variants to the kauth-client subpackage 32/12732/2
Michael Meffie [Sat, 22 Jul 2017 02:16:44 +0000]
redhat: move .krb variants to the kauth-client subpackage

Move the deprecated klog.krb, pagsh.krb, and tokens.krb programs and man
pages to the optional openafs-kauth-client subpackage.

Change-Id: I09a2e36b60f9d47726a6a314a26db88e44575567
Reviewed-on: https://gerrit.openafs.org/12732
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoredhat: specify man pages without wildcards 31/12731/2
Michael Meffie [Thu, 20 Jul 2017 08:13:04 +0000]
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.

Change-Id: Id30a6174c532a9a00f850d6ca2722158293d5118
Reviewed-on: https://gerrit.openafs.org/12731
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

6 years agoredhat: remove afsd.fuse man page 30/12730/2
Michael Meffie [Fri, 21 Jul 2017 22:05:48 +0000]
redhat: remove afsd.fuse man page

The afsd.fuse binary is not currently packaged; do not package the man
page.

Change-Id: Ia0dd4fa72dc8a87e2c835798b6fbe1213d71da5f
Reviewed-on: https://gerrit.openafs.org/12730
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>