openafs.git
13 years agolibuafs: Add uafs_Init compat function
Andrew Deason [Wed, 19 May 2010 20:04:45 +0000]
libuafs: Add uafs_Init compat function

Recent libuafs changes changed the libuafs initialization API. Add a
uafs_Init wrapper for compatibility in case someone is using the old
way.

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

13 years agoMake all the default target in libadmin samples and test
Russ Allbery [Thu, 27 May 2010 19:53:57 +0000]
Make all the default target in libadmin samples and test

Change-Id: Idae0c8a6bf1b057d52c1d385daab5193083b63f6
Reviewed-on: http://gerrit.openafs.org/2051
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoClean up warnings in libadmin/bos/afs_bosAdmin.c
Russ Allbery [Thu, 27 May 2010 17:33:57 +0000]
Clean up warnings in libadmin/bos/afs_bosAdmin.c

Use the correct data structures for BOS timestamps.  Use afs_int32 for
the expressed timestamps for executables since that's what the BOS RPC
says it's using for right now; we should change this, but when we do,
warnings will catch this use along with the others.  Cast some const
char *'s that are passed into BOS functions that take char *'s.

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

13 years agoClean up the introduction to the Administration Guide
Russ Allbery [Thu, 27 May 2010 14:41:38 +0000]
Clean up the introduction to the Administration Guide

Provide a more useful abstract and remove the (outdated) specific list
of supported platforms and the M.m version number placeholders.  Update
the list of associated documents to match their current titles, and
provide a better description of the Reference Manual.

Reformat the parent document and preface for easier maintenance in the
future.

Change-Id: I42ce78274ed7c4ca7a2f0b9c5ec2e6f7a786adb8
Reviewed-on: http://gerrit.openafs.org/2043
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agolibuafs: Remove afsd symlink in setup
Andrew Deason [Mon, 17 May 2010 00:47:04 +0000]
libuafs: Remove afsd symlink in setup

Remove the 'afsd' symlink in the build setup, along with the other
symlinks. Otherwise, we try to recreate it every time and fail, since
it already exists.

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

13 years agobackground daemon don't wipe code before it gets used
Derrick Brashear [Thu, 27 May 2010 14:58:03 +0000]
background daemon don't wipe code before it gets used

the bop allocation will clear the bop structure on reuse. don't
clear the error code early.

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

13 years agoFlesh out NEWS for recent work
Russ Allbery [Wed, 26 May 2010 21:07:43 +0000]
Flesh out NEWS for recent work

Add entries to NEWS for all development releases back to 1.5.36, which
is the point at which I got bored, taken from the release announcements
to openafs-announce.  Try to use a relatively readable and consistent
formatting for all the entries and convert the old entries to the new
format (mostly).

Further history can be added from the release announcements when I or
someone else gets bored.

Change-Id: Iaf9171c82ca74cd98be3745d9c1965efc39d889a
Reviewed-on: http://gerrit.openafs.org/2036
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agoUpdate Debian packaging to 1.5.74.1-1
Russ Allbery [Wed, 26 May 2010 21:45:22 +0000]
Update Debian packaging to 1.5.74.1-1

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

13 years agoFix compilation of the imported config_file.c parser
Russ Allbery [Thu, 27 May 2010 03:04:48 +0000]
Fix compilation of the imported config_file.c parser

Include additional missing header files for proper function prototypes,
define TRUE and FALSE, and declare krb5_clear_error_message as unused
so that the config_file.c will compile and pass --enable-checking.

Make the build depend on krb5_locl.h.

Change-Id: I25a35098aa81c9d2a0efea48257dcb958602c785
Reviewed-on: http://gerrit.openafs.org/2040
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoscout.c: only declare width once
Marc Dionne [Wed, 26 May 2010 21:50:43 +0000]
scout.c: only declare width once

The width variable was declared twice, for the whole function
and also within the for loop, leaving the first one unused
and triggering a warning and a failed build with enable-checking.

Change-Id: Idd061aa0e9eff1f158bfdbd67a20fe5876570089
Reviewed-on: http://gerrit.openafs.org/2039
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agoProtect ubik cache accesses
Andrew Deason [Wed, 31 Mar 2010 16:40:42 +0000]
Protect ubik cache accesses

