openafs.git
13 years agoImport yet more files from Heimdal
Simon Wilkinson [Mon, 4 Oct 2010 23:59:43 +0000]
Import yet more files from Heimdal

Import still more files from Heimdal, so that we can try to make
Irix happy once more. Mutter, mutter, mutter.

Change-Id: Ic8f20885fd324ab3698109f75ba41cdf6d0975dd
Reviewed-on: http://gerrit.openafs.org/2902
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoHeimdal: Fix 32bit build problems
Simon Wilkinson [Mon, 4 Oct 2010 19:22:50 +0000]
Heimdal: Fix 32bit build problems

The earlier inclusion of sha512 from Heimdal broke the build on
32bit platforms, because this file doesn't flag 64bit constants as
being such.

The correct place for this fix is in Heimdal, and it will be replaced
with a fix from Heimdal as soon as one is available. For now though,
this gets our build going again.

Change-Id: I0de822a933184078c491a16aafef45519fa2bbd2
Reviewed-on: http://gerrit.openafs.org/2901
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agovol: Log ignored dirs that look like partitions
Andrew Deason [Sun, 3 Oct 2010 23:27:19 +0000]
vol: Log ignored dirs that look like partitions

If we see a /vicep*-like directory when we VAttachPartitions, and we
ignore it because it lacks an AlwaysAttach, log that we ignored it.
This may make things less confusing to admins that just try to create
a /vicep* directory and don't know why it doesn't work.

Feature suggested by Jason Edgecombe.

FIXES 128221

Change-Id: I0802f914658c7df413b22b3726a5085f1b646266
Reviewed-on: http://gerrit.openafs.org/2893
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agoutil: Add base64 from Heimdal's roken
Simon Wilkinson [Mon, 4 Oct 2010 14:24:15 +0000]
util: Add base64 from Heimdal's roken

Add the base64 code from libroken into libutil, using the src/external
framework.

Create a new, non-installed directory, to hold util headers, rather than
continuing to stuff everything into afs/

Change-Id: I6b743a3702c3bb07ac798392475e7e067765f238
Reviewed-on: http://gerrit.openafs.org/2900
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agohcrypto: Build fixes
Simon Wilkinson [Mon, 4 Oct 2010 15:01:55 +0000]
hcrypto: Build fixes

Fix the hcrypto build to deal with the changes introduced by the
latest import from Heimdal

