openafs.git
6 years agoMake OpenAFS 1.6.21.1 13/12713/3 openafs-stable-1_6_21_1
Stephan Wiesand [Wed, 23 Aug 2017 14:33:26 +0000]
Make OpenAFS 1.6.21.1

Update configure version strings for 1.6.21.1. Note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.21.1.
Switch to 1.6.22 dev 1 for macOs.

Change-Id: I73ebd481fdfe0d096b67138d4cb0f7b0d53e9e59
Reviewed-on: https://gerrit.openafs.org/12713
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS again for 1.6.21.1 26/12726/3
Stephan Wiesand [Wed, 20 Sep 2017 17:33:15 +0000]
Update NEWS again for 1.6.21.1

We decided to include the fix for kernel 4.12+ on s390 today. Reflect
this in the release notes.

Change-Id: Ib73b157c2ec437ac4fd0f4cd0df8ea22da7abf7f
Reviewed-on: https://gerrit.openafs.org/12726
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux: Include linux/uaccess.h rather than asm/uaccess.h if present 17/12717/3
Seth Forshee [Tue, 22 Aug 2017 12:59:11 +0000]
Linux: Include linux/uaccess.h rather than asm/uaccess.h if present

Starting with Linux 4.12 there is a module build error on s390
due to asm/uaccess.h using a macro defined in the common header.
The common header has been around since 2.6.18 and has always
included asm/uaccess.h, so switch to using the common header
whenever it is present.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-on: https://gerrit.openafs.org/12714
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 962f4838dc461567d896304f617a0923745d13d5)

Reviewed-on: https://gerrit.openafs.org/12718
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>
(cherry picked from commit 7073408688da021864bba59c592e8924e05adb91)

Change-Id: Ie58cfcf48aa80c18f19cbfc65f87363b154e96ee
Reviewed-on: https://gerrit.openafs.org/12717
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.21.1 25/12725/2
Stephan Wiesand [Tue, 19 Sep 2017 13:32:31 +0000]
Update NEWS for 1.6.21.1

Add release notes for OpenAFS 1.6.21.1

Change-Id: Ibbf3dd6e69c7ded1f64197b22de92d78b4b9d5c7
Reviewed-on: https://gerrit.openafs.org/12725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux 4.13: use designated initializers where required 64/12664/2
Stephan Wiesand [Mon, 24 Jul 2017 09:37:54 +0000]
Linux 4.13: use designated initializers where required

struct path is declared with the "designated_init" attribute,
and module builds now use -Werror=designated-init. Cope.

And as pointed out by Michael Meffie, struct ctl_table has
the same requirement now, so use a designated initializer
for the final element of the sysctl table too.

Reviewed-on: https://gerrit.openafs.org/12663
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit d55b41072ce873210481baa4cae5c7143011869b)

Change-Id: I9797f8b1e16ab095775c53ac03e258affaa4d303
Reviewed-on: https://gerrit.openafs.org/12664
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoMake OpenAFS 1.6.21 49/12649/2 openafs-stable-1_6_21
Stephan Wiesand [Tue, 4 Jul 2017 08:57:09 +0000]
Make OpenAFS 1.6.21

Update version strings for the 1.6.21 release.

Change-Id: I27569473ad9b988829bb517419d3d04f4cfa8c0f
Reviewed-on: https://gerrit.openafs.org/12649
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.21 35/12635/2
Stephan Wiesand [Thu, 8 Jun 2017 16:14:40 +0000]
Update NEWS for 1.6.21

Finalize the 1.6.21 release notes

Change-Id: I09974201c8155dc697abbf29079e5ceb2a74e629
Reviewed-on: https://gerrit.openafs.org/12635
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoMake OpenAFS 1.6.21pre1 03/12603/2 openafs-stable-1_6_21pre1
Stephan Wiesand [Wed, 19 Apr 2017 13:55:02 +0000]
Make OpenAFS 1.6.21pre1

Update version strings for the first 1.6.21 prerelease.

Change-Id: I700f0b110373e47f2f471f30ba8eefe9a3b6cf4f
Reviewed-on: https://gerrit.openafs.org/12603
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.21pre1 34/12634/4
Stephan Wiesand [Wed, 7 Jun 2017 13:09:04 +0000]
Update NEWS for 1.6.21pre1

Release notes for the first OpenAFS 1.6.21 prerelease

Change-Id: I9d01bd7856574e2c3da872854a5bffeac2119f3e
Reviewed-on: https://gerrit.openafs.org/12634
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agovol: modify volume updateDate upon salvage change 33/12633/2
Jeffrey Altman [Fri, 2 Jun 2017 02:25:49 +0000]
vol: modify volume updateDate upon salvage change

If the salvager changed the volume, set the VolumeDiskData.updateDate
field so that

  1. the change is visible via "vos examine"

  2. backup services will backup the corrected volume

Teradactyl pointed out the problem which forces cell administrators
to manually trigger a backup for each volume that has been salvaged.

Reviewed-on: https://gerrit.openafs.org/12629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit cdb92f94598e5b25fbcdfc6fb1650218ec05d63f)

Change-Id: I0ecf0bf52a78cd6e1de4e79fc4a33cb509a816f5
Reviewed-on: https://gerrit.openafs.org/12633
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agolibafs: remove linux conditionals for md5 inode number calculation 32/12632/2
Michael Meffie [Wed, 29 Apr 2015 15:54:45 +0000]
libafs: remove linux conditionals for md5 inode number calculation

Remove the conditionals which hide the md5 digest calculation for inode
numbers on non-linux platforms.  This feature was originally added to
support sites running on linux, but is generally useful and the
implementation is not specific to linux.

Reviewed-on: http://gerrit.openafs.org/11854
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit ac05e8ceebd05c2d8496759e70cf7b1b92541134)

Change-Id: I8fd613c436120a6436f48920ce4f33570dfb1fb8
Reviewed-on: https://gerrit.openafs.org/12632
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agobozo: do not fail silently on unknown bosserver options 31/12631/2
Michael Meffie [Fri, 2 Jun 2017 19:19:26 +0000]
bozo: do not fail silently on unknown bosserver options

Instead of failing silently when the bosserver is started with an
unknown option, print an error message and exit with a non-zero value.
Continue to exit with 0 when the -help option is given to request the
usage message.

This change should help make bosserver startup failures more obvious
when an unsupported option is specified. Example systemd status message:

   systemd[1]: Starting OpenAFS Server Service...
   bosserver[32308]: Unrecognized option: -bogus
   bosserver[32308]: Usage: bosserver [-noauth] ....
   systemd[1]: openafs-server.service: main process exited,
               code=exited, status=1/FAILURE

Reviewed-on: https://gerrit.openafs.org/12630
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f5491119ff7d422b1c0c311a50e30bec1c15296c)

Change-Id: I5c3ffbb21915fd0a2773873e360cee85504796f8
Reviewed-on: https://gerrit.openafs.org/12631
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: Switch to new bdi api for 4.12. 26/12626/2
Joe Gorse [Tue, 16 May 2017 07:29:30 +0000]
LINUX: Switch to new bdi api for 4.12.

super_setup_bdi() dynamically allocates backing_dev_info structures
for filesystems and cleans them up on superblock destruction.

Appears with Linux commit fca39346a55bb7196888ffc77d9e3557340d1d0b
Author: Jan Kara <jack@suse.cz>
Date:   Wed Apr 12 12:24:28 2017 +0200

Reviewed-on: https://gerrit.openafs.org/12614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 63e530e7df0b8013bcc4421b0bba558d4f1d2d57)

Change-Id: I48a49ee8852bf842c24e7df0609fe2184bf45d90
Reviewed-on: https://gerrit.openafs.org/12626
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agorx: wake up send after 'twind' has been updated 27/12627/2
Jeffrey Altman [Sat, 27 May 2017 18:59:04 +0000]
rx: wake up send after 'twind' has been updated

Beginning in AFS 3.4 and 3.5 the ack trailer includes the size of the
peer's receive window.  This value is used to update the sender's
transmit window (twind).  When the twind is increased the application
thread is signaled to indicate that more packets can be sent.

This change wakes the application thread after twind is updated by
the peer's receive window instead of beforehand.  Failure to do so
can result in 100ms transmit delays when the receive window transitions
from closed to open.

Reviewed-on: https://gerrit.openafs.org/12625
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit aaa47dc1077f0dd5b0040006c831f64cc8a303b5)

Change-Id: Icfbe10f93a34adfb14f5c34198f78b67aa043c53
Reviewed-on: https://gerrit.openafs.org/12627
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: CURRENT_TIME macro goes away. 24/12624/2
Joe Gorse [Wed, 10 May 2017 19:46:38 +0000]
LINUX: CURRENT_TIME macro goes away.

Check if the macro exists, define it if it does not.

Reviewed-on: https://gerrit.openafs.org/12611
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b47dc5482da614742b01dcc62d5e11d766a9432f)

Change-Id: I1ed3706e830b98436a5a22d99fa338b01fd5b997
Reviewed-on: https://gerrit.openafs.org/12624
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: add afsd -inumcalc option 08/12608/4
Michael Meffie [Wed, 29 Apr 2015 16:00:24 +0000]
afs: add afsd -inumcalc option

This commit adds the afsd -inumcalc command line switch to specify the
inode number calculation method in a platform neutral way.

Inode numbers reported for files within the AFS filesystem are generated
by the cache manager using a calculation which derives a number from a
FID. Long ago, a new type of calculation was added which generates inode
numbers using a MD5 message digest of the FID.  The MD5 inode number
calculation variant is computationally more expensive but greatly
reduces the chances for inode number collisions.

The MD5 calculation can be enabled on the Linux cache manager using the
Linux sysctl interface.  Other than the sysctl method of selecting the
inode calculation type, the MD5 inode number calculation method is not
specific to Linux.

This change introduces a command-line option which accepts a value to
indicate the calculation method, instead of a simple flag to enable MD5
inode numbers.  This should allow for new inode calculation methods
in the future without the need for additional afsd command-line flags.

Two values are currently accepted for -inumcalc. The value of 'compat'
specifies the legacy inode number calculation. The value 'md5' indicates
that the new MD5 calculation is to be used.

Reviewed-on: https://gerrit.openafs.org/11855
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 0028ea92ad3e7aac6a4c51f63703a4d9d7b9dcd6)

Change-Id: I9021eea9f64c754157061d039f63b6f744ec2ec5
Reviewed-on: https://gerrit.openafs.org/12608
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoclient: flag in cachemanager if rmtsys is enabled 07/12607/3
Christof Hanke [Thu, 12 Sep 2013 11:34:04 +0000]
client: flag in cachemanager if rmtsys is enabled

when processing "fs sysname" on a client, a rmtsys-related
checks are executed by default. These prevent a user with gid
2748 and 2750 (0xabc and 0xabe) from executing this command.
Add a new flag inside the cachemanager for the rmtsys-
functionality. This flag is set through a new ioctl by the afsd
on startup.

Reviewed-on: http://gerrit.openafs.org/10245
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit db1de98ecf6fd22b9c36b3ba284984f03cb0ae35)

Change-Id: Ia2a367e4675782a681b4f6efd6365da482adfab8
Reviewed-on: https://gerrit.openafs.org/12607
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: release the packets used by rx on shutdown 02/12602/2
Marcio Barbosa [Tue, 18 Apr 2017 20:04:13 +0000]
afs: release the packets used by rx on shutdown

