openafs.git
10 years agorxosd: allow parallel make
Marc Dionne [Fri, 29 Oct 2010 20:09:45 +0000]
rxosd: allow parallel make

Build rules that use COMPILE_PART1 must be prefixed with +
to indicate to make that the subprocess is a make and that it
can run with parallel jobs.

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

10 years agoFix fs bypassthreshold to accept a size of -1 to disable
Phillip Moore [Tue, 19 Oct 2010 16:17:20 +0000]
Fix fs bypassthreshold to accept a size of -1 to disable

The fs bypassthreshold command assumes a value of -1 means the feature
is disabled, but the CLI refused to accept this argument, since it is
not strictly a digit (according ti isdigit()).  This patch accepts the
string -1, and makes it possible to both enable AND disable this
feature.

Change-Id: I87720b2dcfc4e9ee9f322c4841836b74440ac442
Reviewed-on: http://gerrit.openafs.org/3009
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agofs getfid defaults to '.', like other path-related commands
Phillip Moore [Tue, 19 Oct 2010 15:31:47 +0000]
fs getfid defaults to '.', like other path-related commands

I noticed that all of the other commands that accept a list of paths
use the SetDotDefault() function to default to ".", when no arguments
are given.  This patch adds that call to getfid, making it more
consistent with similar commands.

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

10 years agofs getfid output changed for consistency with Windows implementation
Phillip Moore [Tue, 19 Oct 2010 15:23:46 +0000]
fs getfid output changed for consistency with Windows implementation

This patch removes the redundant volume ID from the output of fs
getfid, and replaces it with the cell name, which is what the Windows
implementation provides.

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

10 years agoMakes fs getfid error handling consistent with other fs commands
Phillip Moore [Tue, 19 Oct 2010 12:24:41 +0000]
Makes fs getfid error handling consistent with other fs commands

This patch makes the fs getfid command print errors for paths that
can't be handled correctly, instead of quietly ignoring them, and it
also returns an error code if any such paths are encountered.  This
makes the behavior consistent with other fs commands, such as
listquota, whereis, etc.

FIXES 128372

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

10 years agoQuickStart Unix: use dafs type and name for demand attach file services
Rod Widdowson [Fri, 29 Oct 2010 18:57:50 +0000]
QuickStart Unix: use dafs type and name for demand attach file services

bos create <machine name> dafs dafs [...] (not fs).

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

10 years agoFBSD: correct and simplify vcache eviction routines
Ben Kaduk [Fri, 29 Oct 2010 07:18:02 +0000]
FBSD: correct and simplify vcache eviction routines

osi_VM_FlushVCache and osi_TryEvictVCache were both attempting
to be wrappers around vgone(), with some checks before hand.
Implement the latter in terms of the former to prevent
code duplication and propagation of incorrect code.

Additionally, correct the locking around vgone().  The
vnode lock must be held, and we must also increase the vnode's
hold count so that it does not disappear out from under us.
As we need the interlock to check the usecount, keep it
locked until we lock the vnode lock, for extra protection.

As an added bonus, we no longer try to call vgonel(), which
is not an exported symbol and merely happened to work due
to the current kernel linker implementation.

Remove some stale comments.

With this change, a parallel buildworld completes on
my four-core machine.

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

10 years agoFBSD: lock interlock around v_usecount accesses
Ben Kaduk [Fri, 29 Oct 2010 16:01:04 +0000]
FBSD: lock interlock around v_usecount accesses

The FreeBSD vnode locking strategy requires that the vnode
interlock be held for all accesses to v_usecount, such as those
used by our VREFCOUNT and VREFCOUNT_GT macros.  Conveniently,
a wrapper function is provided that takes the lock around its
access of the element, vrefcnt().  Use it for our macros.

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

10 years agoRPM scripts should allow newbinary restart to restart
Derrick Brashear [Wed, 27 Oct 2010 00:13:38 +0000]
RPM scripts should allow newbinary restart to restart

add a mode where a newbinary restart can be used instead of
condrestart to induce a restart.

also, on upgrade, don't turn on the server RC script if it was
previously manually disabled.

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

10 years agoafs: clean afs_osi_Alloc() usage
Chas Williams (CONTRACTOR) [Tue, 19 Oct 2010 18:50:35 +0000]
afs: clean afs_osi_Alloc() usage

Add asserts for any failures cases not explicitly handled and remove
any casting.

Change-Id: I282d917ab84b37012553233f2c913b2aef1c92e2
Reviewed-on: http://gerrit.openafs.org/3012
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

10 years agoafs: simplify afs_osi_alloc.c
Chas Williams (CONTRACTOR) [Tue, 19 Oct 2010 16:30:02 +0000]
afs: simplify afs_osi_alloc.c

remove the osimem struct and related casts

Change-Id: I25c6b0101ce0ec03c9930ab79c05190defb1529d
Reviewed-on: http://gerrit.openafs.org/3011
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

10 years agoafs: afs_osi_Alloc_NoSleep() cleanup
Chas Williams (CONTRACTOR) [Tue, 19 Oct 2010 16:19:16 +0000]
afs: afs_osi_Alloc_NoSleep() cleanup

afs_osi_Alloc_NoSleep() is no longer used by the SOLARIS or IRIX
clients.  It is used by the *BSD code in rx, so just let those
platforms define/prototype it in their osi_machdep.h

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