Change-Id: I2effebffb6df2fdb351d070f8ea06ecf01aab46e
Reviewed-on: http://gerrit.openafs.org/2899
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoImport of code from heimdal
Heimdal Developers [Mon, 4 Oct 2010 13:25:11 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
48ad3e1e6597f03cce5439831ef94b5ec11894e9
which is described as switch-from-svn-to-git-1593-g48ad3e1

Change-Id: I90eb6752000d6794e830a704adcf367928b05a98
Reviewed-on: http://gerrit.openafs.org/2898
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdd more files from Heimdal
Simon Wilkinson [Mon, 4 Oct 2010 14:18:02 +0000]
Add more files from Heimdal

Add the base64 implementation from libroken, and the n-fold.c file
from libkrb5 to the list of source files that we import from Heimdal.

It also pulls in the new sha512.c and validate.c files which are now
necessary to complete a userspace hcrypto build.

This patch will fail to build until the build fixes from the subsequent
change are applied.

Change-Id: I60a691d0ccebd6d6bfb823856f79b59670eb86ec
Reviewed-on: http://gerrit.openafs.org/2897
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoconfigure: Restore saved CFLAGS
Simon Wilkinson [Mon, 4 Oct 2010 11:33:24 +0000]
configure: Restore saved CFLAGS

When we test for whether the C compiler can take the
-fno-strength-reduce flag, we add the flag to CFLAGS to do so.
However, we were not restoring the old value of this flag when we
completed the test, and so we were always setting -fno-strength-reduce
in the userspace compile.

Previously, this was harmless, as we always overwrote CFLAGS, but if
we're moving to a world where we honour the user's setting of CFLAGS,
we need to not leak changes in this way.

Change-Id: I029c9fe91132ced34867445afe673761a597ccbe
Reviewed-on: http://gerrit.openafs.org/2894
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoconfigure: Don't let autoconf pick our CFLAGS
Simon Wilkinson [Mon, 4 Oct 2010 12:45:53 +0000]
configure: Don't let autoconf pick our CFLAGS

If the user hasn't specified CFLAGS on the command line to
./configure, then autoconf will set them to -g -O2 if the compiler
supports those options.

For compatibility with what OpenAFS has always done, and to let us
manually set optimisation and debugging flags later, disable this
behaviour.

Change-Id: Ic78d5f824433d94d76f16c107af3488132d57155
Reviewed-on: http://gerrit.openafs.org/2895
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agovos release: Force full dump on RO_DONTUSE sites
Andrew Deason [Fri, 10 Sep 2010 20:52:34 +0000]
vos release: Force full dump on RO_DONTUSE sites

When releasing a volume, currently we perform an incremental dump on
RO_DONTUSE sites if the volume exists on the remote site. Since
RO_DONTUSE implies that we do not expect a site to exist there, delete
the extant volume if we find one and force a full dump.

If we perform an incremental dump, we run the risk of incrementally
dumping to a temporary volume that the administrator is not aware of,
and doesn't have any actual data but has a last update time late
enough that it may be missing some data after the incremental dump. So
to avoid that, force a full dump every time.

Change-Id: If751a66d6e1499b5d6f67457ae28277a6200c53a
Reviewed-on: http://gerrit.openafs.org/2731
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agosin_family is not network order
Chas Williams (CONTRACTOR) [Sun, 3 Oct 2010 18:35:46 +0000]
sin_family is not network order

sin_family isnt sent over the network and therefore doesnt need
htons().  sin_family is essential the same as domain, and no one
does socket(htons(AF_INET), ...)

Change-Id: Ie0e2396f78e0934d49aeeacfc9c5ffe98df211b6
Reviewed-on: http://gerrit.openafs.org/2891
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRemove duplicate rx_stats targets in libuafs Makefile
Marc Dionne [Sun, 3 Oct 2010 18:35:20 +0000]
Remove duplicate rx_stats targets in libuafs Makefile

The libuafs part of commit 4346144b was not needed, rx_stats was
already in the Makefile.  Harmless, but generates warnings.

Revert the libuafs portion of that commit.

Change-Id: I14d64445c9690bc6d69881c6bd6c00c4670895f3
Reviewed-on: http://gerrit.openafs.org/2892
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx stats atomic inclusion needs kmutexes for emulation
Derrick Brashear [Sun, 3 Oct 2010 06:02:22 +0000]
rx stats atomic inclusion needs kmutexes for emulation

for platforms with no native atomics we use a mutex. well,
fine, but without defining kernel mutexes, that doesn't work so
well.

Change-Id: Ia85e24aad8684a3855511de9548acee4ab86e83e
Reviewed-on: http://gerrit.openafs.org/2890
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Ensure that cm_NameI errors are acted upon promptly
Jeffrey Altman [Wed, 15 Sep 2010 23:06:22 +0000]
Windows: Ensure that cm_NameI errors are acted upon promptly

There are many cases in the SMB server where an error from cm_NameI()
was either ignored or not acted upon until several other operations
are performed that could result in the same error being repeated.
This is a mistake which did not have negative side effects until
additional checks for callback status were added recently.

At present, if a CM_ERROR_ACCESS error is returned and ignored,
subsequent attempts to operate on the same cm_scache_t will result
in additional queries to the file server that will also end in an
abort response.  This can trigger the file server to delay responses
to the client.

This patchset ensures that all cm_NameI() errors are acted upon
promptly.

LICENSE MIT

Change-Id: Ie334b624cc2b28f2c2a37787b5edef9d37cdb041
Reviewed-on: http://gerrit.openafs.org/2887
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Fix Parent(path) computation to permit mp and symlink creation
Jeffrey Altman [Wed, 15 Sep 2010 23:01:06 +0000]
Windows: Fix Parent(path) computation to permit mp and symlink creation

The parent path computation was leaving trailing slashes on the
path names which prevented the creation of mount points and symlinks
when UNC paths were used that contained mount points.

LICENSE MIT

Change-Id: I50cba9cb8a2b0ad45f84995d05f368052be683cc
Reviewed-on: http://gerrit.openafs.org/2886
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoConditionalize include of string.h in rx_stats.c
Marc Dionne [Sun, 3 Oct 2010 00:32:05 +0000]
Conditionalize include of string.h in rx_stats.c

Linux doesn't have <string.h>, it's in the linux subdirectory.  But
it is already included by sysincludes.h, so it should not be needed
here.

Change-Id: I017c374e7b6d47e900ec73b40a36183a3f23f35c
Reviewed-on: http://gerrit.openafs.org/2888
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoLinux: correct use of atomic_add and atomic_sub functions
Marc Dionne [Sun, 3 Oct 2010 01:02:23 +0000]
Linux: correct use of atomic_add and atomic_sub functions

The rx_atomic_add and rx_atomic_sub functions have arguments
reversed compared to the linux atomic_add and atomic_sub.

Adjust the macros to flip the arguments when calling them

Change-Id: I6d58c8f0ac8ccf09e62c9d3921b9f3ae50ca94c9
Reviewed-on: http://gerrit.openafs.org/2889
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: Fix RXDEBUG_PACKET builds
Jeffrey Altman [Sat, 2 Oct 2010 15:43:03 +0000]
Rx: Fix RXDEBUG_PACKET builds

Commit 37946ee1739aa22cb2f7330a37504d33a7733c9a unintentionally
broke RXDEBUG_PACKET builds.  Fix it.

Change-Id: I833109b8e35f2f3487fe2865856c7f37cd31e0c2
Reviewed-on: http://gerrit.openafs.org/2882
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: raise rx_minPeerTimeout to 20ms
Jeffrey Altman [Sat, 2 Oct 2010 03:47:11 +0000]
Rx: raise rx_minPeerTimeout to 20ms

At 2ms it is possible for the packet we are sending to be resent
just about immediately as the retryTime computation occurs before
the send takes place and not afterwards.  If the network send blocks,
the retryTime may have already expired.

We do not want rx_minPeerTimeout to be too large though because the
value will end up being used as the backoff time period when the
actual RTT for the connection is less than the rx_minPeerTimeout
value.  Extensive testing shows 20ms to be an adequate compromise
that avoids the vast majority of unnecessary resends without
unnecessarily slowing down the connection if a packet is in fact
lost.

Change-Id: I87248ec1cff6a4d0862da0239d4c203024a783b6
Reviewed-on: http://gerrit.openafs.org/2881
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: When call receive is done, send ack all packet
Jeffrey Altman [Thu, 30 Sep 2010 14:48:58 +0000]
Rx: When call receive is done, send ack all packet

When all of the packets for a call have been received,
immediately send an ack all packet to the peer.  This permits
the peer to free the contents of the transmit queue and cancel
all pending resend events.

Change-Id: Ic06ccaca6f0c5e2f770c5c45c84f7fc155207bcf
Reviewed-on: http://gerrit.openafs.org/2871
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex
Jeffrey Altman [Wed, 22 Sep 2010 23:36:03 +0000]
Rx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex

Add a new global mutex rx_refcnt_mutex to protect the conn->refCount
and call->refCount in place of relying upon the conn->conn_data_lock
and the call->lock.

This will relieve some lock contention with rx_ReceivePacket().

Change-Id: Iebc04a87149a9fe69a7e312e8968b08c2e94148d
Reviewed-on: http://gerrit.openafs.org/2837
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agodarwin kernel atomics
Derrick Brashear [Sat, 2 Oct 2010 16:43:36 +0000]
darwin kernel atomics

actually enable atomics for the darwin kernel, whose API is
just slightly different

Change-Id: I566149428d253806c4546fa0c5a3f96e8098c4eb
Reviewed-on: http://gerrit.openafs.org/2884
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoadd rxstats to kernel
Derrick Brashear [Sat, 2 Oct 2010 16:59:46 +0000]
add rxstats to kernel

add split out rxstats module to kernel

Change-Id: Ibdc721f19a63c58604a56b0099d0c52161d3b00c
Reviewed-on: http://gerrit.openafs.org/2885
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoadd option to rxperf to use rx_Readv() instead of rx_Read()
Chas Williams (CONTRACTOR) [Fri, 1 Oct 2010 13:40:16 +0000]
add option to rxperf to use rx_Readv() instead of rx_Read()

rx_Readv() is a bit "faster" than rx_Read() and typically used by most
afs transaction.

server% rxperf server
client% rxperf client -c send -s server
SEND: threads   1, times        100, bytes      1048576:            2073 msec

server% rxperf server -v
client% rxperf client -c send -s server
SEND: threads   1, times        100, bytes      1048576:             983 msec

Change-Id: I27b06dbbb61f2bc34fa91bcda3c6e046c787ff62
Reviewed-on: http://gerrit.openafs.org/2877
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoWindows: Pass Volume Root Fid to cm_Analyze after RXAFS_GetVolumeStatus
Jeffrey Altman [Sat, 2 Oct 2010 04:49:38 +0000]
Windows: Pass Volume Root Fid to cm_Analyze after RXAFS_GetVolumeStatus

RXAFS_GetVolumeStatus can return VNOVOL, VMOVED, etc.  In order to
process them and update volume state a fid must be passed to cm_Analyze().
Use the volume root fid.

LICENSE MIT

Change-Id: Ia6115a17aae06144277271048e8287e5ad52ff2a
Reviewed-on: http://gerrit.openafs.org/2883
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoProvide an abstract thread pool object
Andrew Deason [Thu, 11 Mar 2010 16:43:54 +0000]
Provide an abstract thread pool object

Add some routines to maintain a pool of threads, for working through a
Vwork_queue.

This adds the afs_tp* series of functions. Originally written by
Tom Keiser.

Change-Id: I8735aa14ca6622ae0eca7a7589e69b0f3b3daf08
Reviewed-on: http://gerrit.openafs.org/1863
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoProvide an abstract work queue object
Andrew Deason [Thu, 11 Mar 2010 16:39:56 +0000]
Provide an abstract work queue object

Add some routines for specifying chunks of work to be done. The idea
is to be able to pass these to different threads, and specify
dependencies between them, wait on them completing, etc.

This adds the afs_wq* family of functions. Originally written by Tom
Keiser.

Change-Id: If556cf4da12de8c4be1e53376d85d791584ae177
Reviewed-on: http://gerrit.openafs.org/1862
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoexempt instant timeouts from mtu discovery
Derrick Brashear [Fri, 1 Oct 2010 03:57:11 +0000]
exempt instant timeouts from mtu discovery

if we set lastReceiveTime to 0 to hint that no net, honor that here as
"just time out"

Change-Id: Ifb06fad782669649027841e3930ff94600b6c900
Reviewed-on: http://gerrit.openafs.org/2875
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agoDAFS: Raise LogLevel for per-chain vol stats
Andrew Deason [Tue, 14 Sep 2010 14:45:10 +0000]
DAFS: Raise LogLevel for per-chain vol stats

Only report detailed per-chain volume statistics on shutdown/SIGXCPU
if LogLevel is 125 (or 25 for smaller per-chain stats). If a
fileserver is configured with a large -vhashsize, printing out stats
for each chain can take awhile and use up a nontrivial amount of disk
space for logging, so only print out these stats if we're asked for
them.

Change-Id: Iceb38e29ab40958e05f3cf146687f679bd0f061c
Reviewed-on: http://gerrit.openafs.org/2759
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agorename some variables in rxperf
Chas Williams (CONTRACTOR) [Fri, 1 Oct 2010 13:58:52 +0000]
rename some variables in rxperf

sendtimes and recvtimes are actually the data byte counts to be
exchanged during an rpc test not an iteration count as implied
by their names

Change-Id: I3d567aacf1ab1d25fda20e48a6bbb68a63330230
Reviewed-on: http://gerrit.openafs.org/2876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoconfigure: --with-linux-kernel-packaging should default to disabled
Chas Williams (CONTRACTOR) [Wed, 29 Sep 2010 22:21:25 +0000]
configure: --with-linux-kernel-packaging should default to disabled

the test for this build feature is reversed.  by default, the value for
with_linux_kernel_packaging will not be defined which makes the existing
test pick MPS='SP' instead of LINUX_WHICH_MODULES.  based on the configure
help messages, this would appear to be an opt-in not an opt-out.

...
Optional Packages:
...
  --with-linux-kernel-packaging
                          use standard naming conventions to aid Linux kernel
                          build packaging (disables MPS, sets the kernel
                          module name to openafs.ko, and installs kernel
                          modules into the standard Linux location)
...

Change-Id: Ie16fba165e6c85b7ecbce887badb9ffc06a3a7a8
Reviewed-on: http://gerrit.openafs.org/2869
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agoafsd's -mem_alloc_sleep is obselete -- update documentation
Chas Williams (CONTRACTOR) [Thu, 30 Sep 2010 18:27:35 +0000]
afsd's -mem_alloc_sleep is obselete -- update documentation
to reflect this.

Change-Id: Ife0f4a2582fe535d7c977d0ca24f92e314459386
Reviewed-on: http://gerrit.openafs.org/2874
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoDAFS: document the limits of -vhashsize
Andrew Deason [Thu, 2 Sep 2010 18:11:32 +0000]
DAFS: document the limits of -vhashsize

You can only specify a -vhashsize between 6 and 28 (inclusive).
Document that in the dafileserver man page.

Change-Id: I44d1c71f4ff303174e8aebf74b0b9075c07bc8b4
Reviewed-on: http://gerrit.openafs.org/2650
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agolinux define ucontext properly
Derrick Brashear [Wed, 29 Sep 2010 18:15:24 +0000]
linux define ucontext properly

ucontext requires glibc version info to engage.
glibc info comes from features.h, which if we include afs_sysnames.h,
we get... so, let's swap these.

Change-Id: I26e5554f2c5c5f9f8a74fb591efdfdc1f6ae7257
Reviewed-on: http://gerrit.openafs.org/2868
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Don't have different args for rxi_FreeCall
Simon Wilkinson [Tue, 28 Sep 2010 23:21:43 +0000]
rx: Don't have different args for rxi_FreeCall

rxi_FreeCall changes its number of arguments depending on whether
locks are enabled or not. That's a little bit nasty to read, so just
change it so that it always takes two arguments, and ignores the
second when it doesn't need it.

Change-Id: I5f869bea9bcf01bac16d8c5eec93373788d17978
Reviewed-on: http://gerrit.openafs.org/2863
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Make statistics interface use Atomics
Simon Wilkinson [Tue, 28 Sep 2010 23:11:53 +0000]
rx: Make statistics interface use Atomics

Make the rx_statistics statistics gathering infrastructure use
atomics for all of its counters. This significantly reduces
lock contention. However, it also (potentially) changes the format
of the rx_stats variable which has been used by callers in the past.

To simplify this process, and to aid with future changes, we remove
direct access to rx_stats. Instead, two additional API functions
rx_GetStatistics and rx_FreeStatistics are provided. These give the
caller access to an 'normal' rx_statistics structure.

Tom Keiser has suggested that we should explore using thread-local
statistics structures, and just aggregating them when we are asked
to report. This is a fine idea, and is equally possible with the
new interface that this patch introduces.

Change-Id: I859cea8f7354a655be007b95fa8a61f995308b35
Reviewed-on: http://gerrit.openafs.org/2862
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Use atomics for rxi_AllocSize and rxi_AllocCnt
Simon Wilkinson [Tue, 28 Sep 2010 23:15:37 +0000]
rx: Use atomics for rxi_AllocSize and rxi_AllocCnt

More atomics for RX statistics counters. Less lock contention.

Change-Id: I55202d2d54323448f7bc191aab03ace976fac962
Reviewed-on: http://gerrit.openafs.org/2861
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Make nWaiting and nWaited atomic
Simon Wilkinson [Tue, 28 Sep 2010 23:06:45 +0000]
rx: Make nWaiting and nWaited atomic

Make the nWaiting and nWaited counters atomic, and get rid of the
mutex which used to protect them.

Change-Id: I0c4d8f1df1860baa2bb189ea77bf20ee9f2066f7
Reviewed-on: http://gerrit.openafs.org/2860
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Add rx_NewThreadId function
Simon Wilkinson [Tue, 28 Sep 2010 22:48:50 +0000]
rx: Add rx_NewThreadId function

The fileserver and the fsync server were locking an internal RX
mutex, and incrementing an internal counter in order to obtain fake
pthread thread IDs. Instead of letting them muck around in the
internals of RX, provide an API that can be called to obtain a
ThreadId counter, and use that API throughout the code.

Change-Id: I68f41d1486cdafeb757da2c0df899ae1ca2b2bfc
Reviewed-on: http://gerrit.openafs.org/2859
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Add atomic operations code
Simon Wilkinson [Tue, 28 Sep 2010 22:37:54 +0000]
rx: Add atomic operations code

Add support for an atomic type, and atomic operators for RX. This
builds on work which has already been done for Windows, where
InterlockedOperations are used for statistics gathering.

A new opaque type, rx_atomic_t is introduced so that normal arithmetic
operations will fail on atomic data.

An implementation using native atomic methods is provided for Darwin,
Solaris and Windows. A native kernel implementation is used for Linux.
Where OpenAFS is built with a sufficiently modern gcc, gcc's atomic
primitives will be used. Sadly, gcc's builtin operations are not
available for i386, they will only be used with builds the set
-march=i486 (or later).

Otherwise, we fall back to a single mutex which protects all atomic
operations.

Change-Id: I5f69677a80617e3936f82b177cd58250a6dbf31f
Reviewed-on: http://gerrit.openafs.org/2858
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Set NTDDI_VERSION when setting _WIN32_WINNT
Asanka Herath [Mon, 30 Aug 2010 19:36:50 +0000]
Windows: Set NTDDI_VERSION when setting _WIN32_WINNT

Change-Id: I65312c35b40dbbb4ea8f0170ea8e961bd93359aa
Reviewed-on: http://gerrit.openafs.org/2866
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoRX: Tidy reader data locking
Simon Wilkinson [Sun, 26 Sep 2010 14:48:54 +0000]
RX: Tidy reader data locking

Data which is accessed only by the reader thread doesn't need to be
protected by call->lock

Remove the call->lock protection where it isn't required, which makes
certain read/write calls lock free.

Stop rx_ResetCall from manipulating reader thread data. This data will
be zero'd and cleared when the reader thread calls rx_EndCall, and
doesn't need to be reset by the Listener thread.

The change which made rx_ResetCall reset reader thread information
was originally part of 559ea99b. It caused race conditions that were
fixed by adding additional lock protection in d0cc6e, 4dadd2 and
423ab97e. This commit reverts portions of all of those changes. It
is safe to not clear the iovc in ResetCall because any NewCall must
be balanced by a corresponding EndCall in the reader thread, and
EndCall does the appropriate freeing of reader elements.

Change-Id: I450469a4591fbe4af34482a2b219708795c57e8e
Reviewed-on: http://gerrit.openafs.org/2856
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

13 years agoMore FBSD syscall tweaking
Ben Kaduk [Wed, 29 Sep 2010 00:03:25 +0000]
More FBSD syscall tweaking

We're now properly registered in syscalls.master for HEAD
(i.e. proto-9.0) and RELENG_8 (proto-8.2), which means that
afs3_syscall is prototyped in sys/sysproto.h .  Accordingly,
don't declare it in afs_prototypes.h for those cases.

Also add FBSD82_ENV checks for the new syscall-registration code,
and cast afs3_syscall to sy_call_t* for the sysent structure.

Change-Id: I0e7427274b018043c3a6a8ca6181a78a385d9aa2
Reviewed-on: http://gerrit.openafs.org/2864
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Limit window size to max acks
Simon Wilkinson [Mon, 27 Sep 2010 22:50:23 +0000]
rx: Limit window size to max acks

The RX ack packet can only acknowledge 255 packets at once. In the
current implementation, this limits our maximum window size to 255,
as we can't acknowledge any packets we receive outside of that window
size.

Change-Id: If12eeb4a71cdf0bcd2a82f86b416e387543b7ea8
Reviewed-on: http://gerrit.openafs.org/2857
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agovolser: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 15:11:18 +0000]
volser: Set but not used variables