When the OpenAFS client is unmounted on DARWIN, the blocks of packets
allocated by RX are released. Historically, the memory used by those
packets was never properly released.

Before 230dcebcd61064cc9aab6d20d34ff866a5c575ea, only the last block of
packets used to be released:

...
struct rx_packet *rx_mallocedP = 0;
...
void
rxi_MorePackets(int apackets)
{
    ...
    getme = apackets * sizeof(struct rx_packet);
    p = rx_mallocedP = (struct rx_packet *)osi_Alloc(getme);
    ...
}
...
void
rxi_FreeAllPackets(void)
{
    ...
    osi_Free(rx_mallocedP, ...);
    ...
}
...

As we can see, ‘rx_mallocedP’ is a global pointer that stores the
first address of the last allocated block of packets. As a result, when
‘rxi_FreeAllPackets’ is called, only the last block is released.

However, 230dcebcd61064cc9aab6d20d34ff866a5c575ea moved the global
pointer in question to the end of the last block. As a result, when the
OpenAFS client is unmounted on DARWIN, the ‘rxi_FreeAllPackets’
function releases the wrong block of memory. This problem was exposed
on OS X 10.12 Sierra where the system crashes when the OpenAFS client
is unmounted.

To fix this problem, store the address of every single block of packets
in a queue and release one by one when the OpenAFS client is unmounted.

Reviewed-on: https://gerrit.openafs.org/12427
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 5b28061fb593f5f48df549b07f0ccd848348b93c)

Change-Id: Id8606b1c1444861df69ed4af8169e343964a691d
Reviewed-on: https://gerrit.openafs.org/12602
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agovol: detach offline volumes on dafs 69/12569/2
Marcio Barbosa [Tue, 31 Jan 2017 14:43:18 +0000]
vol: detach offline volumes on dafs

Taking a volume offline always clears the inService bit. Taking a
volume out of service also takes it offline. Therefore, if the
inService flag is false, the volume in question should be offline.
On dafs, an offline volume should be unattached.

The attach2() function does not change the state of the volume received
as an argument to unattached when the inService flag is false. Instead,
this function changes the state of the volume in question to
pre-attached and returns VNOVOL to the client. As result, subsequent
accesses to this volume will make the server try and fail to attach
this offline volume over and over again, writing to the FileLog each
time.

To fix this problem, detach the volume received as an argument if the
inService flag is false. Since the new state of this volume will be
unattached, subsequent accesses will not hit attach2().

This situation where a volume is not offline but is also not in service
can occur if a volume is taken offline with vos offline and some time
later the DAFS fileserver is shutdown and restarted; the volume is
placed into the preattach state by default when the server restarts.
Each access to the volume by clients then causes the fileserver to
attempt to attach the volume, which fails, since the in-service flag in
the volume header is false from the previous vos offline.  The
fileserver will log a warning to the FileLog on each attempt to attach
the volume, and this will fill the FileLog with duplicate messages
corresponding to the number of attempted accesses.

Reviewed-on: https://gerrit.openafs.org/12515
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 2421da2bf327525216ec7e79b9aa81fa2c4f77d5)

Change-Id: I95cffb6a91797341d9202cbbef3b205c11348d5e
Reviewed-on: https://gerrit.openafs.org/12569
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoDAFS: do not save or restore host state if CPS in progress 68/12568/2
Mark Vitale [Tue, 21 Feb 2017 01:16:47 +0000]
DAFS: do not save or restore host state if CPS in progress

If a fileserver is shutdown while one or more PR_GetHostCPS calls
are in progress, this state is saved in the fsstate.dat file as
hostFlags HCPS_WAITING, HCPS_INPROGRESS.  Other hosts that are
merely waiting will have HCPS_WAITING recorded.

However, it makes no sense to restore host structs in this state,
because the GetCPS calls will no longer be in progress.  Once these
hosts become active, they will block server threads and quickly cause
all server threads to be exhausted as other CPS requests are blocked
behind them.

Instead, exclude these states from both save and restore.

Reviewed-on: https://gerrit.openafs.org/12561
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 38a3f51fb8b3910ecdd7cacb06f35ec681990aea)

Change-Id: I0e02543fd2e547fcc9f95db0973f09e5951a1da1
Reviewed-on: https://gerrit.openafs.org/12568
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: fs getcacheparms miscounts dcaches for large files 05/12605/2
Mark Vitale [Tue, 12 Jan 2016 23:06:51 +0000]
afs: fs getcacheparms miscounts dcaches for large files

fs getcacheparms issued with the -excessive option tabulates in-memory
dcaches ("DCentries") by size.  However, any dcache with validPos > 2^31
is miscounted in the 4k-16k bucket.  This is caused by a type mismatch
between 'validPos' (afs_size_t) and 'size' (int) which leads to a
negative value for size by sign-extension.  The size comparison "sieve"
fails for negative numbers; it skips the first bucket (0-4K) and dumps
them in the second one (4k-16k).

Move the declaration of 'size' closer to its use, and declare it with
the same type as 'validPos' (afs_size_t) so the comparison sieve
correctly places these dcaches in the last (>=1M) bucket.

Reviewed-on: https://gerrit.openafs.org/12347
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit b5e4e8c14130f601bbf43dee5927222ebf7613fa)

Change-Id: I659fd86f05b29c1eac1a262d340bcc1ce2640797
Reviewed-on: https://gerrit.openafs.org/12605
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: fs getcacheparms miscounts zero-length dcaches 04/12604/2
Mark Vitale [Tue, 12 Jan 2016 22:50:36 +0000]
afs: fs getcacheparms miscounts zero-length dcaches

When fs getcacheparms is issued with the -excessive option, it
tabulates all in-memory dcaches ("DCentries") by size.

dcaches with validPos == 0 were being tabulated in the 4k-16k bucket.

Fix the first comparison in the 'sieve' so these dcaches will be counted
in the correct 0-4k bucket instead.

Introduced by commit 176c2fddb95ced6c13e04e7492fc09b5551f273c

Reviewed-on: https://gerrit.openafs.org/12346
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit c966c0b8414ef0a041b1a8d5261c9eccd4d39d99)

Change-Id: I53a20644f549550cef85f0cc6f3551ed5dbe1e23
Reviewed-on: https://gerrit.openafs.org/12604
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agodoc: clarify the fs wscell manpage 59/12559/2
Stephan Wiesand [Thu, 2 Mar 2017 11:52:10 +0000]
doc: clarify the fs wscell manpage

What's displayed by fs wscell is not necessarily the current content
of ThisCell, but that at the time of starting the client. Say so.

FIXES 133339

Reviewed-on: https://gerrit.openafs.org/12537
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit bd15a5f56fde98983464acf5fd4cdd731d206d9f)

Change-Id: I47d7b92488b1166934a1704765c0f1e914a178a8
Reviewed-on: https://gerrit.openafs.org/12559
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoubik: SVOTE_Beacon should hold the DB lock for CheckTid 16/12516/2
Marc Dionne [Sat, 29 Jan 2011 17:09:30 +0000]
ubik: SVOTE_Beacon should hold the DB lock for CheckTid

Reviewed-on: https://gerrit.openafs.org/4262
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5548f6540557795ded65a52c7066839c5eef468f)

Change-Id: I0d4a4d5e796bc6cb731f00db34cc0776f746ca85
Reviewed-on: https://gerrit.openafs.org/12516
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agodoc: update information about vlserver logging 77/12477/2
Michael Meffie [Thu, 7 Jul 2016 19:51:18 +0000]
doc: update information about vlserver logging

Mention the vlserver -d option can be used to set the initial logging
level.

Thanks to Mark Vitale for the suggestion.

Reviewed-on: https://gerrit.openafs.org/12324
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f5f057ce8198480fb9c67f2a8c8eee906f8a7c4a)

Change-Id: Iaa0f10d020d3993fe92690c860cdad03605d31ec
Reviewed-on: https://gerrit.openafs.org/12477
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: eliminate unused variable warning 13/12513/2
Mark Vitale [Sat, 7 Jan 2017 11:22:47 +0000]
LINUX: eliminate unused variable warning

Commit c3bbf0b4444db88192eea4580ac9e9ca3de0d286 added routine
osi_TryEvictDentries and included new logic for D_INVALIDATE_IS_VOID.
Unfortunately, this new code path no longer uses dentry; it also should
have been made conditional at that time.

Wrap the declaration of dentry in #ifndef D_INVALIDATE_IS_VOID to
eliminate the unused variable warning.

Reviewed-on: https://gerrit.openafs.org/12505
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 19599b5ef5f7dff2741e13974692fe4a84721b59)

Change-Id: Ic15df733fcbccfaf9870ecd335bb2d549ab0d43d
Reviewed-on: https://gerrit.openafs.org/12513
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoafs: shake harder in shake-loose-vcaches 51/12451/2
Michael Meffie [Thu, 27 Aug 2015 17:06:05 +0000]
afs: shake harder in shake-loose-vcaches

Linux based cache managers will allocate vcaches on demand and
deallocate batches of vcaches in the background. This feature is called
dynamic vcaches.

Vcaches to be deallocated are found by traversing the vcache LRU list
(VLRU) from the oldest vcache to the newest. Up to a target number of
vcaches are attempted to be evicted.  The afs_xvcache lock protecting
the VLRU may be dropped and re-acquired while attempting to evict a
vcache. When this happens, it is possible the VLRU may have changed, so
the traversal of the VLRU is restarted.  This restarting of the VLRU
transversal is limited to 100 iterations to avoid looping indefinitely.

Vcaches which are busy cannot be evicted and remain in the VLRU. When a
busy cache was not evicted and the afs_xvache lock was dropped, the VLRU
traversal is restarted from the end of the VLRU. When the busy vcache is
encountered on the retry, it will trigger additional retries until the
loop limit is reached, at which point the target number of vcaches will
not be deallocated.

This can leave a very large number of unbusy vcaches which are never
deallocated.  On a busy machine, tens of millions of unused vcaches can
remain in memory. When the busy vcache at the end of the VLRU is finally
evicted, the log jam is broken, and the background deamon will hold the
afs_xvcache lock for an excessively long time, hanging the system.

Fix this by moving busy vcaches to the head of the VLRU before
restarting the VLRU traversal. These busy vcaches will be skipped when
retrying the VLRU traversal, allowing the cache manager to make progress
deallocating vcaches down to the target level.

This was already done on the mac osx platform while attempting to evict
vcaches. Move the code to move busy vcaches to the head of the VLRU up
the the platform agnostic caller.

Thanks to Andrew Deason for the initial version of this patch.

Reviewed-on: https://gerrit.openafs.org/11654
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 5c136c7d93ed97166f39bf716cc7f5d579b70677)

Change-Id: If60b1889d012a739aa5b43e842abb80a6ebfdb6a
Reviewed-on: https://gerrit.openafs.org/12451
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: do not use d_invalidate to evict dentries 50/12450/2
Mark Vitale [Thu, 4 Aug 2016 22:42:27 +0000]
LINUX: do not use d_invalidate to evict dentries

When working within the AFS filespace, commands which access large
numbers of OpenAFS files (e.g., git operations and builds) may result in
active files (e.g., the current working directory) being evicted from the
dentry cache.  One symptom of this is the following message upon return
to the shell prompt:

"fatal: unable to get current working directory: No such file or
directory"

