openafs.git
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>

13 years agoRx: Move rxperf test application to src/rx/tests
Jeffrey Altman [Sun, 19 Sep 2010 15:03:50 +0000]
Rx: Move rxperf test application to src/rx/tests

rxperf is a test application.  Move it to the tests directory

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

13 years agoRx: cleanup testclient and testserver test applications
Jeffrey Altman [Sun, 19 Sep 2010 16:20:01 +0000]
Rx: cleanup testclient and testserver test applications

Permit testclient and testserver to be built on Windows as
pthreaded applications.

Remove warnings.  Fix prototypes.  Remove variable declarations
for rx library variables defined in rx_globals.h.

Increase the buffer sizes.  Disable use of packet dropping when
the library is built without RXDEBUG.

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

13 years agoauthcon: Use ktc_GetTokenEx in ClientAuthToken
Simon Wilkinson [Wed, 8 Sep 2010 07:12:41 +0000]
authcon: Use ktc_GetTokenEx in ClientAuthToken

Use ktc_GetTokenEx, and the related token utilities to check for a
users tokens, rather than using the legacy ktc_GetToken

Export the necessary symbols from libafsauthent on Windows to be able
to do this.

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

13 years agoWindows: Add new token interface with stub for ktc_GetTokenEx
Jeffrey Altman [Thu, 16 Sep 2010 00:48:30 +0000]
Windows: Add new token interface with stub for ktc_GetTokenEx

The Windows build was broken by the addition of dependencies on
token_FreeSet, ktc_GetTokenEx, etc.   Permit the build to continue.
The ktc_GetTokenEx implementation will depend on the creation of
a new Windows pioctl for the call.

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

13 years agoRename kauth/token.c as kauth/katoken.c
Simon Wilkinson [Thu, 16 Sep 2010 06:09:20 +0000]
Rename kauth/token.c as kauth/katoken.c

The kauth 'token.c' collides with the same file in auth when doing
Windows builds. As kauth is the legacy package, rename its source
file, and update the build system to take account of this.

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

13 years agoRX: Make rxi_Alloc return (void *)
Simon Wilkinson [Sat, 4 Sep 2010 14:29:03 +0000]
RX: Make rxi_Alloc return (void *)

rxi_Alloc returns a pointer to an anonymous data block. Make its
return value (void *) rather than (char *), so that it can be
called in the same way as malloc(), and not require casting.

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

13 years agoLinux: print after BUG() is pretty useless
Simon Wilkinson [Sun, 12 Sep 2010 11:07:59 +0000]
Linux: print after BUG() is pretty useless

Calling BUG() panics the machine, so having a print statement with
further debugging information after it doesn't help much.

Swap the ordering, so we at least see the message.

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

13 years agovolser: Delete timed-out temporary volumes
Andrew Deason [Tue, 14 Sep 2010 16:15:22 +0000]
volser: Delete timed-out temporary volumes

When a transaction times out on a volume, delete the volume if it is a
temporary volume (destroyMe is set). This prevents half-created
volumes from accumulating, which can take up space and screw up
certain vol ops in some versions.

Change-Id: I94e9adc767b84a2a32d980f508af33b823560950
Reviewed-on: http://gerrit.openafs.org/2760
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agolibafs: Fix pioctl get/putInt alignment issues
Andrew Deason [Wed, 15 Sep 2010 16:19:33 +0000]
libafs: Fix pioctl get/putInt alignment issues

We don't know if the buffer for pioctl data is aligned to anything, so
we can't just dereference the given pointer as an int or anything
else. So, just memcpy the data in for ints and such; conveniently,
afs_pd_getBytes and afs_pd_putBytes can do this for us, so just use
that.

Change-Id: Id1abdae55308db6fe1e13f541a5d776daa6af934
Reviewed-on: http://gerrit.openafs.org/2763
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agovlserver: Set but not used variables
Marc Dionne [Fri, 10 Sep 2010 23:55:39 +0000]
vlserver: Set but not used variables

Remove some variables that are set but never used in the vlserver
directory:
- n1,n2,n3 and n4 in vlclient.c appear to have never been used even
in the original IBM code
- some variables in vldb_check.c that are no longer used after some
recent changes

Spotted by gcc 4.6

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

13 years agobutc: Set but unused variables
Marc Dionne [Sat, 11 Sep 2010 17:23:11 +0000]
butc: Set but unused variables

Remove unused variable taskId

writeData() systematically returns 0, so make it void and adapt
call sites that assigned the return value but never used it.
Also move the function up in the file to avoid the need for a
forward declaration, and make it static since it's only used here.

Spotted by gcc 4.6

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

13 years agolibafs: Fix compile errors in afs_nfsclnt.c
Andrew Deason [Wed, 15 Sep 2010 18:40:19 +0000]
libafs: Fix compile errors in afs_nfsclnt.c

 - tokenUnion is a union, not a struct

 - 'struct rxkadToken' typo

 - 'tokenPtr' not 'tokenptr'

Change-Id: I7e0fa4f2d34ba4bd68345e9625f40d1d7301411e
Reviewed-on: http://gerrit.openafs.org/2764
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agovol: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 16:14:09 +0000]
vol: Set but not used variables

Fix some set but unused variable warnings in the vol directory.

In VDetachVolume_r, much of the code and variables are only
useful in the FSSYNC_BUILD_CLIENT case.  Scope the code
accordingly.

forcefree is only used in the AFS_DEMAND_ATTACH_FS case, so
scope code that sets it accordingly.

Spotted by gcc 4.6

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

13 years agoLinux: normalize error return for emulated syscalls
Marc Dionne [Thu, 1 Jul 2010 15:38:20 +0000]
Linux: normalize error return for emulated syscalls