Fix instances of variables defined and set but never used in the
volser directory.

Spotted by gcc 4.6

Change-Id: Ibb1896cdde51985d1c14b563f8a6de6cec90403f
Reviewed-on: http://gerrit.openafs.org/2852
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agopam test should return an int in main
Derrick Brashear [Sun, 26 Sep 2010 11:28:46 +0000]
pam test should return an int in main

change things so we conform with the usual prototype for main()

Change-Id: Ia3bfe6bb1b135fdba53ccca1650b0b7223108a27
Reviewed-on: http://gerrit.openafs.org/2850
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoviced, tviced: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 00:40:56 +0000]
viced, tviced: Set but not used variables

Remove or ifdef out some variables that are set but never used.

Spotted by gcc 4.6

Change-Id: I895740680997cff29d96ee5257830531c71711af
Reviewed-on: http://gerrit.openafs.org/2853
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agotubik: minor Makefile cleanups
Marc Dionne [Sat, 25 Sep 2010 19:28:37 +0000]
tubik: minor Makefile cleanups

Rework the install targets for udebug to avoid warnings in the case
where afssrvbindir = bindir

Remove commented out compile line for udebug

Change-Id: I500ba2575e7d71114dbdec704d6b3d22585cfdd3
Reviewed-on: http://gerrit.openafs.org/2851
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agorxperf: Really set UDP buffer size
Simon Wilkinson [Mon, 27 Sep 2010 10:47:51 +0000]
rxperf: Really set UDP buffer size