Starting with Linux 3.18, d_invalidate returns void because it always
succeeds.  Commit a42f01d5ebb13da575b3123800ee6990743155ab adapted
OpenAFS to cope with the new return type, but not with the changed
semantics of d_invalidate.  Because d_invalidate can no longer fail with
-EBUSY when invoked on an in-use dentry. OpenAFS must no longer trust it
to preserve in-use dentries.

Modify the dentry eviction code to use a method (d_prune_aliases) that
does not evict in-use dentries.

Reviewed-on: https://gerrit.openafs.org/12363
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c3bbf0b4444db88192eea4580ac9e9ca3de0d286)

Change-Id: Ic72a280f136cc414b54d4b8ec280f225290df122
Reviewed-on: https://gerrit.openafs.org/12450
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoReformat src/afs/LINUX/osi_vcache.c 49/12449/2
Benjamin Kaduk [Thu, 27 Oct 2016 22:27:26 +0000]
Reformat src/afs/LINUX/osi_vcache.c

Apply the GNU indent options from CODING, with manual adjustments
to leave jump labels in column zero.

Also rename and mark static a function-local helper function.

Reviewed-on: https://gerrit.openafs.org/12422
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 22933e02e2510f25b79230964f135571c7bfe710)

Change-Id: I9fb2886ae2213218ae80ea9d5b80540b9c79077b
Reviewed-on: https://gerrit.openafs.org/12449
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: split dentry eviction from osi_TryEvictVCache 48/12448/2
Mark Vitale [Thu, 4 Aug 2016 22:18:15 +0000]
LINUX: split dentry eviction from osi_TryEvictVCache

To make osi_TryEvictVCache clearer, and to prepare for a future change
in dentry eviction, split the dentry eviction logic into its own routine
osi_TryEvictDentries.

No functional difference should be incurred by this commit.

Reviewed-on: https://gerrit.openafs.org/12362
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
(cherry picked from commit 742643e306929ac979ab69515a33ee2a3f2fa3fa)

Change-Id: I750fc7606ca56e784a60bdbc13a32d21fe307429
Reviewed-on: https://gerrit.openafs.org/12448
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agodoc: correct help for 'bos getlog' -restricted mode 76/12476/2
Mark Vitale [Mon, 21 Nov 2016 18:25:40 +0000]
doc: correct help for 'bos getlog' -restricted mode

Commit f085951d39c0d6c1e6a626177c30235704317600 introduced an error in
the bos getlog helpfile.

Modify the helpfile to describe the actual restrictions imposed by
-restricted mode.

Reviewed-on: https://gerrit.openafs.org/12454
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3af0460a4a6d7bf22e1789fd9e375659e20c3a55)

Change-Id: Ifa544c322e67da712a0bc96b3797e51786e4d399
Reviewed-on: https://gerrit.openafs.org/12476
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoUpdate NEWS again for 1.6.20.2 91/12591/4 openafs-stable-1_6_20_2
Stephan Wiesand [Wed, 5 Apr 2017 14:41:43 +0000]
Update NEWS again for 1.6.20.2

Finalize the 1.6.20.2 release notes, including a few late additions.

Change-Id: I32a394e4af700d52f487e0db528ed261e4c2131b
Reviewed-on: https://gerrit.openafs.org/12591
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux: only include cred.h if it exists 98/12598/2
Stephan Wiesand [Tue, 11 Apr 2017 09:58:55 +0000]
Linux: only include cred.h if it exists

Commit c89fd17df1032ec2eacc0d0c9b73e19c5e8db7d2 introduced an explicit
include of linux/cred.h since the latest kernel no longer includes it
implicitly in sched.h. Alas, older kernels (like 2.6.18) don't have this
file. Add a configure test for the existence of cred.h and only include
it if actually present.

Reviewed-on: https://gerrit.openafs.org/12593
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 6b7b4239ab22fbb301e3b50e2ca4072445ba4e9e)

Change-Id: I64970ba471180d32fa5af5445e7604bbe8511b32
Reviewed-on: https://gerrit.openafs.org/12598
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux v4.11: cred.h is no longer included in sched.h 90/12590/2
Mark Vitale [Fri, 24 Mar 2017 01:36:44 +0000]
Linux v4.11: cred.h is no longer included in sched.h

With Linux commit e26512fea5bcd6602dbf02a551ed073cd4529449, cred.h is no
longer included in sched.h.

Several components of libafs which require cred.h were picking it by
including sched.h.

Instead, explicitly add an include for cred.h. cred.h begins with a
customary one-shot to prevent multiple loads:

 #ifndef _LINUX_CRED_H
 #define _LINUX_CRED_H

Therefore we don't need a new autoconf test or preprocessor conditional
to prevent redundant includes on older Linux releases.

Reviewed-on: https://gerrit.openafs.org/12574
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit c89fd17df1032ec2eacc0d0c9b73e19c5e8db7d2)

Change-Id: I235a6272c55a8f734be07b578bbb1a324cf34e2e
Reviewed-on: https://gerrit.openafs.org/12590
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux v4.11: signal stuff moved to sched/signal.h 89/12589/2
Mark Vitale [Thu, 23 Mar 2017 22:10:03 +0000]
Linux v4.11: signal stuff moved to sched/signal.h

In Linux commit c3edc4010e9d102eb7b8f17d15c2ebc425fed63c, signal_struct
and other signal handling declarations were moved from sched.h to
sched/signal.h.

This breaks existing OpenAFS autoconf tests for recalc_sigpending() and
task_struct.signal->rlim, so that the OpenAFS kernel module can no
longer build.

Modify OpenAFS autoconfig tests to cope.

Reviewed-on: https://gerrit.openafs.org/12573
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit ad001550949b612ff6b4899fa8da50ee58f87533)

Change-Id: I491208d77e45d45cc0089b8033892a6408da431c
Reviewed-on: https://gerrit.openafs.org/12589
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux v4.11: getattr takes struct path 88/12588/2
Joe Gorse [Mon, 20 Mar 2017 14:30:46 +0000]
Linux v4.11: getattr takes struct path

With Linux commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f

    statx: Add a system call to make enhanced file info available

The Linux getattr inode operation is altered to take two additional
arguments: a u32 request_mask and an unsigned int flags that indicate
the synchronisation mode.  This change is propagated to the
vfs_getattr*() function.

-   int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
+   int (*getattr) (const struct path *, struct kstat *,
+                     u32 request_mask, unsigned int sync_mode);

The first argument, request_mask, indicates which fields of the statx
structure are of interest to the userland call. The second argument,
flags, currently may take the values defined in
include/uapi/linux/fcntl.h and are optionally used for cache coherence:

 (1) AT_STATX_SYNC_AS_STAT tells statx() to behave as stat() does.

 (2) AT_STATX_FORCE_SYNC will require a network filesystem to
     synchronise its attributes with the server - which might require
     data writeback to occur to get the timestamps correct.

 (3) AT_STATX_DONT_SYNC will suppress synchronisation with the server in
     a network filesystem.  The resulting values should be considered
     approximate.

This patch provides a new autoconf test and conditional compilation to
cope with the changes in our getattr implementation.

Reviewed-on: https://gerrit.openafs.org/12572
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit de5ee1a67d1c3284d65dc69bbbf89664af70b357)

Change-Id: I41ff134e1e71944f0629c9837d38cfbc495264c8
Reviewed-on: https://gerrit.openafs.org/12588
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoPrevent double-starting client on RHEL7 87/12587/2
Jonathon Weiss [Thu, 10 Nov 2016 22:06:18 +0000]
Prevent double-starting client on RHEL7

On RHEL7 if the AFS client is stopped with 'service openafs-client
stop', but that fails for some reason (most commonly because some
process has a file or directory in AFS open) systemd will decide that
the openafs-client is in a failed state when it is actually running.
If one then runs 'service openafs-client start' systemd will start a
new AFS client.  At this point AFS access will continue to work until
the functional AFS client is (successfully) stopped, at which point a
reboot is required to recover.

Have systemd check the status of 'fs sysname' before starting the
AFS client, so we avoid getting into a state that requires a reboot.

Reviewed-on: https://gerrit.openafs.org/12443
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit c666bfee8848183ccbc566c9e0fa019088e56505)

Change-Id: I2e7bf69ec5d1ae344d38b86fc3caace25b2da135
Reviewed-on: https://gerrit.openafs.org/12587
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake OpenAFS 1.6.20.2 32/12532/2
Stephan Wiesand [Wed, 1 Mar 2017 12:57:41 +0000]
Make OpenAFS 1.6.20.2

Update configure version strings for 1.6.20.2. Note that macOS kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.20.2.
Switch to 1.6.21 dev 2 for macOS.

Change-Id: Iccc613ea6b7d1194e7a1b20fa38c54b192c3c7b4
Reviewed-on: https://gerrit.openafs.org/12532
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoUpdate NEWS for 1.6.20.2 62/12562/4
Stephan Wiesand [Wed, 8 Mar 2017 13:06:52 +0000]
Update NEWS for 1.6.20.2

Release notes for the 1.6.20.2 release.

Change-Id: Ic394e004d5db329808e731b47cea521d944d2d2b
Reviewed-on: https://gerrit.openafs.org/12562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: prevent BAD TRAP panic with Studio 12.5 67/12567/3
Mark Vitale [Tue, 28 Feb 2017 23:02:39 +0000]
SOLARIS: prevent BAD TRAP panic with Studio 12.5

Starting with Solaris Studio 12.3, it is documented that Solaris kernel
modules (such as libafs) must not use any floating point, vector, or
SIMD/SSE instructions on x86 hardware.  However, each new Studio
compiler release (12.4 and especially 12.5) is more likely to use these
types of instructions by default.

If the libafs kernel module includes any forbidden kernel instructions,
Solaris will panic the system with:
  BAD TRAP:  type=7 (#nm Device not available)

Provide a new autoconfig test to specify the required compiler options
(-xvector=%none -xregs=no%float) when building the OpenAFS kernel module
for Solaris, so that no invalid x86 instructions are used.

In addition, reinstate default kernel module optimization for Solaris.
It had been disabled in commit 80592c53cbb0bce782eb39a5e64860786654be9f
to address this same issue in Studio 12.3 and 12.4.  However, Studio
12.5 started using some SSE instructions even with no optimization.

This commit has been tested with OpenAFS master and Studio 12.5 at all
optimization levels (none, -xO1 through -xO5) and verified to contain no
XMM register instructions via the following command:
  $ gobjdump -dlr libafs64.o | grep xmm | wc -l

[wiesand: limit change to solaris 5.11 for stable branch]

Reviewed-on: https://gerrit.openafs.org/12558
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 22d841a45fff7026318b529a41dd957ce8bb0ddf)

Change-Id: I2e87f26dbac47289694346639b396dfc556368f4
Reviewed-on: https://gerrit.openafs.org/12567
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agolinux24: remove unused NUMPAGGROUPS define 63/12563/2
Michael Meffie [Wed, 8 Mar 2017 16:48:14 +0000]
linux24: remove unused NUMPAGGROUPS define

Remove the unused NUMPAGGROUPS define in the pag group handling
implementation for linux24. PAGS always take two group ids in linux24,
so the NUMPAGGROUPS define was not used in linux24. Remove the unused
constant.

This is a 1.6.x only change, since linux24 support has been removed on
the master branch.