Currently, ubik application cached data could be updated and read by
different threads simultaneously. Add a mechanism in ubik for
protecting accessing and updating the cached data. This adds the
function ubik_CheckCache to do this, and removes ubik_CacheUpdate as
an exported function (since it's not safe).

Update all callers to use the new mechanism. In ptserver, remove the
'initd' variable; just rely on cachedVersion and ubik_CheckCache to
tell us when to re-read the database. Remove db.lock in buserver and
cheader_lock in kaserver, which served similar (though not completely
threadsafe) protection as ubik_CheckCache. Add the ubik database lock
cache_lock to protect the application cache.

Change-Id: I857a67d410e2c539197c5212c3b114c3fd0403c2
Reviewed-on: http://gerrit.openafs.org/1546
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agoFix syntax error when supergroups are not enabled
Russ Allbery [Wed, 26 May 2010 21:47:49 +0000]
Fix syntax error when supergroups are not enabled

1f22cab broke non-supergroups builds due to incorrect brace placement.
Move the correct closing brace outside of the #ifdef.

Change-Id: I2ed3f8f57b35f0030e26306f7e791ea6b5158c9a
Reviewed-on: http://gerrit.openafs.org/2038
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agoAdd /dest and /obj to .gitignore
Asanka Herath [Wed, 26 May 2010 16:31:39 +0000]
Add /dest and /obj to .gitignore

These are build directories used on Windows.

Change-Id: I20c37ae4ada78949c3a09d618476286f64f9b682
Reviewed-on: http://gerrit.openafs.org/2032
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agoRemove references to IBM AFS
Russ Allbery [Wed, 26 May 2010 17:20:57 +0000]
Remove references to IBM AFS

Change references to the documentation sets that we still ship to
reference the OpenAFS manuals instead of the IBM AFS manuals.  Remove
references to the IBM AFS/DFS Migration documentation, since that
doesn't appear to be available anywhere any more, replacing them where
relevant to more generic references to the DFS documentation.  Add
links to docs.openafs.org for mentions of the manuals in SEE ALSO, and
standardize on one link format.  Replace a few references to the IBM
AFS Release Notes with the actual information in those notes, or drop
the reference if it doesn't seem particularly useful.

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

13 years agoavoid nat ping for authenticated connections
Derrick Brashear [Thu, 20 May 2010 15:27:10 +0000]
avoid nat ping for authenticated connections

this is a cheap way to ensure one nat ping per server. basically,
only do it for the one unauth connection we have.

Change-Id: I4583112d7b4a10a0e8f524795527d99a5b2adf51
Reviewed-on: http://gerrit.openafs.org/2010
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRemove references to AFS Product Support in -oktozap
Russ Allbery [Wed, 26 May 2010 16:33:29 +0000]
Remove references to AFS Product Support in -oktozap

salvager and salvageserver's documentation of -oktozap says to not use
without consultation with AFS Development or Product Support, left over
from the IBM product.  Remove those references and add a caution more
in line with open source.

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

13 years agoRemove -rebuildDB flag to ptserver
Russ Allbery [Wed, 26 May 2010 16:28:57 +0000]
Remove -rebuildDB flag to ptserver

The -rebuildDB flag was documented to rebuild the Protection Database at
startup, but it was accepted and ignored in the ptserver source, doing
nothing.  Remove the documentation and the option recognition in ptserver.

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

13 years agoRemove documentation of kaserver -fastKeys
Russ Allbery [Wed, 26 May 2010 16:25:39 +0000]
Remove documentation of kaserver -fastKeys

-fastKeys wasn't accepted by the kaserver binary, but was still
mentioned in the usage message and the kaserver man page.  Remove
the remnants of the flag.

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

13 years agoAdd an OpenAFS config file parser
Simon Wilkinson [Tue, 27 Apr 2010 21:53:47 +0000]
Add an OpenAFS config file parser

This adds a Kerberos INI style config file parser to OpenAFS, using
the parser contained in Heimdal as a base. Currently, it only exports
a very small number of functions, but exporting further functions is
simply a matter of adding additional shims to hide the Kerberos
context and other specifics.

Note that we don't want to just use the parser as a library because
firstly, we don't want OpenAFS to have a Kerberos dependency (as
other crypto mechanisms will, and do, exist). Secondly, MIT and
Heimdal use a different API here, so we would have to shim anyway.
Also, our own parser means that we don't need to worry about passing
in the krb5 context, and all of the issues that that presents.

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

13 years agoscout: adjustable column widths
Michael Meffie [Wed, 19 May 2010 16:37:35 +0000]
scout: adjustable column widths

Adds new command line option to scout so users can set the
number of characters to display without truncating.

Change-Id: I69f159549d7f5b4cfee26c276ad34705f504ee2b
Reviewed-on: http://gerrit.openafs.org/1951
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agodumpstuff nbytes can't exceed 32 bits
Derrick Brashear [Tue, 25 May 2010 22:21:32 +0000]
dumpstuff nbytes can't exceed 32 bits

the read returns a 32 bit type; we can't possibly need to write 64 bits.
(ssize_t is 32 bits on macos and so this ends up being a bad shift)

Change-Id: I4d8f99b0c752a2c75ce65b9cfa1b3cb0d484cc7f
Reviewed-on: http://gerrit.openafs.org/2024
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoSynchronize LICENSE files
Russ Allbery [Tue, 25 May 2010 19:37:05 +0000]
Synchronize LICENSE files

We have two LICENSE files, which had been somewhat independently
modified.  Resynchronize them, remove trailing whitespace, and convert
from ISO 8859-1 to UTF-8.

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

13 years agowindows handle NONODE case uniformly in cm_BPlusDirDeleteEntry
matt@linuxbox.com [Tue, 25 May 2010 00:26:46 +0000]
windows  handle NONODE case uniformly in cm_BPlusDirDeleteEntry

Fix handling of a NONODE case in cm_BPlusDirDeleteEntry.  Previously in
this case, the routine referenced uninitialized memory.

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