On Unix, the UDP buffer size has to be set before we open any sockets.
Otherwise, the default (64k) buffer size is used and never changed.

Move the calls to SetUdpBufSize in rxperf.c so that the -u command
line option actually has an effect.

Change-Id: Ic925faabca8264c0359693e97c2ab5b637902797
Reviewed-on: http://gerrit.openafs.org/2855
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoFix rxperf so that it works with pthreads
Simon Wilkinson [Sun, 26 Sep 2010 14:20:22 +0000]
Fix rxperf so that it works with pthreads

*) Don't allocate 512K on the stack
*) Don't pass stack allocated data into pthread_create()

Change-Id: I6a4f70121871bf3b7a62d9ed893a2d15bffc7a21
Reviewed-on: http://gerrit.openafs.org/2854
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoUpdate Debian packaging to 1.5.77-2 release
Russ Allbery [Sat, 25 Sep 2010 23:42:57 +0000]
Update Debian packaging to 1.5.77-2 release

Contains DKMS robustness fixes, improvements to the defaults for the
module build, and cleanup of the openafs-client init script.  Updates
the build system for the new demand-attach binary naming and for the
changes to supported configure options.  Fixes some issues with
afs-newcell.  Forces disabling of the Linux syscall probing in kernel
module builds, since no supported Debian kernel allows this and it
causes problems.  Update debhelper to V8, which allows simplification
of debian/rules and debian/module/rules.