Change-Id: I10d4d5744420b075a10deecf052d2ecc128ad8fe
Reviewed-on: https://gerrit.openafs.org/12563
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: fix for AFS_PAG_ONEGROUP_ENV for Solaris 11 27/12527/2
Michael Meffie [Thu, 12 Jan 2017 17:27:36 +0000]
SOLARIS: fix for AFS_PAG_ONEGROUP_ENV for Solaris 11

Fix a bug introduced in commit aab1e71628e6a4ce68c5e59e2f815867438280d1
in which a pointer was incorrectly checked for a NULL value.

Fixes a crash when a PAG is set on Solaris.

    # mdb unix.1 vmcore.1
    > ::status
    ...
    panic message:
    BAD TRAP: type=e (#pf Page fault) rp=fffffffc802ba8f0 addr=0 occurred in
      module "afs" due to a NULL pointer dereference
    > ::stack
    pag_to_gidset+0x145()
    setpag+0xcc()
    AddPag+0x3a()
    afs_setpag+0x58()
    Afs_syscall+0x115()

The crash occurs since gidslot is NULL during the assignment:

    *gidslot = pagvalue;

Reviewed-on: https://gerrit.openafs.org/12508
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b146c2d54ff3bd99f2c4674eb88d5af417a194d7)

Change-Id: Ia012d07a3dd063e759a4a50d38e37be710e96255
Reviewed-on: https://gerrit.openafs.org/12527
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: Use AFS_PAG_ONEGROUP_ENV for Solaris 11 26/12526/2
Andrew Deason [Sat, 8 Aug 2015 21:49:50 +0000]
SOLARIS: Use AFS_PAG_ONEGROUP_ENV for Solaris 11

On Solaris 11 (specifically, Solaris 11.1+), the supplemental group
list for a process is supposed to be sorted. Starting with Solaris
11.2, more authorization checks are done that assume the list is
sorted (e.g., to do a binary search), so having them out of order
can cause incorrect behavior. For example:

  $ echo foo > /tmp/testfile
  $ chmod 660 /tmp/testfile
  $ sudo chown root:daemon /tmp/testfile
  $ cat /tmp/testfile
  foo
  $ id -a
  uid=100(adeason) gid=10(staff) groups=10(staff),12(daemon),20(games),21(ftp),50(gdm),60(xvm),90(postgres)
  $ pagsh
  $ cat /tmp/testfile
  cat: cannot open /tmp/testfile: Permission denied
  $ id -a
  uid=100(adeason) gid=10(staff) groups=33536,32514,10(staff),12(daemon),20(games),21(ftp),50(gdm),60(xvm),90(postgres)

Solaris sorts the groups given to crsetgroups() on versions which
required the group ids to be sorted, but we currently manually put our
PAG groups in our own order in afs_setgroups(). This is currently
required, since various places in the code assume that PAG groups are
the first two groups in a process's group list.

To get around this, do not require the PAG gids to be the first two
gids anymore. To more easily identify PAG gids in group processes, use
a single gid instead of two gids to identify a PAG, like modern Linux
currently uses (under the AFS_PAG_ONEGROUP_ENV). High-numbered groups
have been possible for quite a long time on Solaris, allegedly further
back than Solaris 8. Only do this for Solaris 11, though, to reduce
the platforms we affect.

[mmeffie@sinenomine.net: Define AFS_PAG_ONEGROUP_ENV in param.h.]

Reviewed-on: https://gerrit.openafs.org/11979
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit aab1e71628e6a4ce68c5e59e2f815867438280d1)

Change-Id: I54c1f4c1be4eed1804293aebae795b165954a3a4
Reviewed-on: https://gerrit.openafs.org/12526
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: Make ONEGROUP_ENV not Linux-specific 25/12525/2
Andrew Deason [Sat, 8 Aug 2015 21:13:54 +0000]
afs: Make ONEGROUP_ENV not Linux-specific

The functionality in AFS_LINUX26_ONEGROUP_ENV does not really need to
be Linux-specific (it's just only implemented for Linux right now).
Rename it to AFS_PAG_ONEGROUP_ENV, and remove some Linux-specific
checks when checking for "onegroup" PAG GIDs.

[mmeffie@sinenomine.net: Move AFS_PAG_ONEGROUP_ENV to param.h]

Reviewed-on: https://gerrit.openafs.org/11978
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit ee08dbe37d9db4fe314bd88b9280bf73c92c37bd)

Change-Id: Ifef8f833599eca4241b41035142e74f32e6efa99
Reviewed-on: https://gerrit.openafs.org/12525
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: define NUMPAGGROUPS once 24/12524/2
Michael Meffie [Fri, 9 Sep 2016 20:23:46 +0000]
afs: define NUMPAGGROUPS once

Define the number of groups per PAG in one place.  Prefix the define
with AFS_ to avoid name conflicts in the future (unlikely as it may be).

Fix the misnamed AFSPAGGGROUPS symbol in linux implementation of two
groups per PAG.

Reviewed-on: https://gerrit.openafs.org/12382
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b39095c3a7e1c631bb17816b7e707bc21a6b8c71)

Change-Id: I8e0531e9a7e2fc1f3d1eb8255c75ecd758dbce9a
Reviewed-on: https://gerrit.openafs.org/12524
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agobuild: update search paths for solaris cc 36/12536/2
Michael Meffie [Sun, 26 Feb 2017 01:33:00 +0000]
build: update search paths for solaris cc

Move the macros to search for the solaris cc to a separate macro and
update the search paths to keep up with released versions.

Reviewed-on: https://gerrit.openafs.org/12528
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 69aadea298825f1f224406064b83d1a947abf96b)

Change-Id: I1dadc037727c3b73d61104d03c5051c1dc154433
Reviewed-on: https://gerrit.openafs.org/12536
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLINUX: Bring debug symbols back to the Linux kernel module. 34/12534/2
Joe Gorse [Thu, 16 Feb 2017 23:01:50 +0000]
LINUX: Bring debug symbols back to the Linux kernel module.

Starting with 4.8 Linux kernels our existing build script
generator, make_kbuild_makefile.pl, does not pass the debugging
symbols CFLAGS that were present when building for previous kernels.

This fix appends the $(KERN_DBG) variable which will only be defined
when the configuration includes the --enable-debug-kernel option.

Reviewed-on: https://gerrit.openafs.org/12519
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 961cee00b8f5c302de5f66beb81caa33242c7971)

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

7 years agoLINUX: Debian/Ubuntu build regression on kernel 3.16.39 35/12535/2
Sergio Gelato [Wed, 22 Feb 2017 21:55:33 +0000]
LINUX: Debian/Ubuntu build regression on kernel 3.16.39

Now that kernel 4.9 has hit jessie-backports, it becomes desirable to
also backport the associated openafs patches.

Unfortunately, Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch
causes a build failure against jessie's current default kernel,
3.16.39-1, due to the fact that setattr_prepare() is available (it was
cherrypicked to address CVE-2015-1350) but file_dentry() is not (it was
introduced in kernel 4.6).

This makes it difficult to have a version of openafs for jessie that
supports both kernels.

To deal with this, follow the implementation of file_dentry() in 4.6,
and simplify it to account for the lack of d_real() support in older
kernels.

Note that inode_change_ok() has been added back to 3.16.39-1 to avoid
ABI changes. That means the current openafs packages in jessie continue
to work with kernel 3.16.39-1 since they do not include
Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch.

Originally reported at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855366

FIXES RT134158

Reviewed-on: https://gerrit.openafs.org/12523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 6ea6c182c7fb6c22dafbbf203abcc23726e06cba)

Change-Id: I06951dacef3f7639f749e82439df89ec3d78b592
Reviewed-on: https://gerrit.openafs.org/12535
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoosx: build afscell only for active architecture 38/12538/2
Marcio Barbosa [Thu, 2 Mar 2017 21:01:48 +0000]
osx: build afscell only for active architecture

The InstallerPlugins framework provided by the MacOSX10.12.sdk does not
define symbols for architecture i386. As a result, the OpenAFS code
cannot be built on OS X 10.12.

To fix this problem, build the afscell xcode project only for active
architecture.

Reviewed-on: https://gerrit.openafs.org/12531
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit d39e7c7af77b4e1b043611e1a6e78267f5f956ef)

Change-Id: I34b351b4d383c8dd91f8a7b5b9f35d9aa2854a13
Reviewed-on: https://gerrit.openafs.org/12538
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoredhat: move the klog.krb5 man page to openafs-krb5 11/12511/2
Michael Meffie [Tue, 10 Jan 2017 04:55:32 +0000]
redhat: move the klog.krb5 man page to openafs-krb5

Move the klog.krb5 man page to the openafs-krb5 package, which
distributes the klog.krb5 binary, instead of the general openafs
package.

Reviewed-on: https://gerrit.openafs.org/12509
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 872a63bbfb04addbdc17dc5c09ec018bb9ddf515)

Change-Id: Ic1d8cdb788e7776820107c2207317e7cf04cd042
Reviewed-on: https://gerrit.openafs.org/12511
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: update convert from ancient _depends_on 33/12533/2
Michael Meffie [Mon, 27 Feb 2017 06:40:51 +0000]
SOLARIS: update convert from ancient _depends_on

Commit 37db7985fde9e6a5e71ae628d0b7124a27bf31c3 modernized how we
declare module dependencies on Solaris 10 and newer.

Instead of explicitly specifying recent Solaris version numbers, specify
old versions for the old method.  This should be more future proof.

Thanks to Ben Kaduk for the suggestion.

Reviewed-on: https://gerrit.openafs.org/12529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 3893ed397283b0c3605def102004a645a325d476)

Change-Id: Ia187a99033dd07b6b65a017fa20a7435e5d866c0
Reviewed-on: https://gerrit.openafs.org/12533
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSOLARIS: convert from ancient _depends_on to ELF dependencies 14/12514/2
Michael Meffie [Sat, 5 Nov 2016 16:42:19 +0000]
SOLARIS: convert from ancient _depends_on to ELF dependencies

The ancient way of declaring module dependencies with _depends_on has
been deprecated since SunOS 2.6 (circa 1996). The presence of the old
_depends_on symbol triggers a warning message on the console starting
with Solaris 12, and the kernel runtime loader (krtld) feature of using
the _depends_on symbol to load dependencies may be removed in a future
version of Solaris.

Convert the kernel module from the ancient _depends_on method to modern
ELF dependencies.  Remove the old _depends_on symbol and specify the -dy
and -N <name> linker options to set the ELF dependencies at link time,
as recommended in the Solaris device driver developer guidelines [1].

This commit does not change the declared dependencies, which may be
vestiges of ancient afs versions.

[1]: http://docs.oracle.com/cd/E19455-01/805-7378/6j6un037u/index.html#loading-16

Reviewed-on: https://gerrit.openafs.org/12453
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 37db7985fde9e6a5e71ae628d0b7124a27bf31c3)

Change-Id: I1a4ad8bface1ecf774e906b846c2e8263631d77a
Reviewed-on: https://gerrit.openafs.org/12514
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agobozo: do not exit when the client config already exists 22/12522/2
Michael Meffie [Wed, 21 Jan 2015 19:58:35 +0000]
bozo: do not exit when the client config already exists

The bosserver creates symlinks for the client CSDB and ThisCell config
files during initialization.  Avoid exiting if the client CSDB or
ThisCell configuration already exists, otherwise the bosserver cannot be
restarted with bos restart.