10 years agoWhat the cache manager needs to know about rxosd
Hartmut Reuter [Tue, 26 Oct 2010 18:43:59 +0000]
What the cache manager needs to know about rxosd

this patch contains only the RPC interface to rxosd which already
contains the definition of all RPCs not just those few used in the
cache manager.

The code which calls these RPCs will follow in subesquent patches.

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

10 years agowindows: terminate multi_sz correctly
Rod Widdowson [Fri, 29 Oct 2010 17:01:13 +0000]
windows: terminate multi_sz correctly

CreateProcess requires a null-terminated list of null-terminated strings
as an environment parameter.

A missing level of indirection was causing the final null to be
missed, meaning that if bosserver ran from somewhere which had an
environment the create process would fail.

Fix the null termination.

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

10 years agoWindows: Finish converting vol apps to pthread only
Jeffrey Altman [Thu, 28 Oct 2010 05:19:17 +0000]
Windows: Finish converting vol apps to pthread only

The src/vol directory on Windows is one of the rare examples
where a single directory builds both lwp and pthreaded versions
of libraries and executables.  With this patchset the executables
are fully converted from lwp to pthread.  This requires that
afsrpc.dll include the pthread implementations of the threadname,
fasttime, and lock implementations from the LWP directory.
The inclusion within afsrpc.dll permits the dviced and
dvolser directories to avoid rebuilding those object modules.

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

10 years agowindows: native versions of ih_pread and ih_pwrite
Rod Widdowson [Wed, 27 Oct 2010 22:20:30 +0000]
windows: native versions of ih_pread and ih_pwrite

Separate the windows code out in ihandle.c to reduce dependency on ntops.

As an aid to future threading issues, pass the offset in an OVERLAP
rather than doing a separate SetFilePointerEx.

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

10 years agovol: Use OSI_NULLSOCKET and not -1 to indicate invalid fssync fd
Jeffrey Altman [Thu, 28 Oct 2010 04:43:26 +0000]
vol: Use OSI_NULLSOCKET and not -1 to indicate invalid fssync fd

The FSync file descriptor is an osi_socket which has an invalid
value of OSI_NULLSOCKET which is not necessarily -1.  Be sure to
compare against OSI_NULLSOCKET and not -1 when checking an invalid
value.

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

10 years agovol: Always use INVALID_FD to indicate an invalid fd
Jeffrey Altman [Thu, 28 Oct 2010 04:40:32 +0000]
vol: Always use INVALID_FD to indicate an invalid fd

file descriptors on Windows are not ints and therefore
cannot be safely compared against -1.  Always use INVALID_FD
which is -1 on UNIX and INVALID_HANDLE_VALUE on Windows.

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

10 years agoImport: Add roken files from heimdal
Simon Wilkinson [Wed, 27 Oct 2010 20:26:19 +0000]
Import: Add roken files from heimdal

Add the necessary files to our import list such that roken can be
built as a standalone library.

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

10 years agoshlib-build: Add ignore option
Simon Wilkinson [Fri, 29 Oct 2010 11:40:31 +0000]
shlib-build: Add ignore option

Add an option to shlib-build to ignore missing symbols in the map file.
This is already the default on some platforms, but others (such as
Darwin) require that all symbols in the mapfile be present in the
objects. This is a pain for libraries such as libroken, which will
have different symbols on different platforms.

Specifying -i adds the necessary magic to Darwin's ld to relax this
check. Changes may also be necessary for other platforms, but I
don't currently have those available for testing.

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

10 years agoubik: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 17:06:26 +0000]
ubik: Set but not used variables

Fix warnings, remove unused variables and code.

Spotted by gcc 4.6

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

10 years agobucoord: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 17:39:00 +0000]
bucoord: Set but not used variables

Remove unused variables

Spotted by gcc 4.6

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

10 years agoxstat: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 17:49:49 +0000]
xstat: Set but not used variables

Remove unused variables.

Spotted by gcc 4.6

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

10 years agoFBSD: fix dumb panic when we can't pfind rxk_Listener
Ben Kaduk [Fri, 29 Oct 2010 02:45:33 +0000]
FBSD: fix dumb panic when we can't pfind rxk_Listener

The process is only returned locked if the process is found.
Don't try to unlock it if it's not found.

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

10 years agoexplain yacc build product dependency so it is not removed
Derrick Brashear [Tue, 26 Oct 2010 13:41:47 +0000]
explain yacc build product dependency so it is not removed

in order that our .c.o rule applies, force yacc source to
not be built directly into an object.

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

10 years agobucoord: parallel make fix
Marc Dionne [Wed, 27 Oct 2010 00:33:41 +0000]
bucoord: parallel make fix

Fix an instance of a Makefile rule with multiple targets.
This can cause a parallel make to fail when two instances of
compile_et compete to write the same output files.

Spotted by a build failure with a corrupt bc.h header.

Change-Id: I4adee125a82d640bc78f15c77494a22157cf7f5d
Reviewed-on: http://gerrit.openafs.org/3165
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoWindows: fix built in touch
Rod Widdowson [Thu, 28 Oct 2010 17:34:41 +0000]
Windows:  fix built in touch