Change-Id: I4db4df873607129548557389f08c7ec1480e7204
Reviewed-on: http://gerrit.openafs.org/2849
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoscout: display fetch and store counts as unsigned
Michael Meffie [Thu, 23 Sep 2010 14:15:57 +0000]
scout: display fetch and store counts as unsigned

Fetches and stores are already defined as unsigned, so format
them as unsigned values when displaying in scout. This fixes
the bug where scout shows those counts as negative values on
busy servers which have been running for a while.

Change-Id: I460172720d76e081ede4381b2718f75386af4285
Reviewed-on: http://gerrit.openafs.org/2843
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorx: Big windows make us sad
Simon Wilkinson [Thu, 23 Sep 2010 16:41:47 +0000]
rx: Big windows make us sad

The commit which took our Window size to 128 caused rxperf to run
40 times slower than before. All of the recent rx improvements have
reduced this to being around 2x slower than before, but we're still
not ready for large window sizes.

As 1.6 is nearing release, reset back to the old, fast, window size
of 32. We can revist this as further performance improvements and
restructuring happen on master.

Change-Id: Ic1de2cf33f42edaf1455b72580110d56fe968a7b
Reviewed-on: http://gerrit.openafs.org/2844
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agolibafsrpc depends on rxstat and fsint
Simon Wilkinson [Thu, 23 Sep 2010 14:01:58 +0000]
libafsrpc depends on rxstat and fsint

... in the same way as shlibafsrpc

Change-Id: I02d8c35efadd9c9b865bb91eabd0e5b3c10a115e
Reviewed-on: http://gerrit.openafs.org/2842
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoUpdates to the Cache Manager to include NetBSD5 support
Matt Smith [Thu, 16 Sep 2010 20:44:04 +0000]
Updates to the Cache Manager to include NetBSD5 support

LKM currently builds and will mount when forced with the entry point
manually defined. Contents of /afs can be discovered, but when listing
the directory, the system call will not return.

Change-Id: I68ba1897b56613bd4ebbe331eea3140c6a963a7d
Reviewed-on: http://gerrit.openafs.org/2767
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorxperf: Add build rules to build a pthreaded version
Simon Wilkinson [Thu, 23 Sep 2010 09:42:25 +0000]
rxperf: Add build rules to build a pthreaded version

The pthreaded version of rxperf is much more interesting than the
LWP one now, so add some rules so that Unix can play with it too.

Change-Id: Ia76dd89482c8d62805ed8dfd58a1963e4bf8cc65
Reviewed-on: http://gerrit.openafs.org/2841
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorxperf: Fix the Unix build again
Simon Wilkinson [Thu, 23 Sep 2010 09:40:02 +0000]
rxperf: Fix the Unix build again

Fix the Unix build of rxperf again

Change-Id: I2c5d43f6f69ef36d703bd73154a1f5ec080a47cd
Reviewed-on: http://gerrit.openafs.org/2840
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdd an LWP version of the hcrypto library
Simon Wilkinson [Wed, 22 Sep 2010 08:03:27 +0000]
Add an LWP version of the hcrypto library

hcrypto uses a single pthread mutex, which is only required when
we're running in a pthreaded world (in a cooperative threading world
such as LWP, there's no way that two processes can both access the
Fortuna PRNG at the same time)

So, build an LWP version of hcrypto which just disables the mutexes.

Change-Id: I0b894cfa0d16ba6d16544a4d725191c965ac6e50
Reviewed-on: http://gerrit.openafs.org/2833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoMove des/stats.h to rxkad directory
Simon Wilkinson [Thu, 15 Apr 2010 16:35:37 +0000]
Move des/stats.h to rxkad directory

The structures defined in des/stats.h are rxkad specific, and so
should be handled by an rxkad header file, rather than by something
in the eventually-to-be-removed DES directory.

The structure shouldn't be initialised in libutil. Move initialisation
to rxkad_common, where it is already initialised in the pthread case.

Change-Id: I3de49cfe1752eaa5f273796516e2ff6c289d9533
Reviewed-on: http://gerrit.openafs.org/2576
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agotests: Fix objdir builds
Simon Wilkinson [Fri, 17 Sep 2010 21:03:20 +0000]
tests: Fix objdir builds

Fix the tests so that they work when we have a separate build
directory.

Change-Id: I1329a4186b126c84f611c9751fd228b80c80c82c
Reviewed-on: http://gerrit.openafs.org/2828
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Add struct rx_identity
Simon Wilkinson [Wed, 15 Sep 2010 10:16:15 +0000]
rx: Add struct rx_identity

Add the rx_identity structure which can be used by rx security
layers to store and return identity information to applications.

A number of helper functions for manipulating rx_identity structures
are also provided.

Change-Id: I64ae2b62a4bc8a401c1ac877f4662c66a39247f8
Reviewed-on: http://gerrit.openafs.org/2827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Add an opaque type
Simon Wilkinson [Thu, 16 Sep 2010 11:48:41 +0000]
rx: Add an opaque type

Add a type to RX to hold counted data chunks, and some helper
functions to assist callers with using that type.

Change-Id: Ia81ceea50e43f6fba101122a085f84776dbf3807
Reviewed-on: http://gerrit.openafs.org/2826
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoLink dafssync-debug(8) to fssync-debug(8)
Russ Allbery [Wed, 22 Sep 2010 23:34:42 +0000]
Link dafssync-debug(8) to fssync-debug(8)

The two commands are documented identically for right now, so just link
the dafssync-debug man page to the fssync-debug man page.  Remove the
incorrect statement in the man page that fssync-debug only works with
demand-attach.

FIXES 128166

Change-Id: I812641ad7a345c7f5412c3c97ed1ba393e981639
Reviewed-on: http://gerrit.openafs.org/2836
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoFix POD errors in fileserver and dasalvager
Russ Allbery [Tue, 21 Sep 2010 23:45:53 +0000]
Fix POD errors in fileserver and dasalvager