This fixes an error introduced with commit
720363fa9bf7cfbebdc485104b74ca6bac1895f6, Fix unchecked return values.

Reviewed-on: http://gerrit.openafs.org/11684
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 381c7afbe60a0e6d53e8cc1bca2de920574b3383)

Change-Id: I6b93e337fd56294107f527af20d99f97689c1701
Reviewed-on: https://gerrit.openafs.org/12522
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoFix unchecked return values 21/12521/2
Jeffrey Hutzelman [Sun, 16 Jun 2013 19:28:03 +0000]
Fix unchecked return values

This change fixes numerous places where the return values of various
system calls and standard library routines are not checked.  In
particular, this fixes occurrances called out when building on Ubuntu
12.10, with gcc 4.7.2 and eglibc 2.15-0ubuntu20.1, when the possible
failure is one we actually do (or should) care about.  This change
does not consider calls where the failure is one we deliberately
choose to ignore.

Reviewed-on: http://gerrit.openafs.org/9979
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 720363fa9bf7cfbebdc485104b74ca6bac1895f6)

Change-Id: I9e72a68a66d751139f7129b9b177ba18389c10a2
Reviewed-on: https://gerrit.openafs.org/12521
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux 4.10: have_submounts is gone 30/12530/2
Mark Vitale [Wed, 7 Dec 2016 16:11:45 +0000]
Linux 4.10: have_submounts is gone

Linux commit f74e7b33c37e vfs: remove unused have_submounts() function
(v4.10-rc2) removes have_submounts from the tree after providing a
replacement (path_has_submounts) for its last in-tree caller, autofs.

However, it turns out that OpenAFS is better off not using the new
path_has_submounts.  Instead, OpenAFS could/should have stopped using
have_submounts() much earlier, back in Linux v3.18 when d_invalidate
became void.  At that time, most in-tree callers of have_submounts had
already been converted to use check_submounts_and_drop back in v3.12.
At v3.18, a series of commits modified check_submounts_and_drop to
automatically remove child submounts (instead of returning -EBUSY if a
submount was detected), then subsumed it into d_invalidate.  The end
result was that VFS now implicitly handles much of the housekeeping
previously called explicitly by the various filesystem d_revalidate
routines:
- shrink_dcache_parent
- check_submounts_and_drop
- d_drop
- d_invalidate
All in-tree filesystem d_revalidate routines were updated to take
advantage of this new VFS support.

Modify afs_linux_dentry_revalidate to no longer perform any special
handling for invalid dentries when D_INVALIDATE_IS_VOID.  Instead, allow
our VFS caller to properly clean up any invalid dentry when we return 0.

Reviewed-on: https://gerrit.openafs.org/12506
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 789319bf0f2b26ad67995f8cbe88cee87a1bbdc0)

Change-Id: I7ed22338e7896f69a204be78ed0a4f6136a3dab8
Reviewed-on: https://gerrit.openafs.org/12530
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agos390: desupport 32-bit Linux kernels on s390/s390x 99/12499/2
Neale Ferguson [Thu, 8 Dec 2016 16:47:09 +0000]
s390: desupport 32-bit Linux kernels on s390/s390x

Remove the obsolete and custom lwp assembler for the s390 and s390x
architectures.  That assembler is no longer needed since 32-bit
mainframe Linux distributions are no longer supported and are very
unlikely to be in use.

The generic process.default.s is sufficient for modern 64-bit Linux
distributions on s390/s390x.

[mmeffie@sinenomine.net: commit message wording]

Reviewed-on: https://gerrit.openafs.org/12475
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 1d8cb56999a4ab25ae4cbc8e8a688b8100aedd3b)

Change-Id: Iee572ef3a86f5502e37ddc0775da13b874add669
Reviewed-on: https://gerrit.openafs.org/12499
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoosx: let prefpane knows where binaries can be found 12/12512/2
Marcio Barbosa [Wed, 11 Jan 2017 14:05:04 +0000]
osx: let prefpane knows where binaries can be found

Starting from OS X 10.11, the OpenAFS binaries were moved to the
following directories: /opt/openafs/bin and /opt/openafs/sbin. However,
the OpenAFS prefpane is not aware of the change mentioned above. As a
result, some functionalities provided by the OpenAFS prefpane are not
working properly.

To fix this problem, add the new paths to the proper environment
variable.

Change-Id: Idaa2f0329af2092cf9ad1d63f1a01300b150227a
Reviewed-on: https://gerrit.openafs.org/12507
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit a92a3a0675d941536103b60d708a6b3305b9b8fa)
Reviewed-on: https://gerrit.openafs.org/12512
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake OpenAFS 1.6.20.1 85/12485/2 openafs-stable-1_6_20_1
Stephan Wiesand [Mon, 12 Dec 2016 14:09:50 +0000]
Make OpenAFS 1.6.20.1

Update configure version strings for 1.6.20.1. Note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.20.1.
Switch to 1.6.21 dev 1 for macOs.

Change-Id: If9a54680d6807687136f6149ca48ad8c33db32f7
Reviewed-on: https://gerrit.openafs.org/12485
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoUpdate NEWS for 1.6.20.1 86/12486/3
Stephan Wiesand [Mon, 12 Dec 2016 14:38:18 +0000]
Update NEWS for 1.6.20.1

Release notes for OpenAFS 1.6.20.1

Change-Id: I3584e78ac5b509b1093c014ee4dec471991e7a8f
Reviewed-on: https://gerrit.openafs.org/12486
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agosrc/gtx/curseswindows.c: Fix misleading indentation 84/12484/2
Anders Kaseorg [Sat, 5 Nov 2016 00:46:22 +0000]
src/gtx/curseswindows.c: Fix misleading indentation

Fixes these warnings (errors with --enable-checking) from GCC 6.2:

curseswindows.c: In function ‘gator_cursesgwin_drawchar’:
curseswindows.c:574:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (params->highlight)
     ^~
curseswindows.c:576:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
         if (code)
         ^~
curseswindows.c:579:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (params->highlight)
     ^~
curseswindows.c:581:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
         if (code)
         ^~
curseswindows.c: In function ‘gator_cursesgwin_drawstring’:
curseswindows.c:628:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (params->highlight)
     ^~
curseswindows.c:630:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
  if (code)
  ^~
curseswindows.c:633:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (params->highlight)
     ^~
curseswindows.c:635:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
  if (code)
  ^~

Reviewed-on: https://gerrit.openafs.org/12439
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 85cf397ec18ecfde36433fb65e5d91ecd325b76e)

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

7 years agosrc/rx/rx_packet.c: Fix misleading indentation 83/12483/2
Anders Kaseorg [Sat, 5 Nov 2016 00:38:08 +0000]
src/rx/rx_packet.c: Fix misleading indentation

Fixes these warnings (errors with --enable-checking) from GCC 6.2:

rx_packet.c: In function ‘rxi_ReceiveDebugPacket’:
rx_packet.c:2009:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
         if (rx_stats_active)
         ^~
rx_packet.c:2011:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
      s = (afs_int32 *) & rx_stats;
      ^
rx_packet.c:2017:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
         if (rx_stats_active)
         ^~
rx_packet.c:2019:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
      rxi_SendDebugPacket(ap, asocket, ahost, aport, istack);
      ^~~~~~~~~~~~~~~~~~~

Reviewed-on: https://gerrit.openafs.org/12436
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 0aeb8c17a2701169ddb7397d951c73cf361087c8)

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

7 years agosrc/rxgen/rpc_parse.c: Fix misleading indentation 82/12482/2
Anders Kaseorg [Sat, 5 Nov 2016 00:36:51 +0000]
src/rxgen/rpc_parse.c: Fix misleading indentation

Fixes this warning (error with --enable-checking) from GCC 6.2:

rpc_parse.c: In function ‘analyze_ProcParams’:
rpc_parse.c:861:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (tokp->kind != TOK_RPAREN)
     ^~
rpc_parse.c:863:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
  *tailp = decls;
  ^

Reviewed-on: https://gerrit.openafs.org/12435
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit bd70a176c19c09c49c6c3c01ea088ca947c45966)

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

7 years agosystemd: RemainAfterExit in openafs-client.service 81/12481/2
Andrew Deason [Tue, 2 Sep 2014 22:51:46 +0000]
systemd: RemainAfterExit in openafs-client.service

Currently, if the client is started without any options that require
an extra thread (like -afsdb), all processes spawned by afsd will
exit. There may be some kernel threads still active, but those are
spawned by the kernel module, and are not child processes of the
parent afsd process, or anything like that.

Since we are a Type=forking service in systemd, systemd interprets
this situation to mean that the service has stopped successfully, and
then runs the ExecStop commands. So, for example, if our AFSD_ARGS in
our sysconfig is "-fakestat -afsdb", the service starts as normal. But
if it is changed to "-fakestat", then when openafs-client.service is
started, it immediately stops again.

To avoid this, turn on the systemd option RemainAfterExit, which tells
systemd that the service has not stopped if all of our processes have
exited. The client service will thus remain running until it is
stopped.

Issue reported by Rich Sudlow.

FIXES 133482

Reviewed-on: http://gerrit.openafs.org/11440
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit cb8195d2d6ce1c01e132c05c1bf5593eab45b2c6)

Change-Id: I4005d5dabae8ef72194938475cf46f5bc1f222f8
Reviewed-on: https://gerrit.openafs.org/12481
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux 4.9: inode_change_ok() becomes setattr_prepare() 80/12480/2
Mark Vitale [Thu, 20 Oct 2016 04:49:37 +0000]
Linux 4.9: inode_change_ok() becomes setattr_prepare()

Linux commit 31051c85b5e2 "fs: Give dentry to inode_change_ok() instead
of inode" renames and modifies inode_change_ok(inode, attrs) to
setattr_prepare(dentry, attrs).

Modify OpenAFS to cope.

Reviewed-on: https://gerrit.openafs.org/12418
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8aeb711eeaa5ddac5a74c354091e2d4f7ac0cd63)

Change-Id: I7f08c57b7f61465a1ea18333306f52f77bd65084
Reviewed-on: https://gerrit.openafs.org/12480
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux 4.9: inode_operation rename now takes flags 79/12479/2
Mark Vitale [Fri, 16 Sep 2016 23:01:19 +0000]
Linux 4.9: inode_operation rename now takes flags

In Linux 3.15 commit 520c8b16505236fc82daa352e6c5e73cd9870cff,
inode_operation rename2() was added.  It takes the same arguments as
rename(), with an added flags argument supporting the following values:

RENAME_NOREPLACE: if "new" name exists, fail with -EEXIST.  Without
this flag, the default behavior is to replace the "new" existing file.

RENAME_EXCHANGE: exchange source and target; both must exist.

OpenAFS never implemented a .rename2() routine because it was optional
when introduced at Linux v3.15.

In Linux 4.9-rc1 the following commits remove the last in-tree uses of
.rename() and converts .rename2() to .rename().
aadfa8019e81 vfs: add note about i_op->rename changes to porting
2773bf00aeb9 fs: rename "rename2" i_op to "rename"
18fc84dafaac vfs: remove unused i_op->rename
1cd66c93ba8c fs: make remaining filesystems use .rename2
e0e0be8a8355 libfs: support RENAME_NOREPLACE in simple_rename()
f03b8ad8d386 fs: support RENAME_NOREPLACE for local filesystems