Recent versions of windows add a whole bunch of attributes above
A_ARCH.  (FILE_ATTRIBUTE_NOT_CONTENT_INDEXED was what bit be but
encryption of compression would do it).

This makes ~_A_ARCH not a good choice for testing nonwritability
of a file - so files with these new attributes just get silently ignored.

Using an explicit mask is much better.  So do that.

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

10 years agowindows: preserve lasterror prior to calling free
Rod Widdowson [Wed, 27 Oct 2010 19:08:28 +0000]
windows: preserve lasterror prior to calling free

free() destroys GetLastError, so preserve it before giving back all the
buffers.  Then if the create process failed we have something sensible to
log.

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

10 years agodon't duplicate work of ctime_s
Jeffrey Altman [Wed, 27 Oct 2010 18:25:10 +0000]
don't duplicate work of ctime_s

on windows we use ctime_s for ctim'ing to a buffer. except we
allocate an extra buffer. "uh"

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

10 years agoviced don't double-print start time
Derrick Brashear [Wed, 27 Oct 2010 18:18:28 +0000]
viced don't double-print start time

side effect: remove the version which breaks on 64 bit windows

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

10 years agoImport of code from heimdal
Heimdal Developers [Sun, 24 Oct 2010 10:56:07 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
a3afa695ee3eb1ff5ad8de3e80c20d5049fce934 (switch-from-svn-to-git-1619-ga3afa69)

Upstream changes are:

Chas Williams (CONTRACTOR) (1):
      hcrypto: struct x64 doesn't need bitfields

Love Hornquist Astrand (1):
      Switch to ULL

Simon Wilkinson (1):
      hcrypto: Flag 64bit bit constants as long long

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

10 years agoImprove commit messages for git imports
Simon Wilkinson [Sun, 24 Oct 2010 10:50:25 +0000]
Improve commit messages for git imports

Improve the quality of the commit messages produced by git import
by adding an explicit author (obtained from the $module-author file),
and by including a list of all of the upstream changes that are being
imported.

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

10 years agodown with assert, up with osi_Assert
Derrick Brashear [Mon, 18 Oct 2010 03:39:47 +0000]
down with assert, up with osi_Assert

because NDEBUG breaks things which happen inside an assert,
be done with that. instead, call osi_Assert wherever possible.
doesn't work for code which builds before rx; those cases we handle
by ensuring no operations happen inside the assert(). side effect:
move all pthread operations wrapped in asserts to MUTEX_mumble and
CV_mumble calls where those exist, so the assertions happen all in
one set of macroes.

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

10 years agoQuickstart Guide: misc. fixes
Jason Edgecombe [Wed, 27 Oct 2010 00:32:04 +0000]
Quickstart Guide: misc. fixes

  * The update server is optional
  * Only worry about fsck when using inode-based storage
  * Add a space where needed

Change-Id: Idacd220139f2b5c622831004cb38bf5f8a1dafc5
Reviewed-on: http://gerrit.openafs.org/3164
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jason Edgecombe <jason@rampaginggeek.com>

10 years agokill defunct tools directory
Derrick Brashear [Tue, 26 Oct 2010 23:10:57 +0000]
kill defunct tools directory

the "old" rpm building tools are so sad as to be useless.
put them out of their misery.

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

10 years agoWindows: 1.5.78 Change Log summary
Jeffrey Altman [Tue, 26 Oct 2010 23:02:31 +0000]
Windows: 1.5.78 Change Log summary

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

10 years agoQuickstart guide: use yum install from openafs repo
Jason Edgecombe [Tue, 26 Oct 2010 19:06:28 +0000]
Quickstart guide: use yum install from openafs repo

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

10 years agoWindows: Fix math error in rx_Writev processing
Jeffrey Altman [Tue, 26 Oct 2010 03:05:00 +0000]
Windows: Fix math error in rx_Writev processing

LICENSE MIT

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

10 years agorx: Don't let timeouts force fast recovery
Simon Wilkinson [Mon, 25 Oct 2010 09:14:12 +0000]
rx: Don't let timeouts force fast recovery

The current RX implementation goes into fast recovery whenever a
timeout occurs. This is incredibly wasteful, particularly on fast
connections. So, remove this in favour of TCP style behaviour.

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

10 years agorx: Fix starting of transmit timers
Simon Wilkinson [Mon, 25 Oct 2010 19:50:29 +0000]
rx: Fix starting of transmit timers

The code used to start the transmit timer once for every set of packets
that it sends. However, these packets might be sent individually or in
clumps, with blocking for sendmsg, and on peer->lock, between each set
of packet sends. This has the effect of, even on a very stable network,
producing a high degree of variation in RTTs and timeouts. This is a
particular issue where the connection size is larger, as the number of
packets being sent individually under the one timer grows too.

Fix this by moving timer initialisation to SendList. This already takes
the peer lock, so obtain the timeout value here too. This means that
each jumbo gram, or individual packet (where jumbograms are disabled)
is sent with its own start time, and stabilises RTTs.

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

10 years agorx: Refactor transmit queue wakeup
Simon Wilkinson [Mon, 25 Oct 2010 08:52:10 +0000]
rx: Refactor transmit queue wakeup

Refactor all of the places where we wake up the transmit queue into
a common helper function.

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

10 years agorx: Fix resend accounting
Simon Wilkinson [Mon, 25 Oct 2010 08:16:09 +0000]
rx: Fix resend accounting

rxi_Start flagged itself as 'resending' whenever it flushed the
transmit queue due to a resend event. However, it would flush the
entire transmit queue at this point, rather than only transmitting
packets that require a resend. When running with large window sizes
this results an a large number of packets erroneously being marked
as resent.

Instead, let SendXmitList decide whether a packet is being
retransmitted by using the presence of a serial number. This takes
advantage of the fact that a retransmitted packet must be the only
entry in a packet list - we just flag the packet list, instead of
having to maintain counters for each individual packet.

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

10 years agorx: Use a structure for the xmit list
Simon Wilkinson [Mon, 25 Oct 2010 08:06:53 +0000]
rx: Use a structure for the xmit list

Switch to using a structure to hold the xmit list so that it's a
little bit clearer what the rxi_SendXmitList function is actually doing

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

10 years agoWindows: move debug break in afsd_notifier
Jeffrey Altman [Tue, 26 Oct 2010 02:58:51 +0000]
Windows: move debug break in afsd_notifier

move the debug break before the cache dump occurs
so that a debugger will be signalled faster when
a panic condition occurs.

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

10 years agoFBSD: band-aid vnode locking in lookup
Ben Kaduk [Sun, 24 Oct 2010 04:29:07 +0000]
FBSD: band-aid vnode locking in lookup

The lock order requires that we acquire vnode locks from the root
towards the leaf.  When looking up "..", this requires that we
unlock the directory before locking the child, otherwise we
are susceptible to deadlock.
This is only a band-aid, as afs_vop_lookup should be rewritten.

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

10 years agoFix build on systems with .y.o rules
Ben Kaduk [Tue, 26 Oct 2010 02:15:49 +0000]
Fix build on systems with .y.o rules

On systems with system .y.o rules (such as FreeBSD), the system
rule for making error_table.o from error_table.y can bypass
AFS_CCRULE and thus fail to pull in the necessary include paths
for compilation.  Present an explicit dependency on error_table.c
to force that file to be generated, and then our .c.o rule gets
used as desired.

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

10 years agoComplete change from dcb40c9fb8 for FBSD
Ben Kaduk [Tue, 26 Oct 2010 04:17:11 +0000]
Complete change from dcb40c9fb8 for FBSD

Many conditionals involving osi_fsplock were changed to depend
on AFS_PRIVATE_OSI_ALLOCSPACES instead of constants or other
things (like AFS_FBSD_ENV).  The condition on the initializaion
in afs_init was changed but not the declaration in afs_prototypes.h,
breaking the build on FBSD.
Use the same conditional in afs_prototypes.h, fixing the FBSD build.

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

10 years agoWindows: Add version number to event log start pending message
Jeffrey Altman [Sun, 24 Oct 2010 04:21:26 +0000]
Windows: Add version number to event log start pending message

LICENSE MIT

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

10 years agoWindows: register idle dead timeout error
Jeffrey Altman [Mon, 14 Jun 2010 13:43:31 +0000]
Windows: register idle dead timeout error

be like the unix cache manager and set an error code
so idle dead time is enforced on sending.

LICENSE MIT

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

10 years agoWindows: Backup and restore configuration across installs
Asanka C. Herath [Mon, 18 Oct 2010 08:52:34 +0000]
Windows: Backup and restore configuration across installs

The MSI installer for OpenAFS does not preserve configuration data
across installs.  This patch creates a backup of specific
configuration registry values when uninstalling OpenAFS and uses this
backup when subsequently installing OpenAFS.

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

10 years agoWindows: Make Rx PMTU discovery configurable; disable by default
Jeffrey Altman [Sat, 23 Oct 2010 19:45:36 +0000]
Windows: Make Rx PMTU discovery configurable; disable by default

Disable PMTU discovery by default.  Permit it to be enabled
with the RxPMTUDiscovery TransarcAFSDaemon\Parameter value.

LICENSE MIT

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

10 years agorx: Tidy up variables in RTT calc
Simon Wilkinson [Sat, 23 Oct 2010 14:07:42 +0000]
rx: Tidy up variables in RTT calc

We used to do rttp = &thisRtt, and then use rttp and thisRtt to
interchangably refer to the same data. This is just confusing, and
unnecessary. Replace all of the occurences of rttp with &thisRtt.

Take the opportunity to use the Clock_IsZero macro rather than doing
an explicit zero clock check.

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

10 years agorx: Fix bracing on rx_clock macro arguments
Simon Wilkinson [Sat, 23 Oct 2010 14:16:17 +0000]
rx: Fix bracing on rx_clock macro arguments

Add brackets around the arguments in the clock helper macros, so that
these can be called with more complex parameters.

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

10 years agorx: More improvments to RTT calculation
Simon Wilkinson [Sat, 23 Oct 2010 13:51:56 +0000]
rx: More improvments to RTT calculation

Move the decision about whether a packet contributes to the peer's
rount trip time into the CalculateRoundTripTime function, and improve
the criteria used.

Previously, we only computed the RTT if we had not retransmitted. This
is bad, because it means that places where we have backed off in order
to retransmit never actually lengthen the RTT, and so the RTT is kept
artificially low, and we see a large number of retransmits. Instead,
use the serial of the ACK packet to determine which transmission is
being acknowledged, and if it is the first, or the last, transmission
use the appropriate sent time to calculate the RTT.

If we have no serial in the ACK (for a delayed ack, for example), or
if the serial doesn't match (where a single acknowledgement is soft
acking a number of packets), fall back to only using the ack if the
packet has not be retransmitted.