Fix missing newlines before =back commands.

Change-Id: If8e65c94f48c271c37c1b4bbec1b17d383c8375d
Reviewed-on: http://gerrit.openafs.org/2831
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoUpdate bos create man page for new naming of demand-attach binaries
Russ Allbery [Tue, 21 Sep 2010 21:11:53 +0000]
Update bos create man page for new naming of demand-attach binaries

The demand-attach fileserver binaries now have a "da" prefix.  Adjust
the documentation in the man page for bos create accordingly, and add
the new binaries to SEE ALSO.

Change-Id: Ib70bad87aaf8bfc483ffbfe402db01c178e6c4e4
Reviewed-on: http://gerrit.openafs.org/2830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoauth: Add documentation for ktc_ListTokensEx
Simon Wilkinson [Sat, 11 Sep 2010 09:11:57 +0000]
auth: Add documentation for ktc_ListTokensEx

Document ktc_ListTokensEx, and add a stub implementation of the
function for Windows.

Change-Id: Ie168081f1a991fcf13358a5a1eeb8d0b96f5800a
Reviewed-on: http://gerrit.openafs.org/2825
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agohcrypto: Add dirfd definition for solaris
Simon Wilkinson [Thu, 19 Aug 2010 23:14:49 +0000]
hcrypto: Add dirfd definition for solaris

Add an implementation of dirfd to our local roken implementation for
platforms that don't have one.

Code taken from Heimdal.

Change-Id: I4284c18430b6f49200886f5340191a14dcf34b57
Reviewed-on: http://gerrit.openafs.org/2608
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdditional functionality for rxperf
Jeffrey Altman [Wed, 22 Sep 2010 23:28:48 +0000]
Additional functionality for rxperf

Add the ability to initiate multiple pthread threads issuing
calls on the same connection to the server.

Add ability to set max window size.

Add ability to adjust min peer timeout.

Change-Id: I896650b033ae0adfa42d3e5831ff799ca1331bd5
Reviewed-on: http://gerrit.openafs.org/2835
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agolibuafs: Don't #define user
Simon Wilkinson [Thu, 23 Sep 2010 07:58:21 +0000]
libuafs: Don't #define user

libuafs used to #define user to usr_user, so that any references to
'struct user' would become 'struct usr_user'. However, none of the
kernel code uses struct user, and this #define conflicts with the
definitions in sys/user.h on Linux.

So, just remove it.

Thanks to Russ Allbery for the original problem report.

Change-Id: I7868c8ddade2df626f5ecae597144641dfc551b7
Reviewed-on: http://gerrit.openafs.org/2838
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorxkad: Make the test suite build again
Simon Wilkinson [Wed, 22 Sep 2010 16:33:26 +0000]
rxkad: Make the test suite build again

Make the rxkad stress test suite build again.

Change-Id: I8ff7aecb768f0f46129f612e8bcbef20d59c8886
Reviewed-on: http://gerrit.openafs.org/2832
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorxperf: Fix so it builds on Unix
Simon Wilkinson [Wed, 22 Sep 2010 18:50:47 +0000]
rxperf: Fix so it builds on Unix

Fix assorted errors in the rxperf utility so that it will build
on Unix.

Change-Id: I8ba4e5e6bc2bab38b38f27f5fae3138a0924caa6
Reviewed-on: http://gerrit.openafs.org/2834
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agorxgen: Handle complex structures
Simon Wilkinson [Wed, 1 Sep 2010 13:38:58 +0000]
rxgen: Handle complex structures

Servers built using rxgen will break if they take complex
structures as RPC arguments. A complex structure, in this case, is
one which contains an array.

For example an RPC which takes as an argument:

struct MyData {
    opaque somebytes<>;
}

... will cause memory corruption on the server whenever it is called.

This is becase the server stubs emitted by rxgen do not zero out the
contents of the MyData structure, leaving it with whatever garbage may
be on the stack. When XDR comes to populate the somebytes opaque
array, it sees that MyData.somebytes.somebytes_val is non-zero, and
assumes that this is a pre-allocated block into which it can record
the data from the wire. However, it's really just stack garbage, and
so we overwrite memory.

As a fix, this patch creates a new list of 'complex' structures, which
are identified as structures which contain arrays. When a server stub
is created for a function that takes a complex structure, the structure
is set to zero before use, and marked to be freed afterwards.

I suspect that there may be a wider class of complex structures than are
caught by this routine, but this is a start...

Change-Id: Id671fe602c8cd44afaaccc821aaa097b142f1899
Reviewed-on: http://gerrit.openafs.org/2736
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: Change minimum peer timeout to 2ms
Jeffrey Altman [Mon, 20 Sep 2010 12:07:08 +0000]
Rx: Change minimum peer timeout to 2ms

The previous value, 350ms, is historical.  Now that networks are
so much faster, an artificially high timeout value when backed off
results in an extremely long delay before communication can resume.

Change-Id: I6207fb3e5c26a36704abc1f9210af53e0ff1fae6
Reviewed-on: http://gerrit.openafs.org/2815
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: Permit MakeDebugCall() be be compiled when RXDEBUG is undefined
Jeffrey Altman [Mon, 20 Sep 2010 17:02:18 +0000]
Rx: Permit MakeDebugCall() be be compiled when RXDEBUG is undefined

If MAKEDEBUGCALL is defined, build MakeDebugCall() even if RXDEBUG
is not defined.

Change-Id: I98d3216e8bf1e1f3b6b62c962d33db316d0f51ac
Reviewed-on: http://gerrit.openafs.org/2818
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: Do not hold call lock across memcpy in rx_ReadProc/rx_WriteProc
Jeffrey Altman [Mon, 20 Sep 2010 12:11:20 +0000]
Rx: Do not hold call lock across memcpy in rx_ReadProc/rx_WriteProc

1.4.x does not hold the call lock across memcpy operations in
rx_ReadProc, rx_ReadProc32, rx_WriteProc, rx_WriteProc32.  The
claim is that the call curpos, curlen, and nLeft fields which
refer to the current packet being processed will not be touched
by any other thread.  Therefore it is safe to drop the call lock
to permit another thread to add packets to the call while the memcpy
is performed in parallel.

This patchset continues to hold the call lock longer than the
original implementation but does drop it for the length of time
it takes to copy data from the packet buffer to the application
buffer.

Change-Id: I87dacdf541ba50db80ab55e500b38edab5126dc2
Reviewed-on: http://gerrit.openafs.org/2817
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: Permit udp buffer size to be set in rxperf
Jeffrey Altman [Mon, 20 Sep 2010 12:10:22 +0000]
Rx: Permit udp buffer size to be set in rxperf