With these changes, it is now mandatory for OpenAFS afs_linux_rename()
to accept a 5th flag argument.

Add an autoconfig test to determine the signature of .rename().  Use this
information to implement afs_linux_rename() with the appropriate number
of arguments.  Implement "toleration support" for the flags option by
treating a zero flag as a normal rename; if any flags are specified,
return -EINVAL to indicate the OpenAFS filesystem does not yet support
any flags.

Reviewed-on: https://gerrit.openafs.org/12391
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f21e3ef8ce5093b4e0578d29666f76bd99aef1a2)

Change-Id: I071d41cd1ef1c9cdcda257c091d7167221f58fb7
Reviewed-on: https://gerrit.openafs.org/12479
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux 4.9: deal with demise of GROUP_AT 78/12478/2
Mark Vitale [Wed, 14 Sep 2016 22:01:22 +0000]
Linux 4.9: deal with demise of GROUP_AT

Linux commit 81243eacfa40 "cred: simpler, 1D supplementary groups"
refactors the group_info struct, removing some members (which OpenAFS
references only through the GROUP_AT macro) and adding a gid member.
The GROUP_AT macro is also removed from the tree.

Add an autoconfigure test for the new group_info member gid and define a
replacement GROUP_AT macro to do the right thing under the new regime.

Reviewed-on: https://gerrit.openafs.org/12390
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8e81b182e36cde28ec5708e5fcbe56e4900b1ea3)

Change-Id: I46b5cd4571452f9506647aada2caf3a68c4fa7d5
Reviewed-on: https://gerrit.openafs.org/12478
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agomacos: do not quit prefpane unexpectedly 47/12447/2
Marcio Barbosa [Fri, 11 Nov 2016 21:21:58 +0000]
macos: do not quit prefpane unexpectedly

If the user opens the OpenAFS preference pane and choose the Mounts
tab, the preference pane crashes.

To fix the problem, do not assume that we can cast a NSdictionary
object to NSMutableDictionary.

Reviewed-on: https://gerrit.openafs.org/12446
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 9d4be0bd01696768602a313f627a802b358b5885)

Change-Id: I7ff8c6cbc599f3e80d6365d9a56587bf5c641f5b
Reviewed-on: https://gerrit.openafs.org/12447
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agomacos: packaging support for MacOS X 10.12 32/12432/2
Marcio Barbosa [Sun, 23 Oct 2016 19:52:49 +0000]
macos: packaging support for MacOS X 10.12

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

Reviewed-on: https://gerrit.openafs.org/12420
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 0bed87a15db11bccb693b3a54f704ee5751ae553)

Change-Id: I71a22e2ee43cb86ccdbe16c42b582d90adc91115
Reviewed-on: https://gerrit.openafs.org/12432
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agomacos: add support for MacOS 10.12 31/12431/2
Marcio Barbosa [Wed, 26 Oct 2016 02:33:38 +0000]
macos: add support for MacOS 10.12

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

Reviewed-on: https://gerrit.openafs.org/12419
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 0bdf750a962a81b9b2e61387d7a3340dabb13395)

Change-Id: I693878212ec7cf00c2c8376ed5a1bab1198594b3
Reviewed-on: https://gerrit.openafs.org/12431
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agodir: do not leak contents of deleted directory entries 65/12465/3 openafs-stable-1_6_20
Mark Vitale [Mon, 7 Nov 2016 19:16:50 +0000]
dir: do not leak contents of deleted directory entries

Deleting an AFS directory entry (afs_dir_Delete) merely removes the
entry logically by updating the allocation map and hash table.  However,
the entry itself remains on disk - that is, both the cache manager's
cache partition and the fileserver's vice partitions.

This constitutes a leak of directory entry information, including the
object's name and MKfid (vnode and uniqueid).  This leaked information
is also visible on the wire during FetchData requests and volume
operations.

Modify afs_dir_Delete to clear the contents of deleted directory
entries.

Patchset notes:
This commit only prevents leaks for newly deleted entries.  Another
commit in this patchset prevents leaks of partial object names upon
reuse of pre-existing deleted entries.  A third commit in this
patchset prevents yet another kind of directory entry leak, when
internal buffers are reused to create or enlarge existing directories.
All three patches are required to prevent new leaks.  Two additional
salvager patches are also included to assist administrators in the
cleanup of pre-existing leaks.

[kaduk@mit.edu: style nit for sizeof() argument]

Reviewed-on: https://gerrit.openafs.org/12460
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f591f6fae3d8b8d44140ca64e53bad840aeeeba0)

Change-Id: I41f76649f4bed609793b944db32c5ae62aa07458
Reviewed-on: https://gerrit.openafs.org/12465
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: do not leak stale data in buffers 64/12464/3
Benjamin Kaduk [Mon, 7 Nov 2016 05:29:22 +0000]
afs: do not leak stale data in buffers

Similar to the previous commit, zero out the buffer when fetching
a new slot, to avoid the possibility of leaving stale data in
a reused buffer.

We are not supposed to write such stale data back to a fileserver,
but this is an extra precaution in case of bugs elsewhere -- memset
is not as expensive as it was in the 1980s.

Reviewed-on: https://gerrit.openafs.org/12459
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit a26c5054ee501ec65db3104f6a6a0fef634d9ea7)

Change-Id: Id60559ed84581e2f6a50cd4313f64780b8a0bafd
Reviewed-on: https://gerrit.openafs.org/12464
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake OpenAFS 1.6.20 67/12467/2
Benjamin Kaduk [Wed, 30 Nov 2016 16:55:55 +0000]
Make OpenAFS 1.6.20

Update version strings for the 1.6.20 security release.

Change-Id: I7f5ffa5e20173d399ed79dfb6358882caf05e27e
Reviewed-on: https://gerrit.openafs.org/12467
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoUpdate NEWS for 1.6.20 66/12466/2
Benjamin Kaduk [Wed, 30 Nov 2016 15:28:18 +0000]
Update NEWS for 1.6.20

Change-Id: Id5bfbf5013f1ce7879473a1d40fea535314f6370
Reviewed-on: https://gerrit.openafs.org/12466
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agodir: fileserver leaks names of file and directories 63/12463/3
Mark Vitale [Fri, 13 May 2016 04:01:31 +0000]
dir: fileserver leaks names of file and directories

Summary:
Due to incomplete initialization or clearing of reused memory,
fileserver directory objects are likely to contain "dead" directory
entry information.  These extraneous entries are not active - that is,
they are logically invisible to the fileserver and client.  However,
they are physically visible on the fileserver vice partition, on the
wire in FetchData replies, and on the client cache partition.  This
constitutes a leak of directory information.

Characterization:
There are three different kinds of "dead" residual directory entry
leaks, each with a different cause:

1. There may be partial name data after the null terminator in a live
directory entry.   This happens when a previously used directory entry
becomes free, then is reused for a directory entry with a shorter name.
This may be addressed in a future commit.

2. "Dead" directory entries are left uncleared after an object is
deleted or renamed.  This may be addressed in a future commit.

3. Residual directory entries may be inadvertently picked up when a new
directory is created or an existing directory is extended by a 2kiBi
page.  This is the most severe problem and is addressed by this commit.

This third kind of leak is the most severe because the leaked
directory information may be from _any_ other directory residing on the
fileserver, even if the current user is not authorized to see that
directory.

Root cause:
The fileserver's directory/buffer package shares a pool of directory
page buffers among all fileserver threads for both directory reads and
directory writes.  When the fileserver creates a new directory or
extends an existing one, it uses any available unlocked buffer in the
pool.  This buffer is likely to contain another directory page recently
read or written by the fileserver.  Unfortunately the fileserver only
initializes the page header fields (and the first two "dot" and "dotdot"
entries in the case of a new directory).  Any residual entries in the
rest of the directory page are now logically "dead", but still
physically present in the directory.  They can easily be seen on the
vice partition, on the wire in a FetchData reply, and on the cache
partition.

Note:
The directory/buffer package used by the fileserver is also used by the
salvager and the volserver.  Therefore, salvager activity may also leak
directory information to a certain extent.   The volserver vos split
command may also contribute to leaks.  Any volserver operation that
creates volumes (create, move, copy, restore, release) may also have
insignificant leaks.  These less significant leaks are addressed by this
commit as well.

Exploits:
Any AFS user authorized to read directories may passively exploit this
leak by capturing wire traffic or examining his local cache as he/she
performs authorized reads on existing directories.  Any leaked data will
be for other directories the fileserver had in the buffer pool at the
time the authorized directories were created or extended.

Any AFS user authorized to write a new directory may actively exploit
this leak by creating a new directory, flushing cache, then re-reading
the newly created directory.  Any leaked data will be for other
directories the fileserver had in the buffer pool within the last few
seconds.  In this way an authorized user may sample current fileserver
directory buffer contents for as long as he/she desires, without being
detected.

Directories already containing leaked data may themselves be leaked,
leading to multiple layers of leaked data propagating with every new or
extended directory.

The names of files and directories are the most obvious source of
information in this leak, but the FID vnode and uniqueid are leaked as
well.  Careful examination of the sequences of leaked vnode numbers and
uniqueids may allow an attacker to:
- Discern each layer of old directories by observing breaks in
  consecutive runs of vnode and/or uniqueid numbers.
- Infer which objects may reside on the same volume.
- Discover the order in which objects were created (vnode) or modified
  (uniqueid).
- Know whether an object is a file (even vnode) or a directory (odd
  vnode).

Prevent new leaks by always clearing a pool buffer before using it to
create or extend a directory.

Existing leaks on the fileserver vice partitions may be addressed in a
future commit.

Reviewed-on: https://gerrit.openafs.org/12458
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 70065cb1831dbcfd698c8fee216e33511a314904)

Change-Id: Ifa9d9266368ed3775898b7628ca980edcb230356
Reviewed-on: https://gerrit.openafs.org/12463
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agobos: allow salvage -salvagedirs with -all 62/12462/2
Benjamin Kaduk [Sun, 6 Nov 2016 21:06:02 +0000]
bos: allow salvage -salvagedirs with -all

Allow the -salvagedirs option on bos salvage when invoked with the -all
option to salvage the whole server.   The -salvagedirs -all options will
rebuild every directory on the server.

Reviewed-on: https://gerrit.openafs.org/12457
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-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>
(cherry picked from commit 1637c4d7c1ce407390f65509a3a1c764a0c06aa6)

[not actually cherry picked, but is the equivalent functionality]

Change-Id: I3978a5c4a704e0a0f2aab1cfad75573c16496a4d
Reviewed-on: https://gerrit.openafs.org/12462
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agodafs: honor salvageserver -salvagedirs 61/12461/2
Michael Meffie [Sun, 6 Nov 2016 20:31:22 +0000]
dafs: honor salvageserver -salvagedirs

Do not ignore the -salvagedirs option when given to the salvageserver.
When the salvageserver is running with this option, all directories will
be rebuilt by salvages spawned by the dafs salvageserver, including all
demand attach salvages and salvages of individual volumes initiated by
bos salvage.

This does not affect the whole partition salvages initiated by bos
salvage -all.

Reviewed-on: https://gerrit.openafs.org/12456
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-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>
(cherry picked from commit 9e66234951cca3ca77e94ab431f739e85017a23a)