pagsh and other code expect setpag() and pioctl() to behave like
a regular syscall or pioctl, that is to return -1 on error, with
errno set to the specific error code.
On Linux, the underlying emulation does a straight return of any
error code it gets from the ioctl, and errors are not properly
caught by the callers.

As an example, pagsh won't detect an error from setpag such as
exceeding a keyring quota limit.  With this patch, the user
will see this:

$ pagsh
setpag: Disk quota exceeded
sh-4.1$

The code in proc_afs_syscall is modified to set errno to the error
code and to set errorcode to -1 in case of error.

proc_afs_sycall is reindented while we're changing code there.

FIXES 126230

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

13 years agodisable Rx packet tracking
Derrick Brashear [Wed, 15 Sep 2010 08:26:13 +0000]
disable Rx packet tracking

minimize the impact of Rx packet tracking. in particular, do no
extra queue scans, which means the rest of the state which tracks
where a packet is now isn't of use. make it possible to re-enable.

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

13 years agoAutomatically find all pod.in files and generate .pods files
Steve Simmons [Sat, 4 Sep 2010 16:14:17 +0000]
Automatically find all pod.in files and generate .pods files

Change-Id: I9334ed4fde8df63f278b6ef07bc0eddebfc71bf0
Reviewed-on: http://gerrit.openafs.org/2720
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoDAFS: raise vhashsize limit
Andrew Deason [Wed, 8 Sep 2010 19:32:35 +0000]
DAFS: raise vhashsize limit

Raise the maximum specifiable vhashsize to 28 (from 14). Specifying a
vhashsize over 14 can be reasonable if you expect to have a few
million volumes on a fileserver.

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

13 years agoDAFS: Do not ignore out-of-range -vhashsize
Andrew Deason [Thu, 2 Sep 2010 17:56:28 +0000]
DAFS: Do not ignore out-of-range -vhashsize

If the specified -vhashsize is out of the 6-14 range, do not just
ignore it. Instead, note the error and quit.

Change-Id: I2a26443bbd3a91183435a26562bea48b8b6a1eda
Reviewed-on: http://gerrit.openafs.org/2649
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoAlways check return code from iod_Write
Marc Dionne [Sat, 11 Sep 2010 14:46:50 +0000]
Always check return code from iod_Write

The return code from iod_Write is checked at every call site
in the file, except this one.  Check it, and return VOLSERDUMPERROR
if appropriate.

Spotted by a set but unused warning from gcc 4.6

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

13 years agorx: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 18:57:17 +0000]
rx: Set but not used variables

Remove some unused variables in the rx code.
These generate warnings with gcc 4.6.

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

13 years agoauth: Make token_FreeSet work on an empty set
Simon Wilkinson [Sat, 11 Sep 2010 22:14:42 +0000]
auth: Make token_FreeSet work on an empty set

If the set passed to token_FreeSet is already freed, just
make the funciton a no-op, rather than segfaulting.

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

13 years agoLinux: Move keyring includes where they're needed
Simon Wilkinson [Sat, 11 Sep 2010 11:43:35 +0000]
Linux: Move keyring includes where they're needed

We don't need the keyring headers in every file, so reduce
namespace pollution by just including them in osi_groups.c, which is
the only place that uses them.

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

13 years agoshlibafsrpc: Export additional symbols
Simon Wilkinson [Thu, 9 Sep 2010 08:14:30 +0000]
shlibafsrpc: Export additional symbols

Export additional symbols from shlibafsrpc. These symbols are required
in order to be able to produce dynamically linked security modules that
interface with libafsrpc.

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

13 years agoIgnore *.dSYM files in working directory
Simon Wilkinson [Wed, 8 Sep 2010 07:24:55 +0000]
Ignore *.dSYM files in working directory

Failed Mac OS X debugging builds leave *.dSYM directories lying
around the tree, which just litter the contents of "git status".

So, ignore them.

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

13 years agoAdd config.log to gitignore globally
Simon Wilkinson [Wed, 8 Sep 2010 07:22:57 +0000]
Add config.log to gitignore globally

When you end up explicitly regenerating chosen Makefiles by
running ../../config.status Makefile, the working tree ends up littered
with config.log files.

Currently, we only ignore config.log in the top directory - extend this
so that it's ignored across the tree.

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

13 years agoauth: Add a gitignore file for the test directory
Simon Wilkinson [Wed, 8 Sep 2010 07:31:02 +0000]
auth: Add a gitignore file for the test directory

The auth/test directory is optionally built, and so had missed getting
a .gitignore file. Add one now.

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

13 years agopam: Remove unused library definitions
Simon Wilkinson [Thu, 9 Sep 2010 08:04:21 +0000]
pam: Remove unused library definitions

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

13 years agoaklog: Fix some format warnings
Simon Wilkinson [Mon, 6 Sep 2010 08:38:47 +0000]
aklog: Fix some format warnings

Fix some format warnings (size_t vs int) which only appear when we're
building with Heimdal.

Change-Id: I7313ea1a7e01532b11fc6039a8a56e0fd874c347
Reviewed-on: http://gerrit.openafs.org/2740
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoaklog: Fix weak_crypto tests
Simon Wilkinson [Mon, 6 Sep 2010 08:37:23 +0000]
aklog: Fix weak_crypto tests

The tests for the various ways of enabling weak cryptography fail
with current Heimdal master, because it defines krb5_allow_weak_crypto
but does not prototype it.

Fix this by testing for the Heimdal version (which MIT does not provide)
first, and only if that's not available, try to use allow_weak_crypto.

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

13 years agoRX: Make the sample client and server build
Simon Wilkinson [Wed, 1 Sep 2010 10:09:46 +0000]
RX: Make the sample client and server build

Make the RX sample client and server build again

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