Change-Id: I4680e038e2965ca8bc13f76955b85e924435c6af
Reviewed-on: http://gerrit.openafs.org/2816
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdd NEWS entries for OpenAFS 1.5.77 and 1.5.76
Russ Allbery [Mon, 20 Sep 2010 21:19:11 +0000]
Add NEWS entries for OpenAFS 1.5.77 and 1.5.76

Based on the public announcement for 1.5.77.

Change-Id: Ic368e16e16b03a79de6196a2e355eca0f420de77
Reviewed-on: http://gerrit.openafs.org/2819
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoWindows: Negative Caching for Volume Lookups
Jeffrey Altman [Thu, 16 Sep 2010 12:23:41 +0000]
Windows: Negative Caching for Volume Lookups

If a volume lookup returns VL_NOENT or VL_BADNAME, cache the negative
response for five minutes.  This prevents volume lookup storms caused
by the same volume lookup being performed repeated during a short
time period.  This can happen if mount points to volumes that do not
exist are present in a directory that is being evaluated by Windows
Explorer or Common Control File Dialogs.

This functionality is implemented by storing the most recent update
time for the volume group as part of the cm_volume_t.  A non-existing
volume group is identified with a new CM_VOLUMEFLAG_NOEXIST flag.
The presence of the lastUpdateTime value also permits volume location
information to expire at lastUpdateTime + lifetime instead of expiring
all volume information simultaneously each lifetime period.

LICENSE MIT

Change-Id: I01c5122a153fadc3824ff916655b0199d5c1de3c
Reviewed-on: http://gerrit.openafs.org/2771
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoMention KRB5CCNAME in the aklog man page
Russ Allbery [Tue, 14 Sep 2010 17:12:43 +0000]
Mention KRB5CCNAME in the aklog man page

AFS users not otherwise familiar with Kerberos may not realize that
one sets KRB5CCNAME to use an alternative ticket cache.  Mention the
variable in the aklog man page, although defer to the Kerberos
documentation for most details.

Change-Id: I13133285f153f86e0aa1e95b24715e01d576075d
Reviewed-on: http://gerrit.openafs.org/2761
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agoRx: Permit ADAPT_WINDOW code to build
Jeffrey Altman [Sun, 19 Sep 2010 17:46:34 +0000]
Rx: Permit ADAPT_WINDOW code to build

Add missing fields to rx data structures.

Update variable references.

Change-Id: I7f3cc5e89e71ee0a9dfc3ae8b021bec07a41ce95
Reviewed-on: http://gerrit.openafs.org/2783
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoWindows: Export additional RX debugging variables from afsrpc.dll
Jeffrey Altman [Sun, 19 Sep 2010 16:17:08 +0000]
Windows: Export additional RX debugging variables from afsrpc.dll

Export

   rxi_nRecvFrags                          @2008 DATA
   rxi_nSendFrags                          @2009 DATA
   rx_initReceiveWindow                    @2010 DATA
   rx_initSendWindow                       @2011 DATA
   rx_intentionallyDroppedPacketsPer100    @2012 DATA
   rx_intentionallyDroppedOnReadPer100     @2013 DATA

so they can be referenced from pthreaded builds of src/rx/test tools.
Exported variables must be present in both FREE and CHECKED builds.

Change-Id: Ia7f3ee0143679bab1ce74f71dc3a996cda1f18a8
Reviewed-on: http://gerrit.openafs.org/2779
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: PrintTheseStats should not be dependent on RXDEBUG
Jeffrey Altman [Sun, 19 Sep 2010 16:14:06 +0000]
Rx: PrintTheseStats should not be dependent on RXDEBUG

When RXDEBUG is not defined, PrintTheseStats generates an error
even though the statistics are in fact available.  The global
variable rx_packetTypes was not being defined without RXDEBUG.

Make rx_packetTypes defined always and permit statistics to
always be printed.

Change-Id: Ife708d34b5d56374c8aff9aa7c941d39b37ca4a1
Reviewed-on: http://gerrit.openafs.org/2778
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: move TSFPQ prototypes from rx_globals.h to rx_protoypes.h
Jeffrey Altman [Sun, 19 Sep 2010 16:08:42 +0000]
Rx: move TSFPQ prototypes from rx_globals.h to rx_protoypes.h

Function prototypes belong in rx_prototypes.h not in rx_globals.h.

Remove EXT macro from function prototypes as functions do not
require special treatment in order to be exported by a DLL on Windows.

Change-Id: Ieb617db634f2cfa57410e77e276c703311304547
Reviewed-on: http://gerrit.openafs.org/2777
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: properly compute dataPacketsReSent statistic
Jeffrey Altman [Sun, 19 Sep 2010 16:03:39 +0000]
Rx: properly compute dataPacketsReSent statistic

The global dataPacketsReSent statistic should be the sum of all
peer->reSends and dataPacketsSent should not include the count of
resent packets.  Prior to this patchset, dataPacketsSent included
the resent packets and dataPacketsReSent was computed as the number
of requests for Ack instead of the number of packets resent.

Change-Id: I969003f7ec1805d09c14ac342453f86fdb5df99a
Reviewed-on: http://gerrit.openafs.org/2776
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: always use tservice variable in rxi_ServerProc
Jeffrey Altman [Sun, 19 Sep 2010 16:00:57 +0000]
Rx: always use tservice variable in rxi_ServerProc

Since tservice has been assigned to call->conn->service,
use it instead of call->conn->service when calling
executeRequestProc(call)

Change-Id: Id26c4c63f054bcd1e3ef5349900c910e3c9cf2be
Reviewed-on: http://gerrit.openafs.org/2775
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoWindows: Release builds of Rx should be lean and mean
Jeffrey Altman [Sun, 19 Sep 2010 15:57:02 +0000]
Windows: Release builds of Rx should be lean and mean

Only build checked builds of Rx with
-DRXDEBUG -DRXDEBUG_PACKET -DRX_TRACK_PACKETS -DRX_REFCOUNT_CHECK

Change-Id: Ib4666d30b1e48eca172331353d9e376b2516f183
Reviewed-on: http://gerrit.openafs.org/2774
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: Only backoff the peer timeout once
Jeffrey Altman [Mon, 20 Sep 2010 02:48:57 +0000]
Rx: Only backoff the peer timeout once

If a packet is missing, the peer timeout is backed off to provide
a new starting point for timeout computation.  The backoff state
must be stored in the peer object to ensure that multiple failures
do not result in more than one backoff before a successfully received
packet is available for recomputation.