Also, avoid multiple counting of packets which have arrived as part
of a jumbogram by only permitting the last packet in a jumbogram to
contribute to the RTT. This avoids giving the RTT of jumbograms more
weight than those of normal packets - doing so would pull down the
RTT, as it in effect favours packets which have not be retransmitted.

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

10 years agoRx: Treat rx_minPeerTimeout not as a minimum but as padding
Jeffrey Altman [Thu, 21 Oct 2010 18:13:03 +0000]
Rx: Treat rx_minPeerTimeout not as a minimum but as padding

An improved RTT and timeout calculation algorithm is being
developed but until we have it, treat rx_minPeerTimeout not as
a minimum value for the timeout but as padding to be added to
the measured RTT when computing the peer timeout value.

With this change rx does not begin to send large numbers of
resends when the RTT begins to exceed the rx_minPeerTimeout
value.  Timeout triggered resends at the moment can force rx
into fast recovery mode which in turn kills performance.  It
is better to avoid that problem for now.

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

10 years agoRx: Fix socket() handling so errors are properly detected
Jeffrey Altman [Thu, 21 Oct 2010 18:23:18 +0000]
Rx: Fix socket() handling so errors are properly detected

socket() returns an osi_socket which on Windows is an
unsigned type (HANDLE).  Therefore, tests of osi_socket < 0
will never identify when the INVALID_SOCKET value is returned.
On Windows, the OSI_NULLSOCKET is assigned to INVALID_SOCKET.
Replace all comparisons of (osi_socket < 0) with
(osi_socket == OSI_NULLSOCKET) as a means of detecting errors.