Change-Id: I121299a5524cb46a519aead7818b0a7bd2fd4f69
Reviewed-on: https://gerrit.openafs.org/12461
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake OpenAFS 1.6.19 26/12426/3 openafs-stable-1_6_19
Stephan Wiesand [Tue, 1 Nov 2016 13:27:04 +0000]
Make OpenAFS 1.6.19

Update version strings and NEWS for the 1.6.19 release.

Change-Id: Icf6052d0d482210555ebe1e2d375fee2662b60cd
Reviewed-on: https://gerrit.openafs.org/12426
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake OpenAFS 1.6.19pre1 68/12368/2 openafs-stable-1_6_19pre1
Stephan Wiesand [Wed, 17 Aug 2016 12:14:15 +0000]
Make OpenAFS 1.6.19pre1

Update version strings for the first 1.6.19 prerelease.

Change-Id: I0c3fcb99f1d3154e11c32673683e3dc5f08ef30d
Reviewed-on: https://gerrit.openafs.org/12368
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoUpdate NEWS for 1.6.19pre1 95/12395/5
Stephan Wiesand [Wed, 28 Sep 2016 10:39:26 +0000]
Update NEWS for 1.6.19pre1

Preliminary release notes for OpenAFS 1.6.19

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

7 years agoafs: afs_linux_write_end only commit copied 13/12413/2
Yadav Yadavendra [Mon, 3 Oct 2016 19:25:08 +0000]
afs: afs_linux_write_end only commit copied

In afs_linux_write_end() only commit the number of bytes actually copied
to the page.

Reviewed-on: https://gerrit.openafs.org/12409
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 1cd86de2912af9ad709d2d7cf8aa35d5d28fb6b3)

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

7 years agotests/util/ktime-t.c: Specify EST offset in TZ 15/12415/2
Anders Kaseorg [Sun, 9 Oct 2016 10:39:12 +0000]
tests/util/ktime-t.c: Specify EST offset in TZ

This fixes test failures observed on new Debian build servers that no
longer install tzdata by default.  As the tests expect, EST is defined
as UTC−05:00 with no daylight saving time.

Reviewed-on: https://gerrit.openafs.org/12414
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit e17cd5df703b8a924591f92c76636dd9e0d9eaf9)

Change-Id: I392bfb2bb3d2bbf8ff73a87650ca0d7e1268b356
Reviewed-on: https://gerrit.openafs.org/12415
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLINUX: Avoid 'wakeup' define 66/12366/2
Andrew Deason [Mon, 24 Sep 2012 16:31:29 +0000]
LINUX: Avoid 'wakeup' define

Make 'wakeup' a static inline function instead of redefining 'wakeup',
so we can use the keyword 'wakeup' elsewhere.

Specifically, 'wakeup' is used in some Linux kernel structures, so
redefining it can confuse some things.

Reviewed-on: http://gerrit.openafs.org/8149
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 94115df4352b872ae096977d9a77fad935864688)

Change-Id: I6dadad579bf62677c76fd72be6a4ebe7e66a5c60
Reviewed-on: https://gerrit.openafs.org/12366
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLINUX: Define printf/uprintf as variadic macros 65/12365/2
Andrew Deason [Mon, 24 Sep 2012 18:03:34 +0000]
LINUX: Define printf/uprintf as variadic macros

Instead of defining the string 'printf' itself, make printf (and
uprintf) variadic macros. This avoids renaming printf to printk for
things like '__attribute__((format(printf,X,Y)))'.

Note that this is Linux-specific; compilers on other platforms may not
support variadic macros.

This avoids many warnings in the Linux kernel module build if we
include Linux headers after AFS headers.

Reviewed-on: http://gerrit.openafs.org/8150
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 179096d9b2c461f02236bbf670b46597ff2d4c3c)

Change-Id: I5c1c80cb5bd6996b0329969e16f9359fa1dcbc91
Reviewed-on: https://gerrit.openafs.org/12365
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agotests: avoid passing NULL strings to vprintf 96/12396/2
Michael Meffie [Mon, 22 Aug 2016 23:53:34 +0000]
tests: avoid passing NULL strings to vprintf

Some libc implementations will crash when NULL string arguments are given to
*printf.  Avoid passing NULL string arguments in the make check tests that did
so, and pass the string "(null)" instead.

Reviewed-on: https://gerrit.openafs.org/12377
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 2fe3a28c6ec0ff9d19ddec5500b3a5e69b483210)

Change-Id: Id8f1635444b5b49e3250addf36b64fccafd59941
Reviewed-on: https://gerrit.openafs.org/12396
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoubik: Return an error from ContactQuorum when inquorate 89/12389/3
Andrew Deason [Mon, 19 Sep 2016 01:29:34 +0000]
ubik: Return an error from ContactQuorum when inquorate

Currently, when we need to contact all other servers in the ubik
quorum (to create a write transaction, and send db changes, etc), we
call the ContactQuorum_* family of functions. To contact each server,
those functions follow an algorithm like the following pseudocode:

{
    int rcode = 0;
    int code;
    int okcalls = 0;

    for (ts = ubik_servers; ts; ts = ts->next) {
if (ts->up) {
    code = contact_server(ts);
    if (code) {
rcode = code;
    } else {
okcalls++;
    }
}
    }

    if (okcalls + 1 >= ubik_quorum) {
return 0;
    } else {
return rcode;
    }
}

This means that if we successfully contact a majority of ubik sites,
we return success, even if some sites returned an error. If most sites
fail, then we return an error (we arbitrarily pick the last error we
got).

This means that in most situations, a successful write transaction is
guaranteed to have been transmitted to a majority of ubik sites, so
the written data cannot be lost (at least one of the sites that got
the new data will be in a future elected quorum).

However, if a site is already known to be down (ts->up is 0), then we
skip trying to contact that site, but we also don't set any errors.
This means that if a majority of sites are already known to be down
(ts->up is 0), then we can indicate success for a write transaction,
even though the relevant data has not been written to a majority of
sites. In that situation, it is possible to lose data.

Most of the time this is not possible, since a majority of sites must
be 'up' for the sync site to be elected and to allow write
transactions at all. There are a few ways, though, in which we can get
into a situation where most other sites are 'down', but we still let a
write transaction go through.

An example scenario:

Say we have sites A, B, and C. All 3 sites come up at the same time,
and A is the lowest IP so it starts an election (after around BIGTIME
seconds). Right after A is elected the sync site, sites B and C will
have 'lastYesState' set to 0, since site A hasn't yet sent out a
beacon as the sync site.

A client can then start a write to the ubik database on site A, which
site A will allow since it's the sync site (and presumably all the
relevant recovery flags are set). Site A will try to contact sites B
and C for a DISK_Begin call, but lastYesState is set to 0 on those
sites. This will cause DISK_Begin to return UNOQUORUM
(urecovery_AllBetter will return 0, because uvote_HaveSyncAndVersion
will return 0, because lastYesState is not set).

So site A will get a UNOQUORUM error from sites B and C, and so site A
will set 'ts->up' to 0 for sites B and C, and will return UNOQUORUM to
the client. The client may then try to retry the call (because
UNOQUORUM is not treated as a 'global' error in ubikclient.c's
ubik_Call_New), or another client write request could come in. Now
that 'ts->up' is unset for both sites B and C, we skip trying to
contact any remote sites, and the ContactQuorum functions will return
success. So the ubik write will go through successfully, but the new
data will only be on site A.

At this point, if site A crashes, then sites B and C will elect a
quorum, and will not have the modifications that were written to site
A (so the data written to site A is lost). If site A stays up, then it
will go through database recovery, sending the entire database file to
sites B and C.

In addition, it's very possible in this scenario for a client to write
to the database, and then try to read back data and confusingly get a
different result. For example, if someone issues the following two
commands while triggering the above scenario:

    $ pts createuser testuser
    $ pts examine testuser

If the second command contacts site B or C, then it will always fail,
saying that the user doesn't exist (even though the first command
succeeded). This is because sites B and C don't have the new data
written to site A, at least temporarily. While this confusing behavior
is not completely avoidable in ubik (this can always happen
'sometimes' due to network errors and such), with the scenario
described here, it happens 100% of the time.

The general scenario described above can also happen if sites B and C
are suddenly legitimately unreachable from site A, instead of throwing
the UNOQUORUM error. All of the steps are pretty much the same, but
there is a bit of a delay while we wait for the DISK_Begin call to
fail.

To fix this, do not let 0 be returned if a quorum has not been
reached.  In some sense, UNOQUORUM could *always* be returned in
that case, but it is more in keeping with historical behavior to
return a "real" error if there is one available.

It is somewhat questionable whether we should even be propagating
errors received from calls like DISK_Begin/DISK_Commit to the ubik
client (e.g. if we get a -1 from trying to contact a remote site, we
return -1 to the client, so the client may think it couldn't reach the
site at all). But this commit does not change any of that logic, and
should only change behavior when a majority of sites have 'ts->up'
unset.  A later commit might effect the change to always return
UNOQUORUM and ignore the actual error values from the DISK_ calls,
but that is not needed to fix the immediate issue.

An important note:

Before this commit, there was a window of about 15 seconds after a
sync site is elected where a write to the ubik db would appear to be
successful, but would only modify the ubik db on the sync site.
(Details described above.) With this commit, writes during that
15-second window will instead fail, because we cannot guarantee that
we won't lose that data. If someone relies on 'udebug' data from the
sync site to let them know when writes will go through successfully,
this commit could appear to cause new errors.

[kaduk@mit.edu: transfer long commit message describing the issue
from an alternative fix, and tidy up accordingly]
Reviewed-on: https://gerrit.openafs.org/12289
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit fac0b742960899123dca6016f6ffc6ccc944f217)

Change-Id: Ic9b4ceada6c743dde49aba82217bb3a9f440bb69
Reviewed-on: https://gerrit.openafs.org/12389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoFix compile error for PPC64 gcc 6.1.1 88/12388/2
Matt K. Light [Tue, 13 Sep 2016 19:18:38 +0000]
Fix compile error for PPC64 gcc 6.1.1

Cast function pointer stubs to remove compile errors
on Fedora 24 PPC64 with ggcc 6.1.1

FIXES 133407

Reviewed-on: https://gerrit.openafs.org/12386
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 733dcec01784617e3354c2b8b29f50b09464a4bb)

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

7 years agoSOLARIS: Support VSW_STATS 71/12371/2
Andrew Deason [Wed, 8 Jan 2014 00:24:54 +0000]
SOLARIS: Support VSW_STATS

Specify the VSW_STATS flag to the vfsdef_t structure we give to
Solaris. This turns on statistics that can be retrieved via fsstat(1M)
and allows the fsinfo::: DTrace provider to work with AFS files.

We don't need to actually maintain these statistics; Solaris does that
for us. This flag just signifies that our vfs_t structure is capable
of storing the information. Since we get our vfs_t from Solaris (via
domount(), it gives us a vfs_t when it calls our afs_mount function)
and do not allocate a vfs_t ourselves, we are safe and this is fine to
do.

Reviewed-on: http://gerrit.openafs.org/10679
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit b0f433986ce344bf153cce1f6372de20750e052b)

Change-Id: I2403703f9caeb190563360d8571ee0be46890f4d
Reviewed-on: https://gerrit.openafs.org/12371
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake setting of CFLAGS_NOSTRICT make sense 08/12308/2
Benjamin Kaduk [Thu, 20 Aug 2015 17:55:02 +0000]
Make setting of CFLAGS_NOSTRICT make sense