Change-Id: I6794b3a020801ff421e4ed776afb581962b111a9
Reviewed-on: http://gerrit.openafs.org/2787
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: only compute peer bytes sent and received if rx_stats_active
Jeffrey Altman [Sun, 19 Sep 2010 16:47:37 +0000]
Rx: only compute peer bytes sent and received if rx_stats_active

Computing the bytes sent and received is an expensive operation.
If rx statistics collection has been disabled we should not collect
the peer data.  The most expensive operation is the rx_FindPeer()
call that is performed during rxi_ReadPacket().  rxi_ReadPacket()
is processed by the rx listener thread which must be as fast as
possible.

Change-Id: I5403c88aa85f9049fe50a9c1f3dbaad7d8b802bd
Reviewed-on: http://gerrit.openafs.org/2782
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: avoid lock churn in rxi_ReceiveAckPacket
Jeffrey Altman [Sun, 19 Sep 2010 16:35:03 +0000]
Rx: avoid lock churn in rxi_ReceiveAckPacket

rxi_ReceiveAckPacket can acquire and drop the conn_data_lock several
times and acquires and drops the peer_lock unnecessarily.  This patchset
adds a variable to track whether the conn_data_lock is held in order
to avoid the need to drop it and reacquire it based upon conditional
operations.  It also relocates the peer->maxPacketSize computations
in order to consolidate the work performed under the peer_lock.

Change-Id: I0bc9e42e8ef198a04315f9f2df529073ce9dfd03
Reviewed-on: http://gerrit.openafs.org/2781
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: Build rxperf test application on Windows
Jeffrey Altman [Sun, 19 Sep 2010 15:28:21 +0000]
Rx: Build rxperf test application on Windows

rxperf made assumptions that it was built against LWP, used buffer
sizes for read/write that were too small, made use of non-portable
types, and set signal handlers that are unsupported.

Change-Id: I55515cac0f441116df7fd0aaf100fb3ae99b220f
Reviewed-on: http://gerrit.openafs.org/2773
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoviced: Don't fall back to tokens
Simon Wilkinson [Sat, 11 Sep 2010 22:17:24 +0000]
viced: Don't fall back to tokens

I can't think of any circumstances in which it is appropriate for
the fileserver to fallback to using tokens from the kernel, rather than
those generated from keys on disk. So, remove that fallback.

Change-Id: I92b8987ce63759234d238812a8fe998daed4c20f
Reviewed-on: http://gerrit.openafs.org/2758
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoubik: Remove unused error codes
Simon Wilkinson [Sat, 11 Sep 2010 07:21:10 +0000]
ubik: Remove unused error codes

The error codes in ubik.p.h have been replaced by ones defined by
com_err. Remove the redundant, #if 0, definitions of these, as they're
just confusing when grepping the code.

Change-Id: I18b827a6e0532a602f904bb6c1e34c3f63c2e08d
Reviewed-on: http://gerrit.openafs.org/2757
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorxgen, kauth: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 17:19:47 +0000]
rxgen, kauth: Set but not used variables

Remove a few variables that are not actually used, and the
associated code.

foundcurrentkey is only used in the AUTH_DBM_LOG case, so
scope the declaration and assignment accordingly.

Spotted by gcc 4.6

Change-Id: I281ca37488e69bfe46a8e63bdc5990f5f3cff940
Reviewed-on: http://gerrit.openafs.org/2734
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoptserver: Merge WhoIsThis and WhoIsThisWithName
Simon Wilkinson [Sat, 11 Sep 2010 19:49:55 +0000]
ptserver: Merge WhoIsThis and WhoIsThisWithName

The functions WhoIsThis and WhoIsThisWithName are pretty much identical,
with WhoIsThisWithName just having additional logic for foreign user
registration. Merge them together, so that there's only one copy of
the code for determining who a user is.

Change-Id: Ia6e62ae932219f29e3141fe3c94b4be0110ca17a
Reviewed-on: http://gerrit.openafs.org/2756
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoAdd additional dependencies for shlibafsrpc
Simon Wilkinson [Sun, 12 Sep 2010 17:41:21 +0000]
Add additional dependencies for shlibafsrpc

fsint and rxstat need to be build before shlibafsrpc, so add them
to the dependencies list.

Change-Id: I47b551de13f6f860cee9f6c09a769de472b3ec3f
Reviewed-on: http://gerrit.openafs.org/2755
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agouserok: Don't double check for expiry
Simon Wilkinson [Mon, 13 Sep 2010 07:54:55 +0000]
userok: Don't double check for expiry

rxkad_GetServerInfo returns an error if you attempt to get server
information using a connection whose tokens have already expired.

The additional check for expiry in the userOK routines is therefore
not required - they'll never be reached, because GetServerInfo will
already have errored out.

Change-Id: I7b1a97249d40b12a2aae4009971a9b676700870e
Reviewed-on: http://gerrit.openafs.org/2753
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoauth: Restructure userok
Simon Wilkinson [Sat, 11 Sep 2010 15:39:23 +0000]
auth: Restructure userok

Restructure the userok logic in auth to split it into smaller functions,
and abstract out common code. This will make it easier to add support
for other security layers in future commits.

Change-Id: I64f6e053ad1a6a2054630a400f7499d805bb9838
Reviewed-on: http://gerrit.openafs.org/2752
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Call rxgen_consts.h by its proper name
Simon Wilkinson [Sat, 11 Sep 2010 11:51:52 +0000]
rx: Call rxgen_consts.h by its proper name

rxgen_consts.h is actually in the afs/ directory. Include it from
their, rather than requiring that every user have $(TOP_INCDIR)/afs
in their search path.

Change-Id: Ia3faf4c08bd69cb64652b8c1ab722c49179667c8
Reviewed-on: http://gerrit.openafs.org/2750
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agotokens: Use the new tokens interface
Simon Wilkinson [Sat, 11 Sep 2010 09:17:12 +0000]
tokens: Use the new tokens interface

Change tokens so that it will use the new tokens interface.

Note that this changes the output from the tokens command.

Change-Id: If15d7d439b86a89afcafafe65d304324a186b8d3
Reviewed-on: http://gerrit.openafs.org/2749
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoauth: Add the ktc_ListTokensEx function
Simon Wilkinson [Sat, 11 Sep 2010 09:11:57 +0000]
auth: Add the ktc_ListTokensEx function

Add a ktc_ListTokensEx function which uses the new GetToken pioctl
to implement the same functionality as the old ktc_ListTokens call.

As with ktc_ListTokens this is hugely inefficient, as it gets a
compelete token structure from the kernel, then throws it away to
return just the cell which the token is for.

Change-Id: Idf3daa536c6a04d397691d0cc6fcb2c59f9f444c
Reviewed-on: http://gerrit.openafs.org/2748
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>