In addition, do not pass socket() the protocol value 0 when
IPPROTO_UDP is what is desired.

Finally, perror() on Windows never reports any error from Winsock.
perror() is a CRT function.  To get the real socket error
WSAGetLastError() must be called and its value be written to
stderr.

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

10 years agolinux fh_to_dentry can return err
Charles Hannum [Fri, 22 Oct 2010 18:50:56 +0000]
linux fh_to_dentry can return err

handle e.g. ESTALE from  fh_to_dentry (in this case via
d_obtain_alias and fat_fh_to_dentry) so we print a meaningful
error when we lose.

Change-Id: If9f53776e0df4bfecf704943110a62b8c98684ce
Reviewed-on: http://gerrit.openafs.org/3028
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoafs: fix SOLARIS builds conflicting 'u' define
Chas Williams (CONTRACTOR) [Thu, 21 Oct 2010 14:07:11 +0000]
afs: fix SOLARIS builds conflicting 'u' define

Including <sys/user.h> does the following (which is rather
unfriendly):

This causes problems for the tokenJar u member.  I renamed u to
content, but there might be better choices for the name.

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

10 years agoWindows: Use rx_Readv / rx_Writev
Jeffrey Altman [Sun, 17 Oct 2010 04:35:36 +0000]
Windows: Use rx_Readv / rx_Writev

When USE_RX_IOVEC is defined, cm_BufWrite() will utilize rx_Writev()
instead of rx_Write() and cm_GetBuffer() will use rx_Readv() instead
of rx_Read() to improve throughput.

LICENSE MIT

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

10 years agoWindows: Fix i386_w2k and i386_nt40 path construction
Jeffrey Altman [Thu, 21 Oct 2010 18:09:53 +0000]
Windows: Fix i386_w2k and i386_nt40 path construction

Now that DEST and OBJ are defined in terms of AFSROOT
do not DESTDIR and OJT in terms of AFSROOT.

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

10 years agoWindows: Improve cm_SyncOpDone logging
Jeffrey Altman [Wed, 20 Oct 2010 23:35:10 +0000]
Windows: Improve cm_SyncOpDone logging

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

10 years agoWindows: remove unnecessary prototype from smb.c
Jeffrey Altman [Wed, 20 Oct 2010 23:31:19 +0000]
Windows: remove unnecessary prototype from smb.c

Remove rx_StartClientThread() prototype.

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

10 years agoWindows: optimize cm_BkgDaemon()
Jeffrey Altman [Wed, 20 Oct 2010 23:29:32 +0000]
Windows: optimize cm_BkgDaemon()

In cm_BkgDaemon test for CM_SCACHEFLAG_DATASTORING before
cm_ServerAvailable() in order to avoid unnecessary work.

LICENSE MIT

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

10 years agoWindows: remove warnings from cm_daemon.c
Jeffrey Altman [Wed, 20 Oct 2010 23:28:26 +0000]
Windows: remove warnings from cm_daemon.c

Properly cast void * to long and int to LPVOID to avoid warnings.

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

10 years agoWindows: prototype cm_PerformanceTuningInit()
Jeffrey Altman [Wed, 20 Oct 2010 23:26:06 +0000]
Windows: prototype cm_PerformanceTuningInit()

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

10 years agoRx: prototype rx_StateClienThread()
Jeffrey Altman [Wed, 20 Oct 2010 23:25:00 +0000]
Rx: prototype rx_StateClienThread()

