A new lock is introduced to protect beacon related data when
compiled with pthreads. A global structure is added containing
the lock itself and the global variables that it protects.
The lock also protects some values in the ubik_server structures:
lastVoteTime
lastBeaconSent
lastVote
up
beaconSinceDown
Based on some analysis and design work by Jeffrey Hutzelman
Change-Id: I13f72d32dce71d0686406efcd07b7ea7528722f1
Reviewed-on: http://gerrit.openafs.org/4155
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Import the roken gettimeofday implementation, so we can use it on
Windows.
Change-Id: I198233c4e96708b56b6e7be3bbfc98bb14d37f84
Reviewed-on: http://gerrit.openafs.org/4431
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The roken gettimeofday implementation doesn't return timezone
information. Audit the whole code to make sure that we don't rely on
this, and tidy up those places where we were passing an unused
timezone structure to the gettimeofday call.
Change-Id: Ia83f86483a9c7262fc0904236c0d039a912e3731
Reviewed-on: http://gerrit.openafs.org/4430
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Whatever behaviour was controlled by the -DNINTERFACE define is long
gone from our code base (git log -SNINTERFACE can't find any references,
which suggests that its removal predates OpenAFS).
Simplify our Makefiles by removing the definition
Change-Id: Ic84261eb40aa7de9b7c0ec7b8372517b09e242d2
Reviewed-on: http://gerrit.openafs.org/4427
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Replace our local afs_ctime() hack with strftime and localtime_r,
which roken can provide for us if necessary. This avoids the
compatibility problems inherent with ctime_r, and removes another bit
of platform compatibility goo from libutil.
Change-Id: I18ed36cc4dce9aa354ad1398710ab7db83c814a2
Reviewed-on: http://gerrit.openafs.org/4426
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Fix our check for localtime_r so that it actually picks up if it's
missing on Unix platforms, and gets libroken to build it.
Change-Id: Ibf6e3a0272b08aa55e0ee9493f68b3c53a5b6938
Reviewed-on: http://gerrit.openafs.org/4425
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
util/magic.h is unused, so get rid of it
Change-Id: Ic01a7ad73203d25b25f7b7c4af0668ab6131f6c3
Reviewed-on: http://gerrit.openafs.org/4423
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I750ac319feb38e416abb0b8e3575613309c6ab8e
Reviewed-on: http://gerrit.openafs.org/4422
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: Ie83e6ed3e6e5eaca063b9c6af836bcdc7decdf84
Reviewed-on: http://gerrit.openafs.org/4421
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
limits.h provides us with UINT_MAX, so use this for the maxmimum
size of an unsigned integer, rather than trying to grow our own.
Change-Id: Ia23c45a9e295589929374a8324ea2b3d268ae6c0
Reviewed-on: http://gerrit.openafs.org/4420
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Also add a selection of headers to the list that autoconf checks for
Change-Id: Ic76bb02ff5353ceba380b78abc294251ecc66267
Reviewed-on: http://gerrit.openafs.org/4418
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Suppress the following warnings in kernel builds:
*) The function "blah" was declared but never referenced (1174)
*) The indicated trailing comma is non-standard (1201)
*) The parameter "blah" was never referenced (3201)
*) implicit conversion of a 64-bit integral type to a smaller
integral type (3968)
Change-Id: If6cf21f287b5aefa06daaa2807e05a84e391fa95
Reviewed-on: http://gerrit.openafs.org/4419
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I7896d654d3b1e50352e92f1fbfb3211f79791116
Reviewed-on: http://gerrit.openafs.org/4417
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
COMMON_CFLAGS already includes XCFLAGS and ARCHFLAGS, so don't include
them again in the salvager cflags rule
Change-Id: Ib65e9235fa5d23473417f0d197a3610c9b17d1f0
Reviewed-on: http://gerrit.openafs.org/4416
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I431cff2dbfa5ca57a9884d7d8eb1695d3f79affd
Reviewed-on: http://gerrit.openafs.org/4415
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I1d729adfd0a4cbe73b68e553ec122073a737c8a5
Reviewed-on: http://gerrit.openafs.org/4414
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.
Change-Id: I593ca273e11e4dd7bb0887e708189cc7a1181879
Reviewed-on: http://gerrit.openafs.org/4413
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.
Change-Id: If090da744a6b096bbfc79292402439a6994062ff
Reviewed-on: http://gerrit.openafs.org/4412
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: Iddd472b25de2d833b3235eceab593afdd1527e03
Reviewed-on: http://gerrit.openafs.org/4411
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I6e431eb16d35fd9bd4aa07e7a9b3e47ca7281fab
Reviewed-on: http://gerrit.openafs.org/4410
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I66d38e30b43ae636a78a2225271b66756586f5a2
Reviewed-on: http://gerrit.openafs.org/4409
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
HandleFlock calls afs_StoreAllSegments when unlocking an exclusive
flock lock. This can drop the write lock on avc, so we must
effectively retry the entire lock operation again, since the world may
have changed while we were waiting to reacquire the lock on avc. So,
retry once all of the lock checks up to that point, to ensure that a
lock on the file actually still exists.
FIXES 125446
Change-Id: If249b0e761b595062068d7a506be85a3307870e8
Reviewed-on: http://gerrit.openafs.org/4393
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I7e07f98802ad059052d528a57278c971e857e074
Reviewed-on: http://gerrit.openafs.org/4407
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: Idd399da7de85541fb84da55246168788a2ef88da
Reviewed-on: http://gerrit.openafs.org/4405
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I47f804e455d0251dc30c5d5be2433f3ee7611fae
Reviewed-on: http://gerrit.openafs.org/4404
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I7bb08d7ec7a75b485f7f619fd4d8179d4c7349f0
Reviewed-on: http://gerrit.openafs.org/4403
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I82fb06f8d531476cc89e53ec189be15cb7ebf5d7
Reviewed-on: http://gerrit.openafs.org/4402
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I9a8c2d588eb00d1315c660faa485037cef2f8e6d
Reviewed-on: http://gerrit.openafs.org/4401
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Add the putenv, setenv and unsetenv functions to the list of
functions that configure checks for. This avoids the roken header
redefining them to rk_*, which we're then not providing an
implementation of.
Change-Id: I63bd88326e933f0afed399233c38489cd2aea46b
Reviewed-on: http://gerrit.openafs.org/4406
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Remove warning inhibition for fsprobe and uss_kauth, and
adjust README.WARNINGS to the current status.
Change-Id: Icc1f16a6ec70799c05abfcde557c66fae7c4311d
Reviewed-on: http://gerrit.openafs.org/4400
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Call RXAFS_GetTime directly instead of using ubik_Call which is
not prototyped and has logic that we don't need/want here since
we're targeting a specific server.
Change-Id: Ia71d1cb164d3fe71f01c88fc720837c69566baf5
Reviewed-on: http://gerrit.openafs.org/4397
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I4952f8d115d38a3bd1dfe86478cd4a30f533e86f
Reviewed-on: http://gerrit.openafs.org/4386
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
On Linux, afs/param.h determines whether to use the ucontext()
function based on the glibc version. However, the glibc version
macros aren't available until a C library header has been included.
There have been a couple of attempts to fix this. The first included
afs_sysnames.h before the C library check, but this wasn't sufficient
to pull in a header for all builds. The second included stdio.h before
including afs/param.h in process.c.
Whilst the second approach works, it has the drawback that it breaks
our convention that afsconfig.h and afs/param.h must always be the first
includes in a file. More seriously, it means that the behaviour of
afs/param.h is different depending on where it appears in the include
order - which is especially dangerous for 3rd party user.
So, this patch tries to resolve all of this by explicitly including
features.h before doing the glibc version checks. The only danger I
can see here is that Linux platforms without glibc may lack a
features.h, but I suspect we have trouble building on such platforms
in any case.
Change-Id: Ief96d32b10372225335e2d2fbb7205da4bf5fc0a
Reviewed-on: http://gerrit.openafs.org/4389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When a process requests an exclusive lock on a file on which it
already holds an exclusive lock, we basically form a no-op. However,
HandleFlock was allocating a new SimpleLocks and attaching it to
avc->slocks, without freeing the old SimpleLocks structure.
Since we don't need to do anything if we already hold an exclusive
lock, just break out of the loop right away when we detect that
scenario. Thus we avoid adding a new structure to avc->slocks, and we
avoid a memory leak.
Change-Id: I27c3df1d7807a0b74cba11d6e4a563df8232932a
Reviewed-on: http://gerrit.openafs.org/4395
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
The krb5_abortx stub is declared as returning a krb5_error_code,
so make it return something to avoid a warning.
Change-Id: Ib5b915c1c4e034b5c8393206c80596e5d6d5fc8b
Reviewed-on: http://gerrit.openafs.org/4396
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
if we're upgrading, a "cruft" startupitems script should just
be nuked.
FIXES 129601
Change-Id: Ic9295b19c893f154fd98a6ad1e5822c8b2ef44df
Reviewed-on: http://gerrit.openafs.org/4387
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This patch is intended to bring libafscp into accordance with the
current OpenAFS coding standards while also fixing a few small
issues. Apologies in advance for the numerous whitespace changes.
Change-Id: I606ed5024395319e12e8759f31494ebd27ff6112
Reviewed-on: http://gerrit.openafs.org/4380
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix a few issues with the recent commit to deal withg the removal
of path_lookup, spotted on RHEL 5:
- the configure tests needs fs.h to be included before namei.h, to
get the definition of struct inode
- we need to avoid the use of struct path unless its needed; on
older kernels the structure doesn't exist
Change-Id: I6251a96a371a50548dcafc70d94e91b52fc2922a
Reviewed-on: http://gerrit.openafs.org/4382
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove headers which are provided by libroken, and reorder header
includes so that they're a bit a more legible.
Change-Id: I41258d5b906350bcdf4854b244799fc8907b2bfc
Reviewed-on: http://gerrit.openafs.org/4385
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove headers which are provided by libroken, and reorded header
includes so that they're a bit a more legible.
Add math.h to the list of headers that configure will check for
Change-Id: I530afa77866a0aa3a33f8684ce9cf630aa347812
Reviewed-on: http://gerrit.openafs.org/4384
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.
Change-Id: I67bb92abc985d1510d8b8a108f9b9e3a62525fd5
Reviewed-on: http://gerrit.openafs.org/4332
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.
Change-Id: Ie4f0f87074b9f9c5a028098ea39e548d9932e54a
Reviewed-on: http://gerrit.openafs.org/4331
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
It turns out that we do need an afs.rc.fbsd that is set up for
transarc paths in this directory. To get it to work properly
will require the user to symlink to it from a dir that gets
checked by rcorder, but them's the breaks.
Change-Id: I1786e4862768127f29a6d309097536829da3e029
Reviewed-on: http://gerrit.openafs.org/4378
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
The OpenBSD version of afs_osi_TimedSleep() is missing the required
afs_event structure and afs_getevent routine. This update adds them
(by borrowing a copy of the code from the FreeBSD implementation).
Change-Id: Ie470e83a56caecb9494bb86dc3ff0a18420bb56e
Reviewed-on: http://gerrit.openafs.org/4373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Normally *SYNC server processes wait indefinitely for activity to
occur on one of the SYNC sockets. On some Linux kernels, there exists
a race condition where data can come in on a socket, but the select()
call continues to wait. To ensure that we do not hang forever in such
a scenario, add a timeout to the select() call, which will ensure we
notice the new data within 10 seconds. Raise the timeout on non-Linux
to reduce impact elsewhere.
The Linux kernel bug is tracked in
<https://bugzilla.redhat.com/show_bug.cgi?id=494404>, though that bug
report may not represent all affected kernels.
Change-Id: I3250eb53d59610ccbcffe9e8e283984d5ae0e2b4
Reviewed-on: http://gerrit.openafs.org/4377
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>