The compiler flagged this with a warning, and depending on the
flags that are set, the test may not give the expected result.
Use parentheses to get the intended precedence.
Change-Id: If0311aae70d6e71b69e247e5b66e0dd558c2c958
Reviewed-on: http://gerrit.openafs.org/2232
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
if an admin specifies -dynroot-sparse (instead of dynroot) come up
with just local cell and cell aliases showing. cell list
is configured as normal. fs newcell works as normal.
document it.
Change-Id: Ie644ed0f9923a85da5451eafaa114ddf36daa671
Reviewed-on: http://gerrit.openafs.org/2217
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
make test suite compile without warning
Change-Id: I4e4b63d6ce2ae73e5458913aa81308b2691044a9
Reviewed-on: http://gerrit.openafs.org/2223
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The salvager code can change a volume in many ways as it fixes errors.
We should break callbacks on the volume whenever we change it, as
clients may have callbacks on whatever we changed. So, for the
salvageserver, send an FSSYNC command to the fileserver to tell it to
break callbacks for that volume.
FIXES 127030
Change-Id: I1cd869371167df7d4e55ac14400865fb0a9c5154
Reviewed-on: http://gerrit.openafs.org/2210
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
We had identical code in two branches of an if/elif/else path.
Merge them together.
This allows two DARWIN80_ENV blocks to be coalesced; reindent
them correctly while we're here.
Change-Id: Icaa047994ec970ee8187a7811ee69de2f36a0503
Reviewed-on: http://gerrit.openafs.org/2222
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Set the VolumeChanged flag when we create a new root directory in a
volume when salvaging, since doing so changes the volume.
Change-Id: Ic6cd0b0d6f9b52f2006a114269321a38d312ab9b
Reviewed-on: http://gerrit.openafs.org/2212
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The 'size' field in the ubik header is only 16-bits wide. So, we must
use ntohs to convert it, not ntohl. Without this, vldb_check would
emit false-positive "Ubik header size is 0" warnings.
Change-Id: Iaa06b6dc58b7812b359d6096c112e1f3897c60e2
Reviewed-on: http://gerrit.openafs.org/2226
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
For some reason, the ReplayLog code was printing encountered errors in
the replay log as debug messages. Print them out as regular log
messages instead, since these are errors that at least warrant
visibility, if not more action.
Change-Id: Ifba22278e2f5f33010b87eebfc484ccd3745f916
Reviewed-on: http://gerrit.openafs.org/2225
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When attempting to read the replay log, ubik was not ntohl'ing all
integers that were read in from the log, causing the log to appear
invalid on little-endian systems. Fix it.
This problem manifests as apparent corruption in the database on top
of ubik when a commit is occurring when we are shut down, or a disk
error is encountered during a commit.
Change-Id: I82e04c59d0f55aa2105b02feb6ee332ea85eb4f3
Reviewed-on: http://gerrit.openafs.org/2224
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
no more APSL source is used. also, reboots are not required.
Change-Id: I61217b557c6193c922bc1b72b41e076e81db49e5
Reviewed-on: http://gerrit.openafs.org/2218
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
In auth_to_cell(), we only strdup() into the linkedcell argument
if there is a linkedCell in the current cellconf. However, in
main(), we free linkedcell if it is non-NULL, but it is allocated
on the stack and could contain garbage. free() chokes on such
garbage, causing aklog to abort().
If we copy nothing into linkedcell, set it to NULL so that we
do not attempt to free the bogus pointer.
Change-Id: I92905a5f17021ce1bc41909f5ceb1b0344456d93
Reviewed-on: http://gerrit.openafs.org/2213
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Recent investigations suggest that we no long require the BKL on
Linux. As an experiment, remove it.
Change-Id: I764fe1f6e9761ada5a0a86ba59450c0615bb1e78
Reviewed-on: http://gerrit.openafs.org/1823
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Remove the configure flag to specify the location of the Digital
UNIX kernel headers and some setup for the kernel module build.
Note in README that Digital UNIX / Tru64 is supported for servers
only.
Change-Id: I983f74068b1a1ae76d9a2b2549a8a141dba4e075
Reviewed-on: http://gerrit.openafs.org/2207
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
makesname() make a semaphore name for use in <sys/sema.h>-type routines on
IRIX. It takes as input a pointer to an allocated string buffer (sname) of
size METER_NAMSZ, a string prefix (prefix), and a vnode number (v_number).
When complete, sname is returned, pointing to the beginning of a
NULL-terminated string containing the new name, with a maximum of
(METER_NAMSZ-1) characters plus the NULL. The name is a concatenation of
the string at 'prefix' and the ASCII representation of the number in
'v_number'.
Note: Due to IRIX's use of uint64 to represent vnumber_t and a maximum
semaphore name length of 15 (METER_NAMSZ-1), this function cannot be
guaranteed to produce a name which uniquely describes a vnode.
makesname() is already called from afs_vcache.c but not (or no longer)
available / implemented elsewhere.
Change-Id: I4331c161b68b39a4c067691c97363b637d13ff15
Change-Id: Ia0a615426dc05e01a98e53e89ec3bae3726cac34
Reviewed-on: http://gerrit.openafs.org/2155
Reviewed-by: Chaz Chandler <clc31@inbox.com>
Tested-by: Chaz Chandler <clc31@inbox.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
As part of host state verification, we were calling
h_stateVerifyAddrHash to verify that all addresses for a host were in
the address hash table. The problem with this is that interface
addresses that are not marked as 'valid' are intentionally not in the
addr hash table. So, any time there was a non-'valid' interface
address in the host state, we stood a very good chance to fail to
verify the state.
Instead, if we have a non-'valid' address, try to verify that it is
_not_ in the addr hash table (or at least, is not pointing at the host
with the non-'valid' interface addr), since they're not supposed to be
in there.
Change-Id: I02fb0f516fa3ef384471d19bb1b970cfd8aff874
Reviewed-on: http://gerrit.openafs.org/2205
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When h_stateVerifyAddrHash logs that an error in state verification
occurs, it was only logging the address of the host causing the
problem. Log the port, too, since there could be multiple hosts with
the same address.
Change-Id: Ideee34f075948a0cb7cc1014920be5e120bdc6ef
Reviewed-on: http://gerrit.openafs.org/2204
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Fix various warnings in the aklog and klog code when building with
Heimdal. Use krb5_get_init_creds_opt_alloc if it's available rather
than allocating the struct off the stack, since the _opt_init
function is deprecated.
Change-Id: Ieff986121de9078e9402b0a51a8855655330caba
Reviewed-on: http://gerrit.openafs.org/2082
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Previously, building with Kerberos support required either passing a
flag to configure giving the location of a krb5-config script, or
manually setting variables specifying the Kerberos libraries and
header path. Replace that code with code that checks for Kerberos
libraries automatically and builds the Kerberos code if any were
found, with support for doing direct library probing if there is no
krb5-config script.
Add several platform-specific overrides directly into the configure
support, so we should be able to build out of the box on Mac OS X 10.3,
HP-UX, and AIX Kerberos with the new probes.
The Kerberos Autoconf macros are now the versions that come with
rra-c-util and are tested with multiple other packages, so both
OpenAFS and those packages will be able to benefit from further
portability improvements.
Update README for the new building instructions, documenting how to
configure the Kerberos probes if they can't automatically figure out
the location and flags for Kerberos on your system.
Change-Id: Ia35bb0dbc6b94c6b4dfe8165388447dbfcb31a29
Reviewed-on: http://gerrit.openafs.org/2026
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
In non-DAFS GetVolume, previously we waited for a volume with
vp->goingOffline set to go offline before we return. However, the
fileserver afsfileprocs.c case can treat the "going offline" case and
the "is offline" case identically, so there is no reason to wait. So
make the fileserver call a new GetVolume variant that does not wait.
Without this, all of the threads in the fileserver can potentially be
tied up by waiting for a volume to go offline, if the volume is taking
a long time to go offline due to an offline request following a client
slowly accessing the volume.
Change-Id: I58ae11e585852130154389d8df0567432cd0c2df
Reviewed-on: http://gerrit.openafs.org/2124
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
afscp was reporting its local address list in net-byte order, and then
giving that list as a response to RXAFSCB_WhoAreYou. Instead, convert
the addresses to host-byte order, since XDR takes care of endianness
foo.
Change-Id: I5d7d57f811ccaeada235e694ec5f343c1ac535b7
Reviewed-on: http://gerrit.openafs.org/2206
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
assert() is not used within mkvers.c.
afsconfig.h and afs/param.h have dependency problems in
src/config/
Change-Id: I2012a01c87cbd993a70df76ee3384b43ff037b29
Reviewed-on: http://gerrit.openafs.org/2203
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Commit 00c37e8634 introduced a few
usages of 'ifeq' in cross-platform Makefiles, breaking the build when
not using GNU make. Fix this by making the tptserver and tvlserver
'install' and 'dest' targets behave more like the 'ptserver' and
'vlserver' ones, and correct the ptserver 'install' target while we
are here.
Change-Id: Ia3fd9149c0f18a96a9899a5dfde41e53a45102b7
Reviewed-on: http://gerrit.openafs.org/2160
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If one runs make check without previously running make at the top
level first, it didn't build the util test programs properly.
Recurse into subdirectories for make check as well, and add the
check, test, and tests targets to tests/util/Makefile.in
Change-Id: Idc2caf4cf83a48da350e724aba2ac1228795085d
Reviewed-on: http://gerrit.openafs.org/2162
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The recent addition of AFS_NORETURN broke the Windows build
because afsconfig.h and afs/param.h were not included everywhere.
Make sure that they are.
Change-Id: I5962fe1178f73273f5b3c1d269b1a125fba2d2c6
Reviewed-on: http://gerrit.openafs.org/2159
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
The lstat() macro definition has to take into account
the version of the compiler and the size of time_t.
Change-Id: Id7ad8c3956bba9832cc028db628cfabe58a1d8d9
Reviewed-on: http://gerrit.openafs.org/2158
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Visual Studio older than 1400 (VS8) does not define errno_t.
LICENSE MIT
Change-Id: I27c0892d8ba4a371417f635b0d6e5677fa655422
Reviewed-on: http://gerrit.openafs.org/2157
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Add ubik_BeginTransReadAnyWrite, which allows for reading from the
database, even while there is a conflicting ubik write lock. Reads are
still blocked while the local database is updating due to a write
transaction commit.
Change-Id: I5604fa3cc8a334606f5e3535aed6f6cedcb5f167
Reviewed-on: http://gerrit.openafs.org/2103
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
make things buildable on arm darwin
Change-Id: I88af2b82e9ed356fd57aa8f05dfee71d7fa6cd8a
Reviewed-on: http://gerrit.openafs.org/2153
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
on macos systems where we can't get the environment,
just return from ktc_newpag
Change-Id: I9a169d0bf035c40d727a386bb3d2070eea225ed4
Reviewed-on: http://gerrit.openafs.org/2150
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The names of some configure defines changed with the recent autoconf
cleanups. This one was missed and was left with the old value.
Change-Id: Ibce5e36b8ae6becdfa61bf6e9c440b3d9a6fa272
Reviewed-on: http://gerrit.openafs.org/2130
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
in order to cross compile, allow a way to generate generated files on the host
Change-Id: I9639f350b179dbeb3d45802e8685da88a3b06c83
Reviewed-on: http://gerrit.openafs.org/2147
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
if you wish to cross compile, you want these things. arrange to
be able to build just them
Change-Id: I6bee40b61a16722c402832bba39d2e88dcabec25
Reviewed-on: http://gerrit.openafs.org/2145
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
set an error code so idle dead time is enforced on sending. needed
in order that MTU pings be activated.
Change-Id: I8cf1ca81e6519b440fc679e85f327f338400c29a
Reviewed-on: http://gerrit.openafs.org/2116
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
engage mtu pings. only occur while a call is active but results are
cached per-peer. requires idle dead time to be in use, or does not
activate. (needed to time out the call, otherwise, keepalives will
succeed and the call will thus not hit regular "down server" timeout)
Change-Id: Ic29b1b5713fb6debde14f4adfd5019ee80cc9e3c
Reviewed-on: http://gerrit.openafs.org/2115
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
for the purpose of mtu discovery, we need a sequence number to
correlate if a large packet is acked. don't track sequence number
0 packets. a later change adds the mechanics needed for MTU pings
Change-Id: I83d4466115bbd45acdc2777bfbef0ff393dd5a3f
Reviewed-on: http://gerrit.openafs.org/2114
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
we already set a local variable, conn, to call->conn. use it instead
of dereferencing call->conn repeatedly
Change-Id: I5d38edc1d3507a717598140393094b1ba22ced46
Reviewed-on: http://gerrit.openafs.org/2113
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
if RX_MSGSIZE is analyzed and we'd retry, so indicate to our users
Change-Id: I77aba5dffd4280e0ee43383cadb34aca4042cbd6
Reviewed-on: http://gerrit.openafs.org/2117
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
fix type of intermediate value used in CAS operations, and reformat slightly.
LICENSE BSD
Change-Id: If49be8e020e0f735d67290440b1a74caccf90bf0
Reviewed-on: http://gerrit.openafs.org/2152
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If DoBosHostList ends up being called without the -server argument
in its command structure, then a printf will attempt to dereference
a NULL pointer to the -server field.
Caught by clang-analyzer
Change-Id: I1114406d03b265f4d780efd8e84fea53013cb51c
Reviewed-on: http://gerrit.openafs.org/2143
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If the call to a pioctl returns an error, it's possible to reach
the end of the storebehind function and try and print an old, or
bogus, value from the pioctl data block.
Caught by clang-analyzer
Change-Id: I1209c0c24730273510fbad98a75a429917836605
Reviewed-on: http://gerrit.openafs.org/2142
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Unless CopyOnWrite2 encounters the condition where
(rdlen != length) || (wrlen !=length) it will never set a value
for the 'rc' return code, and so return with an undefined value.
Looking at the code, it looks like rc should be 0 in all other
situations, so this patch provides a default value.
Caught by clang-analyzer
Change-Id: If3e528f3d66abb3dde6da2304084f7698c05b863
Reviewed-on: http://gerrit.openafs.org/2141
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If open() is called with a the O_CREAT flag, then it requires a
3rd argument, containing the mode with which to create the file.
On DARWIN (when we always use O_CREAT), and on other platforms
where the first call to open returned E_NOENT, we weren't doing this,
and so were presumably getting a random mode of whatever garbage was
on the stack.
Caught by clang-analyzer
Change-Id: Ic173e582e0d46f6d4cf8801dc7a6b4b393db5063
Reviewed-on: http://gerrit.openafs.org/2139
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>