Change-Id: I74c04229667d672005bd9a4abeab5309a1c97d7e
Reviewed-on: http://gerrit.openafs.org/3017
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>

10 years agoRx: rx_stats_active not RXDEBUG
Jeffrey Altman [Wed, 20 Oct 2010 23:23:11 +0000]
Rx: rx_stats_active not RXDEBUG

In rx_StatsOnOff() the assignment to rx_stats_active should not
be protected by RXDEBUG.

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

10 years agorx: remove spurious compare for maxDgramPackets
Chas Williams (CONTRACTOR) [Wed, 20 Oct 2010 13:06:35 +0000]
rx: remove spurious compare for maxDgramPackets

maxDgramPackets is initially assigned this value after correcting
for the wire endian.  This compare is harmless on little endian
since the network endian value will typically be huge and redundant
on big endian machines.

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

10 years agoAllow private implementations of osi_AllocSmall/LargeSpace
Chas Williams (CONTRACTOR) [Mon, 4 Oct 2010 19:08:10 +0000]
Allow private implementations of osi_AllocSmall/LargeSpace

NBSD seemed to already do this at one point but was partly disabled.
This patches generalizes this feature by adding a define to disable the
standard pool macros.  Linux's slab based allocator should out perform
this single threaded allocator/pool.

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

10 years agoatomic mutex don't recursive enter
Derrick Brashear [Tue, 19 Oct 2010 14:06:02 +0000]
atomic mutex don't recursive enter

enter pairs with exit, and not, say, enter

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

10 years agovutil use lockfile mutex macros for lockfile mutex
Derrick Brashear [Fri, 15 Oct 2010 20:27:55 +0000]
vutil use lockfile mutex macros for lockfile mutex

we have macroes; let's use them. makes later changes easier.

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

10 years agoafs assert should use afs abort
Derrick Brashear [Sun, 17 Oct 2010 22:11:52 +0000]
afs assert should use afs abort

we already have a portability abort macro. use it.

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

10 years agorx: Simplify round trip time calculation
Simon Wilkinson [Mon, 11 Oct 2010 17:25:38 +0000]
rx: Simplify round trip time calculation

Move the logic for deciding whether to compute RTT out of PeerNetStats
and into the callers. This means that we can share decisions about
whether a packet is ACK'd or not, and avoid uneccessary multiple tests
and function calls.

This change also stops us from computing RTT times for packets outside
of the set of explicit ACKs that we have received. This means that we
no longer compute RTTs for packets that are on the transmit queue, but
not yet on the wire.

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

10 years agoRX: Add rx_InterruptCall
Andrew Deason [Fri, 8 Oct 2010 20:39:21 +0000]
RX: Add rx_InterruptCall

Add rx_InterruptCall, to cause a call to error out and wakeup anyone
waiting to write or read to that call.

Change-Id: I0747ac9107dac6b9a6d8b8c59120a756416aad58
Reviewed-on: http://gerrit.openafs.org/2982
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoRx: Do not compute RTT on non-last packets of a jumbogram
Jeffrey Altman [Sat, 16 Oct 2010 17:14:03 +0000]
Rx: Do not compute RTT on non-last packets of a jumbogram

A jumbogram is constructed as a series of rx packets that are
all sent at once and acknowledged at the same time.  Computing the
RTT for all of the packets that makes up the jumbogram provides
the jumbogram RTT more weight than for a non-jumbogram packet.
To restore fairness, only compute the RTT for the last packet of
a jumbogram.  The non-last packets with have the RX_JUMBO_PACKET flag
set in the packet header.

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

10 years agoRx: Reject out of order ACK packets
Simon Wilkinson [Mon, 11 Oct 2010 17:14:02 +0000]
Rx: Reject out of order ACK packets

Our RX implementation virtually guarantees that we will see out of
order ACK packets, even on well behaved networks, as we send acks
simultaneously from multiple threads.

Currently we only reject out-of-order ACKS which change the window
position (so a window that advances, can never go back). However,
we fail to deal with the explicit acknowledgement portion of the ACK
packet in the same way...

For example, if we have a packet A that acknowledges packets 1 and 2,
and then a packet B acknowledging 1,2,3 and 4. If B arrives before A,
then we mark 1, 2, 3, 4 as acknowledged, and then treat the arrival of
A as nAcking 3 and 4. This has the same effect as an explicitly stated
nack, triggers an early and unnecessary resend and may, in some situations,
cause the call to go into congestion avoidance.

We can solve this using the previousPacket field of the ACK. This
indicates the last packet seen by the peer. In the same way as
firstPacket, this should never go backwards, and so can be used to
detect out of order acknowledgements, and reject them.

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

10 years agoshakeloosevcaches drop xvcache during dentry ops
Derrick Brashear [Thu, 7 Oct 2010 17:41:22 +0000]
shakeloosevcaches drop xvcache during dentry ops

denote that we slept and drop xvcache while doing dentry
flushing.

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

10 years agorename afs/assert.h to afs/afs_assert.h
Derrick Brashear [Fri, 15 Oct 2010 20:09:27 +0000]
rename afs/assert.h to afs/afs_assert.h

provide a private assert header which does not
pollute the normal namespace for the assert header.

further changes will modify pthread operations to not use
generic assert as a "did it work", which breaks if NDEBUG is set

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