Previously, we would set -fno-strict-aliasing only when
--enable-checking was given to configure but not
--enable-checking=all.  The intent seems to have been to
only warn about strict aliasing violations when --enable-checking=all
is in use, but that there was no need to disable the strict-aliasing
diagnostics when -Werror was not enabled.

Unfortunately, -fno-strict-aliasing affects not only the diagnostics
emitted by the compiler, but also the code generation!  So we were
leaving the normal (no --enable-checking) case with the compiler
assuming C's strict aliasing rules.  The OpenAFS codebase has
historically not been strict-aliasing safe (for example,
commit 15e8678661ec49f5eac3954defad84c06b3e0164 refers to a
runtime crash using a certain compiler version, which is diagnosed
as the compiler using the C strict aliasing rules to make
optimizations that exposed the invalid program code.

To avoid futher surprises due to new compiler optimizations
that utilize the C strict aliasing rules, always disable
strict aliasing except when --enable-checking=all is used.

Reviewed-on: https://gerrit.openafs.org/11988
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 687b4d8af07dbcf187dea685e75b420884727efd)

Change-Id: I03b64465a29243f2b4fdaa12e962f078c45ae344
Reviewed-on: https://gerrit.openafs.org/12308
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoSquash a frightening number of warnings from XBSA-related code 57/12357/2
Anders Kaseorg [Sat, 1 Aug 2015 07:15:39 +0000]
Squash a frightening number of warnings from XBSA-related code

Mostly missing prototypes and mismatched format strings, but also some
more disturbing bugs.

Reviewed-on: http://gerrit.openafs.org/11960
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
(cherry picked from commit 540050bbc893416fbd075ed5e349abaa5baaeba1)

Change-Id: I45711fb064490a51a5ecf316b89073dbfabab55b
Reviewed-on: https://gerrit.openafs.org/12357
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoubik: Don't RECFOUNDDB if can't contact most sites 39/12339/2
Andrew Deason [Sun, 1 May 2016 16:24:30 +0000]
ubik: Don't RECFOUNDDB if can't contact most sites

Currently, the ubik recovery code will always set UBIK_RECFOUNDDB
during recovery, after asking all other sites for their dbversions.
This happens regardless of how many sites we were actually able to
successfully contact, even if we couldn't contact any of them.

This can cause problems when we are unable to contact a majority of
sites with DISK_GetVersion. Since, if we haven't contacted a majority
of sites, we cannot say with confidence that we know what the best db
version available is (which is what UBIK_RECFOUNDDB represents; that
we've found which database is the one we should be using). This can
also result in UBIK_RECHAVEDB in a similar situation, indicating that
we have the best db version locally, even though we never actually
asked anyone else what their db version was.

For example, say site A is the sync site going through recovery, and
DISK_GetVersion fails for the only other sites B and C. Site A will
then set UBIK_RECFOUNDDB, and will claim that site A has the best db
version available (UBIK_RECHAVEDB). This allows site A to process ubik
write transactions (causing the db to be labelled with a new epoch),
or possibly to send the db to the other sites via DISK_SendFile, if
they quickly become available during recovery. Ubik write transactions
can succeed in this situation, because our ContactQuorum_* calls will
succeed if we never try to contact a remote site ('rcode' defaults to
0).

This situation should be rather rare, because normally a majority of
sites must be reachable by site A for site A to be voted the sync site
in the first place. However, it is possible for site A to lose
connectivity to all other sites immediately after sync site election.
It is also possible for site A to proceed far enough in the recovery
process to set UBIK_RECHAVEDB before it loses its sync site status.

As a result of all of this, if a site with an old database comes
online and there are network connectivity problems between the other
sites and a ubik write request comes in, it's possible for the "old"
database to overwrite the "new" database. This makes it look as if the
database has "rolled back" to an earlier version.

This should be possible with any ubik database, though how to actually
trigger this bug can change due to different ubik servers setting
different network timeouts. It is probably the most likely with the
VLDB, because the VLDB is typically the most frequently written
database.

If a VLDB reverts to an earlier version, it can result in existing
volumes to appear to not exist in the VLDB, and can result in new
volumes re-using volume IDs from existing volumes. This can result in
rather confusing errors.

To fix this, ensure that we have contacted a majority of sites with
DISK_GetVersion before indicating that we have located the best db
version. If we've contacted a majority of sites, then we are
guaranteed (under ubik assumptions) that we've found the best version,
since previous writes to the database should be guaranteed to hit a
majority of sites (otherwise they wouldn't be successful).

If we cannot reach a majority of sites, we just don't set
UBIK_RECFOUNDDB, and the recovery process restarts. Presumably on the
next iteration we'll be able to contact them, or we'll lose sync site
status if we can't reach the other sites for long enough.

Reviewed-on: https://gerrit.openafs.org/12281
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit d3dbdade7e8eaf6da37dd6f1f53d9f1384626071)

Change-Id: I4f4e7255efd3e16e3acfec8f90bf2019cab1fb63
Reviewed-on: https://gerrit.openafs.org/12339
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agotests: remove unused variable in tests/util/ktime-t.c 73/12373/2
Marc Dionne [Mon, 9 Apr 2012 23:00:36 +0000]
tests: remove unused variable in tests/util/ktime-t.c

errors is set but not used - remove it.

Reviewed-on: http://gerrit.openafs.org/7142
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit f971a36968bdcb224ff3ffb663929d4febcab5d5)

Change-Id: I72afced31735012b2832c46d0b4efd83c67c17e2
Reviewed-on: https://gerrit.openafs.org/12373
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agovenus: fix memory leak 40/12340/2
Marcio Barbosa [Tue, 28 Jun 2016 15:48:06 +0000]
venus: fix memory leak

The fs getserverprefs command displays preference
ranks for file / volume location server machine
interfaces. In order to get the complete set of
preference ranks, the VIOC_GETSPREFS system call
might have to be called several times. If so, the
memory previously allocated should be released.

Reviewed-on: https://gerrit.openafs.org/12315
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit d3b8a05d229a80100f40fca4dfdcd820313fcea8)

Change-Id: Iccd9b98aea1c7cf1d63ad20c470baabe09f7a0d7
Reviewed-on: https://gerrit.openafs.org/12340
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: incorrect comments for afs_ClearStatus 42/12342/2
Mark Vitale [Thu, 18 Jun 2015 19:32:36 +0000]
afs: incorrect comments for afs_ClearStatus

The brief description was identical to the one for afs_Analyze.

Update it to accurately describe afs_ClearStatus.

Reviewed-on: https://gerrit.openafs.org/12005
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 7f8af1b384cfdc2964a122953e4102b4d82e6cb1)

Change-Id: Icb99b61bb9ccf4d0362fc370aa4ab07cbf730b05
Reviewed-on: https://gerrit.openafs.org/12342
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: document missing afs_Analyze parm 41/12341/2
Mark Vitale [Thu, 18 Jun 2015 19:54:28 +0000]
afs: document missing afs_Analyze parm

rxconn was missing from the comments; add it.

Reviewed-on: https://gerrit.openafs.org/12004
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit b3e85976936239e30d44da00bf28fbe8487f6998)

Change-Id: I8a56824b9e14971b7e04698ef449daf3d8422889
Reviewed-on: https://gerrit.openafs.org/12341
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: fix memory leak 09/12309/2
Marcio Barbosa [Thu, 3 Mar 2016 21:23:28 +0000]
afs: fix memory leak

An error code is returned by afs_ProcessOpCreate if
this function can not allocate memory for ttargetName.

This function should release the memory previously
allocated for tname and decrement the reference count
of tdp as well.

Reviewed-on: https://gerrit.openafs.org/12208
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit bc123573539084ffc5a16ef1efaaaced5b2be202)

Change-Id: Ia5a09fe860b7a110ad55c111551702e20367ba1b
Reviewed-on: https://gerrit.openafs.org/12309
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: remove commented out sleep in afs_call.c 07/12307/2
Michael Meffie [Thu, 28 Apr 2016 21:23:23 +0000]
afs: remove commented out sleep in afs_call.c

The cell info setup was moved to the beginning of the startup sequence
and an unnecessary sleep commented out in the syscall in which the cell
info was set in commit 3fa5f389b2b7778cf0df5a506c91b427b147c4c2.

Clean up afs_call.c a bit by removing this commented out code.

Reviewed-on: https://gerrit.openafs.org/12277
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 591da537e22be88da23216b2640331a7338ce0ae)

Change-Id: I9964603d68feea840cb70056dafad96d2c6adea2
Reviewed-on: https://gerrit.openafs.org/12307
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: remove commented out AIX specific tweak 06/12306/2
Michael Meffie [Thu, 28 Apr 2016 21:15:06 +0000]
afs: remove commented out AIX specific tweak

This AIX specific code block has been commented out since
openafs-ibm-1_0.  The comments seem to indicate this was a networking
tweak specific to AIX, but the kernel variables involved were not
exported.  Clean up afs_call.c by removing this dead code.

Reviewed-on: https://gerrit.openafs.org/12276
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 5277460eaa300fc973b59d007cd3eaea93d30873)

Change-Id: Idcf94dc5962a6bb183af3bfccead3b17cff2ee58
Reviewed-on: https://gerrit.openafs.org/12306
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: cleanup remnant afs_vfs_mount prototype in afs_call.c 05/12305/2
Michael Meffie [Thu, 28 Apr 2016 20:52:42 +0000]
afs: cleanup remnant afs_vfs_mount prototype in afs_call.c

The call to afs_vfs_mount() in afs_call.c was removed in commit
a5ab24af71efe6b80eb0f78d1979c5ab1d1e594d.  Remove the remnant prototype
and the useless conditionals around it.

Reviewed-on: https://gerrit.openafs.org/12275
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 91f5cecc937923e16c5feda675fccd36d2b95164)

Change-Id: I6463d012c0c00b4a2738fa1045e822cda5c3304a
Reviewed-on: https://gerrit.openafs.org/12305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoFix typo in kaserver appendix 04/12304/2
Benjamin Kaduk [Sat, 14 May 2016 18:37:54 +0000]
Fix typo in kaserver appendix

Though it's very unlikely that someone would actually want to
set up a new kaserver installation, if we have documentation for
it, it ought to at least do what it claims to do.

Thus, change kinit to klog where it was intended.

Reported by Karl-Philipp Richter.

FIXES 133043

Reviewed-on: https://gerrit.openafs.org/12286
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 4bd716223492aec23599a5ac01bce3cc47160bfd)

Change-Id: I0390a260e53a978e5a45aaff19b832c2d4dc4f9b
Reviewed-on: https://gerrit.openafs.org/12304
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoFind Tivoli TSM headers in 64 bit location 59/12259/3
Jonathon Weiss [Fri, 15 Apr 2016 23:29:58 +0000]
Find Tivoli TSM headers in 64 bit location

When building with --enable-tivoli-tsm locate the Tivoli TSM headers
if they are installed in the path used by the 64 bit Tivoli TSM
installation.

Reviewed-on: https://gerrit.openafs.org/12258
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>
(cherry picked from commit 9c6e6d4c34d867639ac90ba9a46084f3700b57d1)

Change-Id: I7d47304eed94e0bc2607309985ac9247d6908e0c
Reviewed-on: https://gerrit.openafs.org/12259
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>