13 years agoImport of code from heimdal
Heimdal Developers [Sun, 9 May 2010 18:33:54 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
64651b4be5be1eaacd4388c428cb936cb8be34b5 which is
described as switch-from-svn-to-git-1210-g64651b4

This commit imports the Heimdal configuration file parser.

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

13 years agofs getserverprefs needs a larger buffer
Derrick Brashear [Tue, 25 May 2010 04:03:16 +0000]
fs getserverprefs needs a larger buffer

it's very easy for the size of server preferences to be too large for the
default buffer. cope.

Change-Id: I0535edf784eb9e9a309dc17e571719e204b9d29b
Reviewed-on: http://gerrit.openafs.org/2021
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoAutoconf : Kill dead code
Simon Wilkinson [Sun, 16 May 2010 21:48:52 +0000]
Autoconf : Kill dead code

Remove unused autoconf macros - they're not being called, and so
have bitrotted, and are just cluttering up the tree.

Change-Id: Ib2d1fc5121b6845cf0b500e5aef8ca822be58ad3
Reviewed-on: http://gerrit.openafs.org/1971
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agoLinux: Disable syscall probes if we have keyrings
Simon Wilkinson [Thu, 20 May 2010 10:57:20 +0000]
Linux: Disable syscall probes if we have keyrings

If we are building for are kernel with keyrings, and we can
guarantee that we can make use of those keyrings, then we no longer
need to probe for the syscall table at all. Change our default
behaviour so that when these two conditions are true, syscall probing
is disabled. Both --enable-linux-syscall-probing and
--disable-linux-syscall-probing can be used to override the
autodetection and force things one way or the other.

We have to check that we can use the keyrings because there was a
window in the 2.6 kernel series where keryings were available, but
the key_type_keyring definiton (which we use to create the session
keyring) wasn't exported. In that situation, we attempt to traverse
the process table and use the type of init's session keyring. This
traversal is fragile, and if it fails, keyring PAGs will be disabled.
So, we still want to be able to fall back to patching the syscall
table, if we can, in this case.

FIXES 125215

Change-Id: I11ba5c68fe37609bbd6b9c9f7e7c699334f42ebc
Reviewed-on: http://gerrit.openafs.org/2002
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agovol, volser, and viced type fixes
Andrew Deason [Thu, 6 May 2010 20:40:36 +0000]
vol, volser, and viced type fixes

Correct many uses of incorrect types for file offsets, sizes, etc. in
the volume server, fileserver, and the volume package.

Thanks to Tom Keiser who pointed out the incorrect types and suggested
solutions.

Change-Id: If4aedfe0cc06d05b3775069ae1285d4c330976cd
Reviewed-on: http://gerrit.openafs.org/1920
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Russ Allbery <rra@stanford.edu>

13 years agoAdd libafs_tree to .gitignore
Russ Allbery [Tue, 25 May 2010 03:21:29 +0000]
Add libafs_tree to .gitignore

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

13 years agoFix libafs_tree's cross-architecture support
Russ Allbery [Tue, 25 May 2010 03:03:49 +0000]
Fix libafs_tree's cross-architecture support

The results of libafs_tree are supposed to build on any platform that
shares the same basic kernel code, but this had broken in two ways:
libafs_tree was including a pre-built afs/param.h, which needs to be
regenerated on different architectures, and the Linux kernel build
makefile was being pre-generated despite having some architecture-specific
options.

Copy over more of src/config and postpone generation of afs/param.h and
generation of libafs/Makefile to the libafs build.

Remove the substitution of AFS_SYSNAME from make_libafs_tree.pl; it was
unused and now definitely shouldn't be used since it will break the
architecture-independence of the resulting tree.

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

13 years agoPostmoderize use of AC_CHECK_TYPE
Russ Allbery [Tue, 25 May 2010 02:34:53 +0000]
Postmoderize use of AC_CHECK_TYPE

Use AC_TYPE_SSIZE_T to handle the ssize_t check (introduced in Autconf
2.60).  Use AC_CHECK_TYPE, not AC_CHECK_TYPES, to check for sig_atomic_t
and socklen_t, and define them in afsconfig.h if they're not present on
this platform.  Do not define them in stds.h, since stds.h is an installed
header file and cannot rely on Autoconf defines.

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

13 years agoUpdate fs {get,set}serverprefs documentation for DNS
Russ Allbery [Mon, 24 May 2010 19:28:01 +0000]
Update fs {get,set}serverprefs documentation for DNS

Mention in the fs getserverprefs and fs setserverprefs documentation
that VL servers may also come from DNS AFSDB and SRV records.  Document
that SRV record information is not (yet) properly used.

Change-Id: I223efedf4d00ac1b57b3dce74a807790691abdbf
Reviewed-on: http://gerrit.openafs.org/2015
Tested-by: Russ Allbery <rra@stanford.edu>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoreport server address when known for afs warnings
Derrick Brashear [Tue, 27 Apr 2010 17:16:20 +0000]
report server address when known for afs warnings

if we have the server info, give an address with the error.
we could probably give the program name too, as for flock
warning, but...

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

13 years agogetcapabilities avoid panic when cell is not filled
Derrick Brashear [Mon, 24 May 2010 20:12:24 +0000]
getcapabilities avoid panic when cell is not filled

for a new server, getcapabilities is not safe, as cell may not be filled.

Change-Id: I0926034c1d9e9c8c08e7ca993de1bcef9c0de8cf
Reviewed-on: http://gerrit.openafs.org/2016
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRead volume at correct address when looking for broken forward links.
Rod Widdowson [Tue, 18 May 2010 13:48:38 +0000]
Read volume at correct address when looking for broken forward links.

vldb_check was reading a volume at the index rather than the file
offset to read the volume.  This was giving rise to phantom warnings
since the hash was usually 0.

The possibility of a broken flink is determined in another manner
which is why in normal case we are not flooded with warnings.

At the same time make the error message slightly more coherent.

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

13 years agoAutoconf: Tidy up resolver retrans retry test
Simon Wilkinson [Sat, 22 May 2010 08:40:05 +0000]
Autoconf: Tidy up resolver retrans retry test

There's no need for the retrans retry test to be a TRY_RUN test,
TRY_COMPILE will pick up the existence of the '_res' structure and
its elements.

Also, clean up the use of the cache variable to set the result. In
the old implementation a true test result would print '1', not 'yes',
a false result would result in bad output in the config.log, and a
cross compiling output would give
  #define HAVE_RES_RETRANSRETRY no
which will give unexpected results with #ifdef tests.

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

13 years agowindows map lstat to _stat (mrafsStyleLogs)
matt@linuxbox.com [Sat, 22 May 2010 23:40:03 +0000]
windows  map lstat to _stat (mrafsStyleLogs)

Provides function macros mapping lstat to _stat, in Windows param
files (i386, amd64, i64).

change per jaltman

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

13 years agoUpdate bos addkey/listkeys and KeyFile man pages for asetkey
Russ Allbery [Mon, 10 May 2010 00:58:33 +0000]
Update bos addkey/listkeys and KeyFile man pages for asetkey

Clearly prefer asetkey to bos addkey in the KeyFile, bos addkey, and
bos listkeys man pages.  Reference asetkey list and asetkey delete as
alternatives to bos listkeys and bos removekey.  Distinguish between
Authentication Server cells and Kerberos v5 cells and mention the
preferred afs/<cell> principal format.  Add some cautions around
matching enctypes and salts when synchronizing keys with a v5 KDC.

Update man-pages/README for completion of this task, clean up some
other wording, and remove some other now-irrelevant information.

Change-Id: I29b83a61cbdb08de508bdb313524a307e385044b
Reviewed-on: http://gerrit.openafs.org/1938
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agoDo not lie about needing Giant
Ben Kaduk [Sat, 22 May 2010 01:39:16 +0000]
Do not lie about needing Giant

Catch up to 2005.  Giant has not been needed for vnode page
operations for quite some time now.

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

13 years agoLinux: remove unused label
Marc Dionne [Wed, 19 May 2010 20:49:07 +0000]
Linux: remove unused label

The out label is no longer used and triggers a warning.
So just remove it.

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

13 years agoMore warnings cleanup
Simon Wilkinson [Wed, 24 Feb 2010 21:39:10 +0000]
More warnings cleanup

Remove uneccessary warning inhibition in vol/
Update README.WARNINGS to match the current state of the tree

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

13 years agoLinux: Use positional r/w, not llseek
Simon Wilkinson [Wed, 19 May 2010 17:11:58 +0000]
Linux: Use positional r/w, not llseek

The Linux read/write file operations take a position. Use this
position to determine where we're reading or writing in a file,
rather than using the vfs_llseek() operator to set the file
position argument. This avoids a potential race condition, as
well as simplifying this code.

Change-Id: I82b4a109f9871fa2ce5b308bc32923b1bf910920
Reviewed-on: http://gerrit.openafs.org/1993
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agodafs: don't restart for new binaries using mrafs scanner time
Derrick Brashear [Wed, 19 May 2010 14:57:31 +0000]
dafs: don't restart for new binaries using mrafs scanner time

if binary restart times are enabled, dafs restarts every time due to
a flawed comparison. fix it.

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

13 years agoUnix CM: Use macros for process name and id access
Simon Wilkinson [Thu, 29 Apr 2010 18:06:37 +0000]
Unix CM: Use macros for process name and id access

This patch uses the new osi_procname() macro to obtain the process
name for setpag() warnings on BSD and Darwin, and osi_curproc() to
obtain the process identity, simplifying the code.

Change-Id: I1f8a4d4bbcdb09eaeea3712b1fffd1aaa3cd2fa7
Reviewed-on: http://gerrit.openafs.org/1878
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agomrafs logs don't clobber existing logs
Derrick Brashear [Tue, 18 May 2010 14:42:28 +0000]
mrafs logs don't clobber existing logs

if a restart happens too quickly, we can wipe existing log files in
mrafs log mode. cheat. assume we won't have too many sub-second starts.

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

13 years agoDo not sleep in FBSD's getevent()
Ben Kaduk [Wed, 19 May 2010 05:44:44 +0000]
Do not sleep in FBSD's getevent()

Calling osi_AllocSmallSpace drops the glock, which allows
a race condition that caused a rather fast deadlock on
multiprocessor systems.
Use afs_osi_Alloc_NoSleep instead.

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

13 years agolinux PageCheck may be PageFsMisc
matt@linuxbox.com [Tue, 18 May 2010 01:28:56 +0000]
linux PageCheck may be PageFsMisc

Define the PageCheck family of functions using PageFsMisc
equivalents if those are found.  I encountered a need for this
on Centos 5.5 (2.6.18-8.el5xen), but it may be more general.

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

13 years agodarwin afs.conf: growlagent example
Derrick Brashear [Tue, 18 May 2010 17:06:44 +0000]
darwin afs.conf: growlagent example

provide an example usage of the growl agent

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

13 years agolinux include osi_compat.h in rx/LINUX/rx_knet.c
matt@linuxbox.com [Sun, 16 May 2010 23:58:39 +0000]
linux include osi_compat.h in rx/LINUX/rx_knet.c

Does include osi_compat.h in rx/LINUX/rx_knet.c

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

13 years agoFileserver: Don't sync every 10 seconds
Simon Wilkinson [Mon, 17 May 2010 19:15:46 +0000]
Fileserver: Don't sync every 10 seconds

The patch which moved our calls to fsync into the background, added
a sync prior to each batch of fsync calls. This is an incredibly bad
idea.

POSIX says that sync "shall cause all information in memory that
updates file systems to be scheduled for writing out to all file
systems". On Linux this means that we in effect perform an fsync()
on every open filehandle on the entire system, and in addition flush
all superblocks and journals out to disk. This makes the following
fsync() calls superfluous - sync() will have already written out
all of the data.

Add to this the fact that the fileserver is doing this every 10
seconds, and this becomes a major performance bottleneck,
particularly if the machine uses a journalled fs - as any disk
operations will end up blocking whilst the journal is written to
disk.

Change-Id: Id06cb99ae83af2e4a82e7b20fb14b8457dc16883
Reviewed-on: http://gerrit.openafs.org/1977
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Rainer Toebbicke <rtb@pclella.cern.ch>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: work harder to notice and handle MorePackets request
Jeffrey Altman [Mon, 17 May 2010 20:01:03 +0000]
rx: work harder to notice and handle MorePackets request

in particular, we did badly at handling kernel requests for
more packets, but other cases did not properly keep packet
stats either. attempt to globally better handle demand for
more packets.

Change-Id: I88837fed880f582444221ec53d280ca4070b607d
Reviewed-on: http://gerrit.openafs.org/1978
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Hartmut Reuter <reuter@rzg.mpg.de>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoAutoconf: Use AC_CACHE_CHECK
Simon Wilkinson [Mon, 17 May 2010 07:40:49 +0000]
Autoconf: Use AC_CACHE_CHECK

AC_CACHE_CHECK has been available since Autoconf 2.5 (released in
1995), and provides a simpler mecahnism for performing cached checks
than AC_CACHE_VAL does. Modify all of our simple AC_CACHE_VAL calls
to use AC_CACHE_CHECK.

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

13 years agoafsprefs: clarify restart requirement
Derrick Brashear [Sat, 15 May 2010 13:30:57 +0000]
afsprefs: clarify restart requirement

don't make the red text make it seem like a restart is always needed

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

13 years agoClean up logging from vldb_check.
Rod Widdowson [Wed, 12 May 2010 14:48:25 +0000]
Clean up logging from vldb_check.

vldb_check used to say "%<index>: Volume '<name>' <id>not found in <type> hash <hash>" for two sorts of failures

- If the volume really wasn't in a hash chain of that type at all
- If volume's next pointer (for the hash type) pointed to a volume with a different hash.

In both cases it would then print out some confusing (and spurious)
information about the next element in the chain, prior to applying the
same fix (of zeroing the next pointer).

This change fixes the error message.

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

13 years agoStop overanxious htonl in vldb_check -fix
Rod Widdowson [Sat, 15 May 2010 15:25:26 +0000]
Stop overanxious htonl in vldb_check -fix

vldb_check -fix is corrupting the server entries (Number, Partition,
Flags).  This is because it is doing a htonl on what is a char field.
The read code already has a comment "make sure not to ntohl these,
as they're chars, not ints".

This change strips the corresponding htonl from writeheader (and puts
in a similar comment).

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

13 years agoDemand Attach: Volumes and vnodes are different
Simon Wilkinson [Sun, 25 Apr 2010 19:36:06 +0000]
Demand Attach: Volumes and vnodes are different

fssync-debug attempts to copy sizeof(Volume) bytes into an object
defined as a Vnode, a sure fire way to make things go boom.

gcc on Snow Leopard picks this up as a buffer overflow, and warns about
it. Fix the problem by only copying sizeof(Vnode) bytes.

Change-Id: Iadcda0b465f9a9f310dcbe4d3862ea479e052674
Reviewed-on: http://gerrit.openafs.org/1834
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoDemand Attach: Simplify __VVGC_entry_cl_add
Simon Wilkinson [Sun, 25 Apr 2010 19:23:27 +0000]
Demand Attach: Simplify __VVGC_entry_cl_add

The __VVGC_entry_cl_add was giving an uninitialised variable warning
for empty_idx, because it was using a separate variable, empty_found
as a sentinel for when empty_idx was holding a real value. Simplify all
of this by removing the sentinel, and making empty_idx being -1 mean
'not found', and a real value imply found.

Change-Id: I6c485993df1ff8dfd27824234c811af998ff94fa
Reviewed-on: http://gerrit.openafs.org/1833
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoDemand-Attach: Remove dangerous trailing else
Simon Wilkinson [Sun, 25 Apr 2010 19:14:02 +0000]
Demand-Attach: Remove dangerous trailing else

Change 9aa09f5e634db8a8b2dedf3a749f2a90ef206e2f introduced a
dangerous trailing else into the VScheduleSalvage_r function:

 #ifdef A
    if (foo) {
      ...
    } else
 #endif
 #ifdef B
    if (bar) {
      ...
    }
 #endif
    something_else()

In a situation where we have A && !B, then something_else() ends up
only being run when foo is false. Given that something_else() is
VOL_LOCK, this will not end well.

In the real world, we hit this problen when we build the volume
package with SALVSYNC_BUILD_CLIENT and !FSYNC_BUILD_CLIENT - in
other words, whilst building the fileserver.

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

13 years agoEnable PutVCache for FBSD80 and higher
Ben Kaduk [Mon, 17 May 2010 04:22:32 +0000]
Enable PutVCache for FBSD80 and higher

Matt's patches in a123bd8ccd brought in support for FBSD 7.0, but
also disabled several calls to afs_PutVCache() for FBSD80 and
higher.  Matt says that that patch was focused on 7.0, so the
8.0-related bits may not be relevant.
I have run with the PutVCache calls enabled, and if anything,
my system seems more stable with them.

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

13 years agoKill FBSD4X with fire
Ben Kaduk [Sun, 16 May 2010 04:43:35 +0000]
Kill FBSD4X with fire

We haven't even pretended to work on the 4.X series for quite some
time, and keeping this code around just makes things (slightly)
harder to read.
AFS_FBSD_ENV is now equivalent to AFS_FBSD50_ENV (though the
latter should not be used).
Leave the fbsd_4 sysnames in afs_sysnames.h for archival purposes.

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

13 years agoAutoconf: Use AC_CHECK_MEMBERS
Simon Wilkinson [Sun, 16 May 2010 22:14:11 +0000]
Autoconf: Use AC_CHECK_MEMBERS

AC_CHECK_MEMBERS has been available since autoconf 2.50,
which was released in 2001. Use this, rather than rolling our
own mechanism to check for structure membership.

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

13 years agoAutoconf: Use a standard test for socklen_t
Simon Wilkinson [Sun, 16 May 2010 21:56:13 +0000]
Autoconf: Use a standard test for socklen_t

Use the standard AC_CHECK_TYPES mechanism to check for the existence
of socklen_t, and to typedef it as an int if it's not found, rather
than growing our own.

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

13 years agoDo not try to increase the refcount of a NULL vnode
Ben Kaduk [Sat, 15 May 2010 21:11:15 +0000]
Do not try to increase the refcount of a NULL vnode

osi_lookup is not guaranteed to give us a valid vnode, so
check before calling VN_HOLD().

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

13 years agoSolaris: do not call VFS_RELE with GLOCK
Andrew Deason [Sun, 16 May 2010 04:12:33 +0000]
Solaris: do not call VFS_RELE with GLOCK

VFS_RELE can call afs_freevfs, which grabs GLOCK. Thus, don't call
VFS_RELE with GLOCK held or we can try to recursively acquire GLOCK
and panic.  This is currently unlikely to occur (sans vfs refcount
unbalances) without support for forced unmounts, since the last vfs
ref will usually come from the caller of afs_unmount(). But it still
may be possible.

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

13 years agoDon't use afs_linux_storeProc with memory cache, it only works with disk cache.
Hartmut Reuter [Fri, 14 May 2010 11:25:44 +0000]
Don't use afs_linux_storeProc with memory cache, it only works with disk cache.

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

13 years agoSolaris: stop NetIfPoller on shutdown
Andrew Deason [Wed, 12 May 2010 18:59:06 +0000]
Solaris: stop NetIfPoller on shutdown

The NetIfPoller code that is enabled on AFS_SUN510_ENV never gets
shutdown properly. The current code looks as if it was intended for
NetIfPoller to recognize the appropriate termState and just return,
but we never wait for it, and so we can complete the shutdown sequence
without NetIfPoller ever knowing that we are shutting down. This can
cause the machine to panic, as we keep attempting to run NetIfPoller
even after libafs has been unloaded.

Since NetIfPoller is fired by default every 30 seconds, we probably do
not want to wait for it to fire during shutdown. Instead, just destroy
the necessary timeout and task queue, which will wait for NetIfPoller
to complete if running, and will just prevent it from running in the
future otherwise.

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

13 years agoWindows: move afsconfig.h / param.h to afscred.h
Jeffrey Altman [Wed, 12 May 2010 15:27:17 +0000]
Windows: move afsconfig.h / param.h to afscred.h

move the inclusion of afsconfig.h and param.h to
afscred.h so that they are included everywhere
and so that the conditional use of _USE_32BIT_TIME_T
is applied consistently by afscred.h.

LICENSE MIT

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

13 years agoWindows: netidmgr_plugin must include afsconfig.h
Jeffrey Altman [Wed, 12 May 2010 14:25:01 +0000]
Windows: netidmgr_plugin must include afsconfig.h

In order to properly use afs headers afsconfig.h must
be included first in afsfuncs.c.  Update the makefile
to specify the correct include paths.

Since this results in the afs assert.h being used,
we must include the lib file that includes the
AssertionFailed function.

LICENSE MIT

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

13 years agoFix missing semicolon in non-AFS_NAMEI_ENV builds vol/nuke.c
Jeffrey Altman [Wed, 12 May 2010 14:24:03 +0000]
Fix missing semicolon in non-AFS_NAMEI_ENV builds vol/nuke.c

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

13 years agoWindows: fix consistency of afsconfig-windows.h
Jeffrey Altman [Wed, 12 May 2010 14:22:07 +0000]
Windows: fix consistency of afsconfig-windows.h

Windows is a AFS_NAMEI_ENV platform

Windows (as of WDK 6) defines socklen_t as signed int

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

13 years agoinlinebulk analyze errors
Derrick Brashear [Fri, 7 May 2010 14:32:09 +0000]
inlinebulk analyze errors

afs_Analyze was not being called on inlinebulk errors if the error
potentially required a retry. do so.

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

13 years agoRx: prevent rx_rpc_stats mutex from being a global bottleneck
Jeffrey Altman [Sun, 9 May 2010 01:38:05 +0000]
Rx: prevent rx_rpc_stats mutex from being a global bottleneck

Prior to this patchset, the 'rx_rpc_stats' mutex was superior
to both the 'peer->peer_lock' and the 'rx_peerHashTable_lock'.
That meant that the 'rx_rpc_stats' was being held across many
operations that walk the peer hash table.  For example,
rxi_ReapConnections, rx_disablePeerRPCStats, and rx_shutdown.
Since every RPC issues a call to rx_IncrementTimeAndCount, the
reap connections event would effectively bring all RPC processing
to a halt.

This patchset moves 'rx_rpc_stats' later in the hierarchy and
restructures rxi_ReapConnections, rx_disablePeerRPCStats, and
rx_shutdown so that not only doesn't the 'rx_rpc_stats' mutex
need to be held across the entire function but the
'rx_peerHashTable_lock' does not need to be held while complex
operations on the peer object are taking place.

rxi_ReceiveDebugPacket is also fixed to hold the rx_peerHashTable_lock
and peer_lock at appropriate times while completing its function.

Change-Id: I1a11798f1bb2a8f03316c6c455954bd6b8d1459b
Reviewed-on: http://gerrit.openafs.org/1928
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: Add support for NetWkstaGetInfo levels 101 and 102
Jeffrey Altman [Wed, 12 May 2010 04:58:30 +0000]
Windows: Add support for NetWkstaGetInfo levels 101 and 102

On Windows 7, NetWkstaGetInfo levels 101 and 102 are queried.
Add support to the WKSSVC RPC Pipe service.

LICENSE MIT

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

13 years agoWindows: Prevent overflow during percent used calc in Explorer Shell Ext
Jeffrey Altman [Mon, 10 May 2010 13:07:50 +0000]
Windows: Prevent overflow during percent used calc in Explorer Shell Ext

In the Volume Info and Partition Info dialog boxes, percent used
was overflowing the variable due to using too small a variable
and multiplying before dividing.

FIXES 126846

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

13 years agoWindows: Freelance vs ACLs
Jeffrey Altman [Sun, 9 May 2010 14:50:07 +0000]
Windows: Freelance vs ACLs

If the user attempts to list acls or set acls on the freelance
root.afs volume, generate a meaningful error.

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

13 years agoWindows: use system CreateUuid instead of afs variant
Jeffrey Altman [Mon, 10 May 2010 00:49:05 +0000]
Windows: use system CreateUuid instead of afs variant

The afs_create_uuid function on Windows results in
duplicate uuids being produced.  Windows provides its own
CreateUuid function.  Use it when afs_create_uuid is called.

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

13 years agoMake afsio be useful on Windows and fix bugs
Jeffrey Altman [Sun, 9 May 2010 14:15:30 +0000]
Make afsio be useful on Windows and fix bugs

On Windows, the stdin and stdout handles default to text
mode which corrupts data piped through them.  At the start
of readFile and writeFile, the mode is now set to binary.

The ProbeUuid callback is supposed to determine if this
client is the same as the one being requested.  Since we
are advertising a new uuid in TellMeAboutYourself and
WhoAmI, we should perform the uuid check and return a
valid answer in order to avoid confusing the file server.

Add support for TellMeAboutYourself.  On Windows, return
valid interface information.

Always print verbose output to stderr.

Display MB/sec to three decimal places.

In readFile, always perform a AFSFetchStatus operation
otherwise we have no idea what the file size is.

On Windows, the path separator is backslash.

Change-Id: I174eda991383301d01fe5d6431d459b6ea01a0be
Reviewed-on: http://gerrit.openafs.org/1930
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Hartmut Reuter <reuter@rzg.mpg.de>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoWindows: RXAFS_InlineBulkStat errors must be processed via cm_Analyze
Jeffrey Altman [Thu, 6 May 2010 21:12:48 +0000]
Windows: RXAFS_InlineBulkStat errors must be processed via cm_Analyze

RXAFS_InlineBulkStatus does not return errors such as EACCES,
VNOVOL, VNOVNODE, VOFFLINE, VBUSY, VIO, VMOVED, etc. as an RPC return
code.  Instead they are returned in the status info errorCode field
for each file.

Traditionally, the error associated with the first FID in the query
list has been returned to the caller of cm_TryBulkStatRPC().
However, the error has never been processed through cm_Analyze()
which means that the per-vnode processing for VNOVNODE and the volume
global processing for VMOVED, VNOVOL, etc. has never been performed.
As a result, failover to other .readonly volume instances cannot occur,
volume moves will not be handled, and files that have been deleted
are not detected.

This patchset makes the following changes:

1. If an inline bulk operation has been performed and the inline
   errorCode is a volume global error, then that error replaces
   the RPC return code within the cm_Analyze() processing for
   the RPC.  This will affect whether or not a retry operation
   is performed.

2. The variable 'inlinebulk' is reset to 0 at the top of the
   cm_Analyze() loop in case failover from an inlinebulk capable
   file to an inlinebulk incapable file server takes place.

3. The FID that is passed into cm_Analyze() is not a real fid.
   Instead it consists of the cell and volume but vnode = 0.
   This ensures that the error (if any) is not applied to the
   directory object.

4. If an inline bulk operation was performed, prior to performing
   the cm_MergeStatus() operation a vnode a check is made to
   determine if an error was returned for that vnode.  If so,
   cm_Analyze() is called with no connection, a fake cm_req_t,
   the fid, and the error.  This permits cm_Analyze() processing
   to be performed on the file.

LICENSE MIT

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

13 years agoLinux: missing configure test
Michael Meffie [Tue, 11 May 2010 19:54:53 +0000]
Linux: missing configure test

Add the kmem_cache_create test for dtor to the configure to
build again on older versions of linux. Fixes,
osi_vfsops.c:264: error: too few arguments to function
‘kmem_cache_create’

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

13 years agoRemove intptr.m4
Simon Wilkinson [Thu, 6 May 2010 21:22:50 +0000]
Remove intptr.m4

We now require an autoconf version of at least 2.60. This version
supplies AC_TYPE_INTPTR_T and AC_TYPE_UINTPTR_T, so we no longer
need to have our own.

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

13 years agovnode alloc bitnumber returns bitnumber
Derrick Brashear [Tue, 11 May 2010 15:40:09 +0000]
vnode alloc bitnumber returns bitnumber

fix function return types to match a bitnumber (int)
and comment the function appropriately

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

13 years agovlserver: prevent duplicate IPs via ChangeAddr
Andrew Deason [Wed, 5 May 2010 18:51:23 +0000]
vlserver: prevent duplicate IPs via ChangeAddr

Add a safety check in VL_ChangeAddr/ChangeIPAddr to check if we are
adding a duplicate server IP in the database. Return VL_MULTIPADDR
when we try to do that.

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

13 years agoWindows: define HAVE_SSIZE_T
Jeffrey Altman [Mon, 10 May 2010 00:46:11 +0000]
Windows: define HAVE_SSIZE_T

The windows param.*.h files define the ssize_t type.
Therefore, we must define HAVE_SSIZE_T in order to avoid
a collision with the ssize_t typedef in afs/stds.h.

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

13 years agoAdd a list of files to import from Heimdal
Simon Wilkinson [Sun, 9 May 2010 18:40:58 +0000]
Add a list of files to import from Heimdal

Add an initial list of files to import into OpenAFS from Heimdal.
Currently this is just the list that are required to support
our new configuration file parser.

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

13 years agoAdd a tool to import external repositories
Simon Wilkinson [Sun, 9 May 2010 18:37:52 +0000]
Add a tool to import external repositories

This commit adds a tool to aid with the importing of external git
repositories. import-external-git.pl allows a developer to easily
update the src/external portion of the tree to the latest release
of externally developed software. It's currently intended to support
our use of Heimdal functions, but could be extended to support any
project whose code we wish to use in the kernel, and which has a
git repo.

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

13 years agoWindows: fs.c requires size_t len not int len
Jeffrey Altman [Sun, 9 May 2010 02:41:39 +0000]
Windows: fs.c requires size_t len not int len

Missed one case of an 'int len' being passed into StringCbLength.

Also, remove one instance of 'int len' that was not used at all.

LICENSE MIT

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

13 years agoInclude common param file for Linux alpha builds
Russ Allbery [Thu, 6 May 2010 19:30:23 +0000]
Include common param file for Linux alpha builds

The sysname for Linux Alpha is alpha_linux_26 (or 24 or 22) with an
extra underscore before the version, unlike all the other Linux sysnames.
Allow for that case when deciding whether to include the common Linux
param header.

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

13 years agoDefine osi_procname for FBSD
Ben Kaduk [Fri, 7 May 2010 04:47:53 +0000]
Define osi_procname for FBSD

The kernel linker doesn't like to load modules with unresolved
(implicitly-defined) symbols (understandably).  Make it happy.

Change-Id: I23fdbb9c9e07a0c583580f5c5eee577a04fae278
Reviewed-on: http://gerrit.openafs.org/1925
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: sanket <sanket@sanketagarwal.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>

13 years agoActually fix build for FBSD80 after vcache refactoring
Ben Kaduk [Fri, 7 May 2010 03:31:26 +0000]
Actually fix build for FBSD80 after vcache refactoring

One more s/tvc/avc/

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

13 years agoAdd entries for FBSD 8.1 and 9.0
Ben Kaduk [Sun, 4 Apr 2010 23:34:24 +0000]
Add entries for FBSD 8.1 and 9.0

Though neither have been released, yet, RELENG_8 and HEAD are
starting to get changes that we need to conditionalize on.

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

13 years agoModernise use of AC_CHECK_TYPE
Simon Wilkinson [Thu, 6 May 2010 14:00:00 +0000]
Modernise use of AC_CHECK_TYPE

Prior to autoconf 2.13, AC_CHECK_TYPE took two arguments, the type
to check and the a default type to use if that type wasn't defined.
This usage has been deprecated since 2.13, and the AC_CHECK_TYPE
macro itself now behaves differently. Whilst there is a compatibility
mode, the autoconf documentation discourages its use.

We also have an occurence of a slightly more modern AC_CHECK_TYPE,
where we explicitly #define a default value if one isn't provided.
The autoconf manual also discourages this form, however, in favour
of using AC_CHECK_TYPES, and placing suitable typedefs in an
external header file.

Modify our code so we do things in the recommended way.

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

13 years agoAlways include afsconfig.h in autogenerated files
Simon Wilkinson [Thu, 6 May 2010 13:58:52 +0000]
Always include afsconfig.h in autogenerated files

Modify rxgen and compile_et so that the files they output always
contain afsconfig.h before afs/param.h. This avoids problems where
afs/param.h, or headers included from it, rely on having the results
of configure tests available.

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

13 years agoOpenBSD: Use osi_obsd_Free() for all releases of OBSD
Antoine Verheijen [Thu, 6 May 2010 15:10:38 +0000]
OpenBSD: Use osi_obsd_Free() for all releases of OBSD

Use osi_obsd_Free() in afs_osi_Free() for all releases of OpenBSD,
not just releases from 4.4 onward. Otherwise, afs_osi_Free() will
use AFS_KFREE, which does not exist, since OBSD/osi_machdep.h is
not included, resulting in unresolved symbols when trying to load
the kernel module.

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

13 years agoOpenBSD: Use FREE instead of KFREE
Antoine Verheijen [Thu, 6 May 2010 15:09:19 +0000]
OpenBSD: Use FREE instead of KFREE

In OpenBSD releases prior to 4.2, use the system (kernel-specific)
FREE macro to release space in the kernel module, not KFREE. The
latter does not exist and results in unresolved symbols when trying
to load the kernel module. (This was undoubtedly a typo.)

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

13 years agoAlways include afsconfig.h
Simon Wilkinson [Thu, 6 May 2010 13:55:59 +0000]
Always include afsconfig.h

Our coding standards say that OpenAFS source files should always have
 #include <afsconfig.h>
 #include <afs/param.h>
at the start of the file. Including just param.h, or having these
includes in a different order can produce unexpected effects, because
param.h includes sysnames.h, which in turn includes stds.h, which may
rely upon having the results of configure tests available.

Fix the obvious places in the Unix build which get this wrong.

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

13 years agoFix typo: LockType -> lockType
Marc Dionne [Wed, 5 May 2010 22:15:05 +0000]
Fix typo: LockType -> lockType

Fix simple typo that causes a build error.

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

13 years agofcntl write lock on readonly file error fix
Derrick Brashear [Sun, 2 May 2010 23:06:43 +0000]
fcntl write lock on readonly file error fix

apparently we return EROFS where we should return EBADF. Fix the
error the client gets; the RPC is unchanged (and indeed shouldn't
be changed)

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

13 years agoafsdump scan kill warnings
Derrick Brashear [Wed, 5 May 2010 19:50:07 +0000]
afsdump scan kill warnings

make prototypes for all initialize error table functions appear

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

13 years agofreebsd vcache splitting fallout
Derrick Brashear [Tue, 4 May 2010 15:39:19 +0000]
freebsd vcache splitting fallout

fix the vcache splitting to work again

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

13 years agoWindows: Secure C String usage in src\WINNT\afsd\fs.c
tharidufernando [Sat, 10 Apr 2010 03:31:16 +0000]
Windows: Secure C String usage in src\WINNT\afsd\fs.c

The use of strlen, strcat, strcpy, strncpy and sprintf in
src\WINNT\afsd\fs.c does not effectively protect against buffer
overruns and string truncation errors.  This patchset replaces
their use with StringCbLen, StringCbCat, StringCbCopy,
StringCbCopyN, StringCbCopyEx and StringCbPrintf respectively from
strsafe.h.

The functions sscanf, fscanf and scanf do not check for the size of
the parameters so it is prone to buffer overruns. These functions
can be replaced by sscanf_s, fscanf_s, scanf_s when the Visual Studio
compiler version is 1400 or greater.  Also memcpy will be replaced
by memcpy_s which will check for the size of the destination buffer.

In all cases, failure conditions are handled.

Patchset development was mentored by Asanka Herath and Jeffrey Altman.

Change-Id: I01e9dfc616641c220b57d2871e3e140406df3653
Reviewed-on: http://gerrit.openafs.org/1736
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Tharidu Fernando <tharidufernando@gmail.com>
Tested-by: Tharidu Fernando <tharidufernando@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>