10 years agopts: Specifically check for group id 0
Andrew Deason [Fri, 15 Oct 2010 21:35:32 +0000]
pts: Specifically check for group id 0

For consistency with the code checking user ids in createuser, check
for a specified group id of 0 specifically and give a slightly
different error message for it.

Change-Id: I362302a1a59fbe324f7f3e926f02177c24a5577d
Reviewed-on: http://gerrit.openafs.org/2994
Reviewed-by: Phillip Moore <w.phillip.moore@gmail.com>
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>

10 years agopts: Prevent creating negative user ids
Andrew Deason [Fri, 15 Oct 2010 21:37:55 +0000]
pts: Prevent creating negative user ids

User ids cannot be negative (those are groups). So, error out if a
negative id is specified for createuser.

FIXES 128343

Change-Id: I6e81a419c797944bfed569aac529b9694702823d
Reviewed-on: http://gerrit.openafs.org/2993
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Phillip Moore <w.phillip.moore@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

10 years agoReturn SRV record ports in network byte order
Russ Allbery [Thu, 14 Oct 2010 20:41:45 +0000]
Return SRV record ports in network byte order

Convert the port extracted from the SRV record return to network byte
order before assigning it to the port array.

The port in a SRV record is extracted by pulling out the high byte
and low byte and then mathematically combining them, which implicity
converts from network byte order to host byte order.  However, the
callers of afsconf_LookupServer expect the port array to be returned
in network byte order since ports are assigned without modification
to the .sin_port field of a struct sockaddr_in.  See also the byte
order of the default afsdbPort value.

Reported by Jan Christoph Nordholz (Debian Bug#600228).

Change-Id: I378fe2f769703e43800c185f0934c77dd97b1c7b
Reviewed-on: http://gerrit.openafs.org/2985
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>

10 years agoadd objc build rules to make-type makefiles
Derrick Brashear [Fri, 15 Oct 2010 15:28:34 +0000]
add objc build rules to make-type makefiles

sadly this needs to be here unless we want os-specific includes
of e.g. shared, lwp, pthreads makefiles for extra rules. as long
as no .m files are built in generic makefiles, this is a reasonable
approach.

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

10 years agoOSX prefspane use Kerberos Preferences for defaults
Derrick Brashear [Tue, 12 Oct 2010 13:05:24 +0000]
OSX prefspane use Kerberos Preferences for defaults

if we have forwardable tickets, e.g., as a pref, get those.
and so on. this way tickets AFS got are not "Weird"

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

10 years agoRx: use osi_Assert/osi_Panic instead of assert
Jeffrey Altman [Thu, 14 Oct 2010 21:24:33 +0000]
Rx: use osi_Assert/osi_Panic instead of assert

Avoid using the openafs src/util/assert.h implementation for Rx
and Rx security classes.  Use the built-in osi_Assert() and osi_Panic()
functionality instead.  This avoids all references to assert.h except
for rx_pthread.c (Unix only) which requires it for the assert()
references in the src/util/pthread_nosigs.h macros.

Change-Id: I5fbfcd57da381e02e716e7688a58918aed05c50f
Reviewed-on: http://gerrit.openafs.org/2987
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>

10 years agoUtil: include assert.h in pthreads_nosig.h when required
Jeffrey Altman [Thu, 14 Oct 2010 22:18:40 +0000]
Util: include assert.h in pthreads_nosig.h when required

If assert() will be used within pthreads_nosig.h, include assert.h.
Also, permit assert() to be a macro that is a no-op by always evaluating
the expression.

Change-Id: I8c790dcb8cb98f75028343e5de94b91ab891daad
Reviewed-on: http://gerrit.openafs.org/2988
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>

10 years agoRx: fix dpf() usage with regard to trailing \n's
Chas Williams (CONTRACTOR) [Thu, 14 Oct 2010 20:15:51 +0000]
Rx: fix dpf() usage with regard to trailing \n's

instead of checking to see if we need to add a trailing newline for the
messages, just make sure dpf() is always called with one.

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

10 years agoLINUX/osi_vnodeops.c: minor coding style fixes
Marc Dionne [Thu, 14 Oct 2010 22:45:32 +0000]
LINUX/osi_vnodeops.c: minor coding style fixes

Re-indent and correct a few coding style issues in this section
of code.  In particular, it clears up possible confusion on the
scope of the preceding if statement.

Purely cosmetic, no functional changes.

Change-Id: Id6dea6326c9878b41f821de00267f75195fea394
Reviewed-on: http://gerrit.openafs.org/2989
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

10 years agoRx: function return type on separate line
Jeffrey Altman [Thu, 14 Oct 2010 04:56:39 +0000]
Rx: function return type on separate line

Change-Id: I99546f2f7ebea0dd796d6c017acdeaf40c3fc711
Reviewed-on: http://gerrit.openafs.org/2978
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

10 years agoParallel I/O extensions to namei backend
Andrew Deason [Thu, 11 Mar 2010 18:19:47 +0000]
Parallel I/O extensions to namei backend

This adds the ability for certain namei operations (currently only
ListViceInodes) to occur across multiple different threads in
parallel. Currently this is only enabled when built with the
not-yet-existant AFS_SALSRV_ENV.

Originally written by Tom Keiser.

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

10 years agoLinux: fix statfs configure test
Marc Dionne [Wed, 13 Oct 2010 23:11:25 +0000]
Linux: fix statfs configure test

The change to the statfs configure test that was made for 2.6.36
broke the test for older kernels.  The new test is based on a call,
and that will generate a warning but not an error when the arguments
don't match the prototype.

Take another tack, and revert to the old style test, but with the
simple_statfs function instead of vfs_statfs.

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

10 years agorx: fix typo in rx_atomic Solaris backend
Tom Keiser [Thu, 14 Oct 2010 05:34:40 +0000]
rx: fix typo in rx_atomic Solaris backend

Fix typo so rx builds again on Solaris.

Change-Id: I328e05937b376c659bb42ba8db51f512b14da6f3
Reviewed-on: http://gerrit.openafs.org/2980
Tested-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

10 years agoLINUX: old kernel warning fixes
Andrew Deason [Wed, 13 Oct 2010 16:27:03 +0000]
LINUX: old kernel warning fixes

 - osi_vfsop.c: struct super_block, not superblock

 - osi_vnodeops.c: initialize bypasscache

Change-Id: I8492faeda632a05c080013cef71a95c60ab7c931
Reviewed-on: http://gerrit.openafs.org/2973
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agodon't release Volume lightweight ref too early
Tom Keiser [Wed, 13 Oct 2010 05:10:09 +0000]
don't release Volume lightweight ref too early

FSYNC_com_VolOff was releasing its lightweight ref before the error handling
code for VGetVolumeByVp_r was executed; this code needs to dereference the
Volume pointer for some of its logic.  This was unsafe since
VCancelReservation_r() could have resulted in the Volume object being freed.
Move VCancelReservation_r() below the error handling block.  NB: the error
handling block now relies upon the goto done/deny to cancel its lightweight
ref.

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

10 years agowrong rule to make afsd_fuse
Hans-Werner Paulsen [Wed, 13 Oct 2010 13:13:51 +0000]
wrong rule to make afsd_fuse

in src/afsd/Makefile.in the rule to make afsd_fuse was not modified to
recognise CFLAGS_afsd_fuse.o

Change-Id: Iae7863362a3cc7920d68e0c96f57433143664c27
Reviewed-on: http://gerrit.openafs.org/2972
Reviewed-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>

10 years agoLinux: fix aklog -setpag to work with ktc_SetTokenEx
Marc Dionne [Wed, 13 Oct 2010 01:05:45 +0000]
Linux: fix aklog -setpag to work with ktc_SetTokenEx

The bit of code that allows aklog -setpag to work with recent
linux needed to be moved along with the change from ktc_SetToken
to ktc_SetTokenEx.

While we're in this bit of code, make it depend on the definition
of the syscall in the user space headers instead of relying on a
kernel configure test.

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

10 years agorx: Don't count unknown packets as missing
Simon Wilkinson [Mon, 11 Oct 2010 18:08:00 +0000]
rx: Don't count unknown packets as missing

Just because a packet is in the transmit queue, don't assume that
the other side has instantly seen it! Currently, if we receive an
ACK packet which doesn't include the entire transmit queue, then we
will end backing off, even if we haven't sent the packets.

Restrict this behaviour to packets which are implicitly acked (or
otherwise) by the sender.

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

10 years agoRx: Consolidate wait for tq busy and make its use uniform
Jeffrey Altman [Tue, 12 Oct 2010 14:53:43 +0000]
Rx: Consolidate wait for tq busy and make its use uniform

rxi_WaitforTQBusy() is now used wherever a wait for the transmit
queue is required.  It returns either when the transmit queue is
no longer busy or when the call enters an error state.

Having made this change it is clear that call->currentPacket is
not always validated when the call->lock is reacquired which may be
true when rxi_WaitforTQBusy() is called.

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

10 years agorx: Don't malloc the xmit list
Simon Wilkinson [Sun, 10 Oct 2010 12:04:41 +0000]
rx: Don't malloc the xmit list

Building the transmit list happens in a time critical section of
code. Using malloc to allocate the list which holds the packets to
be transmitted slows down this critical section. Instead, just
allocate the space as part of the call structure.

Locking of xmitList is somewhat tricksy, as the call->lock is
dropped over calls to sendmsg(). However, the xmitList is protected
by the TQ_BUSY call flag, which prevents multiple threads from
usign the transmit queue, and hence the xmitList, simultaneously.

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

10 years agoRX: Force sane timeout values
Andrew Deason [Fri, 8 Oct 2010 16:51:30 +0000]
RX: Force sane timeout values

Currently we do not check the specified timeout values when someone
changes a connection's dead, idle, or hard dead time. However, if the
conn's dead time is larger than the other two times, a loss of network
activity will result in one of the other timeouts getting triggered
first.

To prevent this and possibly other problems from happening, force a
connection's timeouts to always obey the relationship
secondsUntilDead <= idleDeadTime <= hardDeadTime, by checking these
values whenever they are changed.

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

10 years agoRX: Adjust all timeouts for RTT
Andrew Deason [Wed, 6 Oct 2010 22:24:02 +0000]
RX: Adjust all timeouts for RTT

Previously only the deadTime RX network timeout was getting adjusted
for the peer's rtt and rtt_dev values. Do this for the idle and hard
timeouts as well, since a higher RTT is going to make everything
potentially take longer.

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