openafs.git
11 years agobozo: dont lie when binding to any address
Michael Meffie [Thu, 30 Aug 2012 15:48:34 +0000]
bozo: dont lie when binding to any address

Do not log the bosserver listening to just the loopback when it is
actaully listening on any address.  The loopback address is still
written to the bosserver.rxbind file in this case to give local
scripts an simple way to contact the bosserver.

Fixes the log message introduces in
commit 9133aa6ed3a7fe2ae55b2d3242366ae277c7f726

Change-Id: I48f3ff5a1f9a20881df11a41baf3da29e1d02576
Reviewed-on: http://gerrit.openafs.org/8022
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agocrypto: Fix assert macro
Marc Dionne [Tue, 4 Sep 2012 23:48:12 +0000]
crypto: Fix assert macro

Commit ab977738b inadvertently changed osi_Assert to opr_Assert for
kernel code, causing the kernel build to produce an unloadable
module with undefined symbols.

Change-Id: I792359974ef21db97267847dfdf6c4b17c84328a
Reviewed-on: http://gerrit.openafs.org/8039
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoviced: Make use of unused variable
Marc Dionne [Tue, 4 Sep 2012 21:09:00 +0000]
viced: Make use of unused variable

Commit c2d724dc introduced the now variable that was set but never
used.  Use it in the remainder of the function where time(NULL)
appears, which was probably the intention.

Change-Id: I9cc25caf20dcfa466865c7fbf67893b022fdcc3e
Reviewed-on: http://gerrit.openafs.org/8038
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoopr: Convert to using libtool
Simon Wilkinson [Mon, 21 May 2012 17:04:32 +0000]
opr: Convert to using libtool

Convert opr so that it uses libtool. For backwards compatibility we
still build libopr.a, but we do so as a static convenience library.

As libopr.a may, in the future, be converted to an LWP library, change
all of the pthreaded binaries so that they link against the libtool
library liboafs_opr.la

Change-Id: Icee04ff4745334f06ffba16df5bb07fc9dcc0b54
Reviewed-on: http://gerrit.openafs.org/8034
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

11 years agovos: convertROtoRW incorrect warning when RO not in VLDB
Mark Vitale [Tue, 4 Sep 2012 13:06:44 +0000]
vos: convertROtoRW incorrect warning when RO not in VLDB

vos convertROtoRW will issue an incorrect warning about a partition
mismatch if the RO to convert is not in the VLDB.  Only check the
partition if the RO is in the VLDB.

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

11 years agoAdd libtool support
Simon Wilkinson [Mon, 21 May 2012 07:57:05 +0000]
Add libtool support

Add support for using libtool to the Unix build system to build
both pthreaded and lwp libraries. For purely pthread libraries,
this just provides convenience macros to invoke the standard GNU
libtool from the OpenAFS build system. For libraries that have
lwp variants, we provide an initial wrapper script - lwptool,
which handles building a non-PIC LWP object before asking libtool
to build the pthread variants.

For a given source example.c, example.o is the non-PIC pthread
object, .libs/example.o is the PIC pthread object, and
.lwp/example.o is the LWP object.

To use libtool for a particular library directory, add the line
    include @TOP_OBJDIR@/src/config/Makefile.libtool
to the file's preamble. Makefile.pthread, or Makefile.lwp should be
included as normal to indicate whether the libraries in this Makefile
are pthread only, or should be built for both pthread and LWP objects.

The variables LT_current, LT_revision and LT_age may be used to control
the version of the shared objects produced. They have the same meaning
as that documented in the Versioning section of the libtool manual.

The LT_objs variable should be set to a space separated list of the .lo
objects included in the library. Note that there should _never_ be a
dependency on the .o form of these objects in the Makefile, as this
breaks parallel builds.

LT_deps is a list of the libtool dependencies of the library, and
LT_libs is a list of the external (non-OpenAFS) library dependencies.

A file called <libraryname>.sym should be created which contains a
newline seperated list of all of the symbols exported from this
library.

LWP library names remain the same as always. To distinguish the
pthreaded static and shared libraries these

LWP libraries should be linked using
    libexample.a: $(LT_objs)
    $(LTLWP_LDLIB) $(LT_objs)

Shared libraries should be linked using
    libexample.la: $(LT_objs) $(LT_deps)

(note that the pattern rules in the included Makefile take care of the
 build rule here)

If necessary, static convenience libraries can be produced using:
    libconvenience.a: $(LT_objs)
    $(LTLWP_LDLIB_static) $(LT_objs)

PIC convenience libaries can be linked using:
    libconvenience_pic.a: $(LT_objs)
    $(LTLWP_LDLIB_pic) $(LT_objs)

Libtool libraries should be installed using the $(LT_INSTALL_DATA) macro

Binaries linking agains libtool libraries should be linked using the
$(LT_LDRULE) or $(LT_LRDULE_static) options, with library paths in the
built locations relative to the top of the tree. For example

example_test: example_test.o $(top_builddir)/src/example/libexample.la
$(LT_LDRULE) example_test.o \
     $(top_builddir)/src/example/libexample.la

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

11 years agoutil: Don't use rx-internal locking macros
Simon Wilkinson [Wed, 22 Aug 2012 08:31:03 +0000]
util: Don't use rx-internal locking macros

The MUTEX_INIT, MUTEX_ENTER, MUTEX_EXIT and MUTEX_DESTROY macros
are intended for RX internal use only (they're an abstraction
interface so that the same locking code can be used in userspace and
in the kernel). They aren't appropriate for general purpose use.

Just use pthread calls directly for the serverLog locks.

Change-Id: I8373eaa097c36f7d3a4c9b0501fc5e897372582e
Reviewed-on: http://gerrit.openafs.org/8031
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agolwp: Don't depend on RX locking macros
Simon Wilkinson [Sun, 10 Jul 2011 12:50:03 +0000]
lwp: Don't depend on RX locking macros

The lwp library should be independent of RX (in fact, bits of it are
a dependency for RX). So, LWP cannot use the MUTEX_ENTER, CV_WAIT, and
so on macros that RX defines.

Just implement these natively within the pthreaded bits of lock.c to
remove the dependency.

Change-Id: I4cdb8313e791f253e84bbc4e256087e46a4c59bd
Reviewed-on: http://gerrit.openafs.org/5396
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoFurther rationalise our usage of assert()
Simon Wilkinson [Wed, 7 Sep 2011 13:59:17 +0000]
Further rationalise our usage of assert()

This patch futher improves our usage of assert() and friends. The
intention is to bring clarity to which forms of assert are used in
which situations, and to solve the problem of assert(X), or
osi_Assert(X) being used in a situation where X has side-effects.

It introduces two new assertion macros opr_Assert() and opr_Verify(),
and clarifies the usage of osi_Assert() and assert().

*) opr_Assert is a direct equivalent of assert(), with the exception
   that its output can be redirected to a log file when used in server
   code. It is the preferred version of assert for libraries, and server
   side code. Note that whilst opr_Assert doesn't currently become a
   no-op when NDEBUG is defined, the intention is that it will do so at
   some point in the future.
*) opr_Verify(X) asserts if the value of X is false. Unlike assert()
   it will always run X, regardless of whether the value is checked or
   not. The eventual intention is that when NDEBUG is defined,
   opr_Verify(X) => X
*) osi_Assert is an assertion macro intended for use in kernel code,
   or in mixed kernel/userland code. When code is built for userspace,
   osi_Assert(X) => opr_Assert(X)
*) assert is the system's own assert macro. It should only be used
   in client code. Whilst a header (opr_assert.h) is provided to map
   assert() to opr_Assert(), its use is discouraged

Change-Id: Ie6d61305686bdc7193cc8690e6f4fbe363211faf
Reviewed-on: http://gerrit.openafs.org/5395
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agolwp: Fast time doesn't need util
Simon Wilkinson [Thu, 24 May 2012 08:12:13 +0000]
lwp: Fast time doesn't need util

With the rise of roken, the fasttime file no longer depends on util

Change-Id: I2a1391d13bb39321666889dcfc2fbf43b181c749
Reviewed-on: http://gerrit.openafs.org/8030
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoviced: Don't use fasttime
Simon Wilkinson [Thu, 24 May 2012 09:55:07 +0000]
viced: Don't use fasttime

For pthreaded builds, the FT_ routines are just wrappers around
gettimeofday() and time(). As viced is now an entirely pthreaded
directory, improve readibility, and reduce our dependencies, by
just calling the operating system routines directly.

Change-Id: I3812ac31bc5eb7d2fcbe47d037d4af3d489d3b81
Reviewed-on: http://gerrit.openafs.org/8029
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoFix aliasing problems in tptserver
Simon Wilkinson [Tue, 4 Sep 2012 11:33:02 +0000]
Fix aliasing problems in tptserver

Commit f2db78a346112f5320efc6f0b6b9fe4ae0d893d3 disabled strict
aliasing for ptutils.c and ptprocs.c when built in the ptserver
directory. Similarly disable aliasing checks for these files when
built in the tptserver directory.

This doesn't actually fix the significant problems with these files,
but doing so is going to require completely reworking the way that
supergroups is implemented, so just disable these optimisations in
the compiler for now.

Change-Id: I6857ba83238a2c98a6540c795426f1a4038b70b3
Reviewed-on: http://gerrit.openafs.org/8035
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agolog: Relocate pagsh
Simon Wilkinson [Sun, 20 May 2012 16:43:10 +0000]
log: Relocate pagsh

Move the pagsh utility out of sys, and into log. This moves it closer
to other token and PAG related utilities, and resolves a circular
dependency between sys and auth.

Change-Id: Ibbbfc0e3bebc9ecb70f05b137e10e65ff9e4aff6
Reviewed-on: http://gerrit.openafs.org/8028
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoauth: Relocate NetRestrict support functions
Simon Wilkinson [Sun, 20 May 2012 11:57:00 +0000]
auth: Relocate NetRestrict support functions

Pull the NetRestrict and NetInfo support functions out of libutil,
and into libauth. This starts to concentrate all of our configuration
file parsing functions into the same place.

It also gets rid of a circular dependency. NetRestrict parsing relies
on functions from rx, so with this in libutil, we had the dependency
chain util->rx->util

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

11 years agoUse rk_rename from roken
Simon Wilkinson [Sat, 19 May 2012 19:36:12 +0000]
Use rk_rename from roken

Rather than using our own renamefile() implementation on Windows,
pull in rk_rename() from libroken wherever a rename which unlinks
the destination file is required.

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

11 years agoImport of code from heimdal
Heimdal Developers [Fri, 31 Aug 2012 12:14:51 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
4a438db29d361b7e5f47b86ced1482a96cde86ea (switch-from-svn-to-git-3008-g4a438db)

New files are:
roken/rename.c

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

11 years agoroken: Add rename.c to list of imported files
Simon Wilkinson [Sat, 19 May 2012 19:29:00 +0000]
roken: Add rename.c to list of imported files

Change-Id: I835bf47625b7f0b3e025df4388416d88f3c52506
Reviewed-on: http://gerrit.openafs.org/8024
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoupdate libafsdep to include external without being in 3rd party dirs
Derrick Brashear [Fri, 31 Aug 2012 12:09:31 +0000]
update libafsdep to include external without being in 3rd party dirs

everything below src/external is managed out of other trees,
put our libafsdep at the top

Change-Id: I5f8e37afca30934f2f7befb17d1b19f4e3d12601
Reviewed-on: http://gerrit.openafs.org/8023
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoLINUX: Detect non-vectorized aio functions
Andrew Deason [Wed, 29 Aug 2012 19:14:39 +0000]
LINUX: Detect non-vectorized aio functions

In kernels before 027445c3, the functions generic_file_aio_read and
generic_file_aio_write, as well as the fs operations aio_read and
aio_write, do not deal with iovecs but rather just use a single
buffer. Detect this, so our aio_read and aio_write implementations
have the correct signatures.

This removes several warnings on such kernels.

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

11 years agoLINUX: make d_automount work properly on rhel5 kernels
Michael Meffie [Fri, 17 Aug 2012 17:25:17 +0000]
LINUX: make d_automount work properly on rhel5 kernels

Recent centos/rhel 5 kernels (2.6.18-308.*) started providing the
d_automount operation, but renamed the DCACHE_NEED_AUTOMOUNT flag to
DMANAGED_AUTOMOUNT.

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

11 years agoLINUX: Use struct vfs_path on RHEL5
Andrew Deason [Wed, 29 Aug 2012 16:39:01 +0000]
LINUX: Use struct vfs_path on RHEL5

Some revisions of the kernel from RHEL5 (2.6.18-308.* and possibly
others) renamed 'struct path' to 'struct vfs_path'. So, use
'struct vfs_path' when it exists.

This introduces the afs_linux_path_t typedef, which is defined as
either a struct path, or struct vfs_path.

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

11 years agoautoconf: add AC_CHECK_LINUX_TYPE macro
Andrew Deason [Thu, 30 Aug 2012 12:06:33 +0000]
autoconf: add AC_CHECK_LINUX_TYPE macro

add a macro which looks for a given type in a given linux kernel
header file

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

11 years agovldb_check: fix cross-linked mh entries
Michael Meffie [Wed, 15 Aug 2012 21:19:07 +0000]
vldb_check: fix cross-linked mh entries

When run with -fix, consolidate server numbers in vl entries which
point to the same multi-homed entry. Use the lowest server number
from the set of server numbers which point to the same multi-homed
entry.

Remove unreferenced address entries which are duplicate multi-homed
indexes.

Two passes of vldb_check -fix may be required; first to fix the
vl entry server numbers; then to remove the duplicate address
entries.

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

11 years agoLINUX: Indent osi_machdep.h maze
Andrew Deason [Wed, 29 Aug 2012 16:34:06 +0000]
LINUX: Indent osi_machdep.h maze

This one isn't so bad, actually, but it still benefits from some
indentation.

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

11 years agolibafs: actually set hasno64bit flag
Derrick Brashear [Fri, 24 Aug 2012 19:04:40 +0000]
libafs: actually set hasno64bit flag

if we're starting a 64 bit data op, we should also end it,
and vice versa.

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

11 years agoout-of-tree-build: extend configuration,
Christof Hanke [Fri, 24 Aug 2012 03:18:31 +0000]
out-of-tree-build: extend configuration,

namely libafsdep-files and configure-libafs.ac
so that building the kernel-module on linux in a separate
obj-directory works.

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

11 years agovos: convertROtoRW susceptible to VLDB changes during override prompt
Mark Vitale [Mon, 20 Aug 2012 21:39:06 +0000]
vos: convertROtoRW susceptible to VLDB changes during override prompt

vos convertROtoRW obtains a VLDB entry, then peforms some setup logic
(including a possible user prompt) before obtaining a volume lock.
This exposes the code to possible time-of-check/time-of-use issues.
After obtaining the volume lock, get a second copy of the VLDB entry
and compare it to the first copy; if it has changed, fail the conversion
with an error message asking the user to re-issue the vos convertROtoRW
command.

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

11 years agofileserver: add volume number to error-messages
Christof Hanke [Wed, 22 Aug 2012 14:39:13 +0000]
fileserver: add volume number to error-messages

in physio. If things go wrong in ReallyRead() or
ReallyWrite(), the admin would like to know which
volume to salvage.

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

11 years agoLinux: include kthread.h before afs includes
Marc Dionne [Tue, 14 Aug 2012 23:37:00 +0000]
Linux: include kthread.h before afs includes

We need to include kthread.h before the afs standard includes
to avoid clashing with the printf -> printk mapping.

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

11 years agoLinux 3.6: lookup inode operation API change
Marc Dionne [Tue, 14 Aug 2012 22:26:24 +0000]
Linux 3.6: lookup inode operation API change

The nameidata argument is replaced with an unsigned int flags
argument.

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

11 years agoLinux 3.6: revalidate dentry op API change
Marc Dionne [Tue, 14 Aug 2012 22:08:51 +0000]
Linux 3.6: revalidate dentry op API change

The nameidata argument is dropped, replaced by an unsigned flags
value.  The configure test is very specific; kernels with the
older API with a signed int flags value should fall through.

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

11 years agoLinux 3.6: create inode operation API change
Marc Dionne [Tue, 14 Aug 2012 21:28:50 +0000]
Linux 3.6: create inode operation API change

The nameidata argument is dropped and a flag is added.

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

11 years agoLinux: fix variable used to test for the iop create API
Marc Dionne [Tue, 14 Aug 2012 21:11:08 +0000]
Linux: fix variable used to test for the iop create API

Use correct variable when testing for the create API to use.

This is just for looks - there is no effect since mkdir and create
were changed in the same kernel release.

Change-Id: I9e43cc80d3817ee8a6c339c4ae98a1a2ab0851a1
Reviewed-on: http://gerrit.openafs.org/7984
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoLinux 3.6: d_alias and i_dentry are now hlists
Marc Dionne [Tue, 14 Aug 2012 01:55:25 +0000]
Linux 3.6: d_alias and i_dentry are now hlists

The d_alias pointer is now the head of an hlist.  This means the
iterator is a different macro and has no "reverse" version since
hlists have no direct pointer to the list tail.

inode->i_dentry gets the same treatment.  Adjust where we use it.

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

11 years agoLinux 3.6: dentry_open API change
Marc Dionne [Tue, 14 Aug 2012 01:36:15 +0000]
Linux 3.6: dentry_open API change

dentry_open now takes a path argument that combines the dentry and
the vfsmount pointers.
Add a configure test and a new compat inline function to keep things
cleaner in the main source file.

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

11 years agoLinux 3.6: kmap_atomic API change
Marc Dionne [Tue, 14 Aug 2012 20:34:42 +0000]
Linux 3.6: kmap_atomic API change

kmap_atomic no longer requires a KM_TYPE argument.  Test for this
and adjust the affected code.

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

11 years agoLinux: bypass: consolidate copy_page macros into a single function
Marc Dionne [Tue, 14 Aug 2012 00:32:08 +0000]
Linux: bypass: consolidate copy_page macros into a single function

The copy_page(s) macros are very similar; combine them into a
single function that can be used for all cases.

This will make it easier to add some pre-processor logic around
the kmap_atomic calls to adapt to Linux API changes.

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

11 years agovos: use the roken max macro
Michael Meffie [Thu, 16 Aug 2012 22:04:22 +0000]
vos: use the roken max macro

Use the max macro provided by roken. Fixes builds on
solaris.

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

11 years agoImport of code from heimdal
Heimdal Developers [Thu, 16 Aug 2012 21:26:07 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
4a438db29d361b7e5f47b86ced1482a96cde86ea (switch-from-svn-to-git-3008-g4a438db)

Upstream changes are:

Michael Meffie (1):
      drop __restrict some more, to please old compilers

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

11 years agoWindows: disable short names on Win7 and 2008 R2
Jeffrey Altman [Wed, 15 Aug 2012 04:53:21 +0000]
Windows: disable short names on Win7 and 2008 R2

After listening to a presentation from Microsoft's file system
team and speaking with anti-virus vendors, it is not only safe
to disable ShortNames on non-boot volumes in Win7 and 2008 R2
but it is a definite win for performance, stability and security
of the system.

Change-Id: I706a8a17b0ae76189aeebaf254c8c70739d12f09
Reviewed-on: http://gerrit.openafs.org/7989
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoafs_server: afs_SetServerPrefs() can never be called with null
Garrett Wollman [Tue, 31 Jul 2012 02:16:40 +0000]
afs_server: afs_SetServerPrefs() can never be called with null

The one and only call site never calls afs_SetServerPrefs() with a
null pointer, and some but not all of the paths through the #ifdefs
assume this.  Remove code that checks for this; it confuses both
humans and the static analyzer.

Change-Id: Ie3f7319cebde9ec3078af2defcebb80692aa95f2
Reviewed-on: http://gerrit.openafs.org/7912
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

11 years agoopr: Add opr_jhash_opaque
Simon Wilkinson [Tue, 17 Jul 2012 16:20:13 +0000]
opr: Add opr_jhash_opaque

Add a function which can be used to obtain a hash of an arbitrary
opaque string of arbitrary length

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

11 years agovlserver: use the logging function to log
Michael Meffie [Sat, 28 Jul 2012 17:17:55 +0000]
vlserver: use the logging function to log

Use the logging function to log instead of printf.

Change-Id: I377474881830152c93122bd3112e355ab5fd56ad
Reviewed-on: http://gerrit.openafs.org/7895
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoopr: Add UUID handling functions
Simon Wilkinson [Tue, 17 Jul 2012 15:50:59 +0000]
opr: Add UUID handling functions

Add a set of functions to the opr library to handle creating and
manipulating UUIDs.

The opr_uuid_t type is held as a 16 octet character string, which
comprises the UUID encoded into network byte order. This is the
primary form for manipulating UUIDs with this library, as it avoids
any nbo/hbo problems.

For applications which require raw access to the UUID components,
the opr_uuid_unpacked structure is provided, and
opr_uuid_pack/opr_uuid_unpack can be used to convert to and from
this format.

Finally, functions to print the UUID as a string, and parse a UUID
from a string, are provided. When printing, we use the standard UUID
format of 000000-0000-0000-0000-00000000. However, the afsUUID library
used to print UUIDs as 000000-0000-0000-00-00-00000000, so we also
accept this format.

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

11 years agoopr: Convert jhash to use AFS types
Simon Wilkinson [Tue, 17 Jul 2012 16:15:15 +0000]
opr: Convert jhash to use AFS types

Convert the jhash.h header so that it uses afs types (afs_uint32)
rather than stdint types (uint32_t), so that we can use it in kernel

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

11 years agohcrypto: Export hc_RAND_bytes
Simon Wilkinson [Tue, 17 Jul 2012 16:12:51 +0000]
hcrypto: Export hc_RAND_bytes

Export the RAND_bytes function from hcrypto, so that we can have
access to hcrypto's random number generator from generic code.

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

11 years agorx: Add the add_and_read function to our atomics
Simon Wilkinson [Mon, 9 Jul 2012 09:27:17 +0000]
rx: Add the add_and_read function to our atomics

Add rx_atomic_add_and_read, which lets us get the new value out
of an atomic addition operation.

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

11 years agolibafs: use kthread_run when available
Tom Keiser [Tue, 10 Apr 2012 20:26:42 +0000]
libafs: use kthread_run when available

Use the kthread_run interface on linux to create kernel
threads.  This interface allows all the cpus to schedule
afsd threads, instead of just inheriting the cpu affinity of
the main afsd thread.

Written by Tom Keiser.

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

11 years agovlserver: fix vldb header initialization
Michael Meffie [Sat, 28 Jul 2012 15:37:59 +0000]
vlserver: fix vldb header initialization

Avoid creating new vldb files with zeroed header data.

The code path is as follows; The call to Init_VLdbase makes several
passes. On the first pass, the header is found to be empty, and so a
write lock is obtained on the second pass.  On this second pass,
UpdateCache creates a newly initialized header and writes it to the
db.  The rd_cheader is set to the newly created header data, and the
wr_cheader is still cleared at this point.

When the transaction on the second pass ended in Init_VLdbase, the
data is committed and vlsynccache() is called.  In this call to
vlsynccache(), the cleared write header buffer (wr_cheader) is
copied over the newly initialized rd_cheader buffer.  Init_VLdbase
then returns to the caller, and if the caller writes to the db, the
header on disk is then cleared.

Instead of initializing the read header buffer when rebuilding the
db header, initialize the write header buffer. When the ubik
transaction is ended, the call to vlsynccache() updates the contents
of the read header buffer with contents of the new/rebuilt header.

This error was introduced with commits:
  a0f416e3504929b304fefb5ca65e2d6a254ade2e
  1f532d099b8b084d43dd0140890448464325b602

Change-Id: If9c178bf28c55c50311554b12ffff9404785d052
Reviewed-on: http://gerrit.openafs.org/7894
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agovldb_check: remove unreferenced mh entries with -fix
Michael Meffie [Thu, 28 Jun 2012 21:12:24 +0000]
vldb_check: remove unreferenced mh entries with -fix

When running vldb_check with -fix, clear any mh extent entries which
are set but are not referenced by an address entry in the
IpMappedAddr table.  These unreferenced entries already generated a
warning.  This commit adds the feature to clear the unreferenced mh
entries using vldb_check -fix option.

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

11 years agovldb_check: warn about cross-linked mh entries
Michael Meffie [Fri, 29 Jun 2012 22:10:31 +0000]
vldb_check: warn about cross-linked mh entries

Warn if an mh extent entry is referenced by more than one server
number in the IpMappedAddr table.

The serveraddr table is used to determine which server numbers have
IP addresses.  If, for some reason, multiple server numbers
reference the same mh entry, currently, the correct serveraddr value
is calculated only for the lowest server number in the set of server
numbers which reference the same mh entry.  Handle this case, and
warn about the duplicated values in the IpMappedAddr table.

Warn about IpMappedAddr entries which reference non-existent mh
blocks.

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

11 years agoWindows: AFSProcessUserFsRequest NULL dereference
Jeffrey Altman [Mon, 13 Aug 2012 21:56:02 +0000]
Windows: AFSProcessUserFsRequest NULL dereference

Protect against an Irp with a NULL FsContext2 field.
These represent Irps that are not intended for our device
since they do not have an AFSCcb associated with it.

Change-Id: I2cf6b60e022df5074482544ef3142374149e38d6
Reviewed-on: http://gerrit.openafs.org/7971
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: reset volume NOEXIST flag
Jeffrey Altman [Mon, 13 Aug 2012 02:51:54 +0000]
Windows: reset volume NOEXIST flag

In response to fs checkvolumes the NOEXIST flag should be reset.

It should also be reset if the volume location update fails
because of a commumicaton (or other) error with the VLDB server.
The volume's lastUpdateTime is refreshed on error.

Change-Id: I0bb5e61b9eb8a9613d47a32acda35b79aa71c293
Reviewed-on: http://gerrit.openafs.org/7969
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: sdk install missing headers
Jeffrey Altman [Fri, 3 Aug 2012 04:13:45 +0000]
Windows: sdk install missing headers

Change-Id: Ifda4df6b736ca70e2cbe56e9d789436066c12bdb
Reviewed-on: http://gerrit.openafs.org/7933
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: remove sdk sample token.c
Jeffrey Altman [Fri, 3 Aug 2012 04:12:25 +0000]
Windows: remove sdk sample token.c

The sdk sample is no longer applicable.

Change-Id: I9ab240429c73fece70f62f6ebc8ed284aa0071ac
Reviewed-on: http://gerrit.openafs.org/7932
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: document command prompt lnk limitation
Jeffrey Altman [Fri, 10 Aug 2012 22:04:49 +0000]
Windows: document command prompt lnk limitation

Command Prompt shortcuts cannot be used when stored in AFS.

Change-Id: I5e26d92bbcaac8708eb8deb8d06164ef65308230
Reviewed-on: http://gerrit.openafs.org/7955
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Freelance Discovery configuration
Jeffrey Altman [Wed, 8 Aug 2012 20:42:47 +0000]
Windows: Freelance Discovery configuration

Add new "FreelanceDiscovery" configuration option to permit
Freelance dynroot mode to be used without the automatic discovery
of cells and generation of mount points.

Change-Id: I5520c3b3e2388b984c7120212d4f0167dc2f2bc3
Reviewed-on: http://gerrit.openafs.org/7950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: disable short names on Windows 8
Jeffrey Altman [Wed, 8 Aug 2012 17:54:48 +0000]
Windows: disable short names on Windows 8

Add "ShortNames" option to control whether 8.3 compatible short
names are generated for objects stored in AFS.   Set the default
to on for all operating systems prior to Windows 8 and Server 2012.

Change-Id: I27b4631334e2739da5c6485b49efa3ae12d880a9
Reviewed-on: http://gerrit.openafs.org/7949
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: FileNormalizedNameInformation take one
Peter Scott [Tue, 7 Aug 2012 13:07:41 +0000]
Windows: FileNormalizedNameInformation take one

Add a response to FileNormalizedNameInformation requests.
Respond with the long file name.  As yet there is no translation
from short name to long name for full paths.

Change-Id: I9a88985cb72ebf4ce648cada62522f769f50044b
Reviewed-on: http://gerrit.openafs.org/7948
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: FSCTL_SET_PURGE_FAILURE_MODE
Peter Scott [Mon, 6 Aug 2012 19:15:57 +0000]
Windows: FSCTL_SET_PURGE_FAILURE_MODE

Windows 8 adds FSCTL_SET_PURGE_FAILURE_MODE.  Failure to respond
with success prevents anti-virus filters from scanning the file
system.  For now just return success.

Change-Id: Ibb4822e1a9db13912980f4100519b69f9bff9a75
Reviewed-on: http://gerrit.openafs.org/7947
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: disable short names in redirector option
Peter Scott [Mon, 6 Aug 2012 19:12:12 +0000]
Windows: disable short names in redirector option

If requested during redirector initialization, disable short
name processing.   Future versions of Windows (8, Server 2012,
and beyond) will no longer require short names.

Change-Id: I14b20afd919ed9dd8dc48dd7997089b5748a8896
Reviewed-on: http://gerrit.openafs.org/7946
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Consolidate Device Flags
Peter Scott [Mon, 6 Aug 2012 16:59:35 +0000]
Windows: Consolidate Device Flags

Move Device Flags to common/AFSRedirCommonDefines.h

Change-Id: I1f54b1bcf6f9057cc56260c61c86dc3203891924
Reviewed-on: http://gerrit.openafs.org/7945
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoihandle: don't keep reallyclosing future fds
Derrick Brashear [Mon, 21 Nov 2011 17:06:59 +0000]
ihandle: don't keep reallyclosing future fds

given that we can mark something invalid for future use, ever,
once we have done so for all fds, we ih_reallyclose is done.
don't persist the setting to the detriment of new fds

Change-Id: If82368dad79841a5d68f45a608b2645b32f951e7
Reviewed-on: http://gerrit.openafs.org/6101
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agolibafs: revert init req to use the real uid
Michael Meffie [Thu, 2 Aug 2012 21:24:02 +0000]
libafs: revert init req to use the real uid

The commit to use wrappers for creditial structure access
inadvertently changed the user id to be the effective uid instead of
the real uid, when no PAG is present, on linux.  Revert this so
setuid programs continue to work.

See commit eb8e55bba7740a87e07ef07bb4b789e6d4e36f0d

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

11 years agovos: convertROtoRW may create 2nd RW on a fileserver
Mark Vitale [Thu, 2 Aug 2012 22:37:05 +0000]
vos: convertROtoRW may create 2nd RW on a fileserver

If an RW is already present on disk on the target server (any partition),
'vos convertROtoRW' will still convert the RO, creating a second RW on the server.
Detect this and refuse to convert the RO by returning EXDEV (invalid cross-device link).

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

11 years agorx: Process ICMP unreachable errors
Andrew Deason [Thu, 2 Aug 2012 15:58:12 +0000]
rx: Process ICMP unreachable errors

When a machine receives ICMP errors, we can detect them in
AFS_RXERRQ_ENV environments. Many of these errors indicate that a
machine is not reachable, so we are guaranteed to not get a response
from them. When we get such an error for a particular peer, mark all
relevant calls with an RX_CALL_DEAD error, since we know we won't get
a response from them. This allows some calls to dead/unreachable hosts
to fail much more quickly.

Do not immediately kill new calls, since obviously the host may have
come back up since then (or the routing/firewall/etc was fixed), but
only calls that were started before the current error was received.

Note that a call doesn't actually notice until the next rxi_CheckCall,
since directly killing each of the relevant calls would be rather
slow. So, we don't notice a dead peer immediately, though we notice
much more quickly than we used to.

Reorganize the error queue processing a little bit to make this easier
to do.

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

11 years agoLINUX: Fix error queue processing
Andrew Deason [Wed, 1 Aug 2012 20:31:09 +0000]
LINUX: Fix error queue processing

Receiving error queues in the Linux kernel is a little different from
userspace. When we encounter a cmsg that is not CMSG_OK, we need to
break out of the loop, and not just continue, since we can keep trying
to process the same cmsg over and over. In addition, on successful
return, the msg_control buffer has been modified to point to the next
available buffer space, and msg_controllen contains how many bytes are
remaining. So, we need to adjust the msg_control and msg_controllen
values to get something more familiar.

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

11 years agoLINUX: Avoid SO_ERROR for RXERRQ_ENV
Andrew Deason [Wed, 1 Aug 2012 19:56:27 +0000]
LINUX: Avoid SO_ERROR for RXERRQ_ENV

SO_ERROR is for receiving errors from some nonblocking operations; it
has little relevance to our network operations. For Linux, use a
similar structure as userspace error detection, instead of SO_ERROR.

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

11 years agorx: Create AFS_ADAPT_PMTU and AFS_RXERRQ_ENV
Andrew Deason [Wed, 1 Aug 2012 19:19:02 +0000]
rx: Create AFS_ADAPT_PMTU and AFS_RXERRQ_ENV

Currently we have the ADAPT_PMTU define, which turns on functionality
in Linux to detect PMTU-related ICMP errors for Rx. However, this is
really turning on two separate pieces of functionality: the PMTU
processing, and the processing for ICMP errors in general.

So split this out into two defines: AFS_ADAPT_PMTU, and
AFS_RXERRQ_ENV. The former is for processing PMTU discovery, and the
latter is for processing ICMP errors. Both of these are left disabled
due to issues in the error processing. Although PMTU discovery is the
only functionality which makes use of ICMP errors, this will change in
the future.

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

11 years agoLINUX24: Remove ADAPT_PMTU code
Andrew Deason [Wed, 1 Aug 2012 19:14:23 +0000]
LINUX24: Remove ADAPT_PMTU code

ADAPT_PMTU on Linux 2.4 doesn't really seem worth it. Remove it so we
don't have to duplicate code.

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

11 years agorx: Formatting fixes
Andrew Deason [Wed, 1 Aug 2012 19:11:48 +0000]
rx: Formatting fixes

Some minor fixes to preprocessor indentation and other minor
formatting things in rx.c and rx_user.c.

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

11 years agorx: Remove ADAPT_MTU and MISCMTU
Andrew Deason [Wed, 1 Aug 2012 18:57:06 +0000]
rx: Remove ADAPT_MTU and MISCMTU

Ever since 5bcf626ddaf92e199c4b46c11ad276013a47db52, ADAPT_MTU has
been unconditionally defined. MISCMTU has always been unconditionally
defined, and not used anywhere. Remove both of these, assuming they
are always defined.

Note that ADAPT_MTU != ADAPT_PMTU.

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

11 years agobozo: avoid canceling the sigkill timer for hung processes
Michael Meffie [Wed, 1 Aug 2012 15:42:34 +0000]
bozo: avoid canceling the sigkill timer for hung processes

A sigkill signal is sent to fileserver processes when a timeout is
exceeded for shutting down processes for the fs/dafs bnode.
(Currently 30 minutes for the fileserver, 1 minute for the other
server processes.)

If the bnode goal is set to run before this timeout expires, the
timer is incorrectly stopped, and a wedged process is never killed.
Fix this by not canceling the timer when a fs/dafs process has been
signaled to shutdown, regardless of the current goal.

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

11 years agolibafscp: Add afscp_LocalAuthAs
Andrew Deason [Fri, 30 Mar 2012 19:56:52 +0000]
libafscp: Add afscp_LocalAuthAs

Add the function afscp_LocalAuthAs to libafscp. This allows the caller
to generate credentials based on the KeyFile on local disk, in order
to appear as an arbitrary user.

Based on code written by YFS.

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

11 years agoLINUX: Always hold afs_xuser for unixuser read
Andrew Deason [Tue, 31 Jul 2012 18:40:41 +0000]
LINUX: Always hold afs_xuser for unixuser read

We were failing to hold the afs_xuser lock when we entered our
unixuser traversal for the first time (when the given position is 0).
This means we can release the lock without acquiring it, causing all
kinds of weird behavior.

Just always grab afs_xuser on entry. We could possibly do some tricks
to avoid grabbing this lock until after we've printed the column
headers, but it does not seem worth it.

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

11 years agokrb5 profile config support
Derrick Brashear [Mon, 30 Jul 2012 13:52:24 +0000]
krb5 profile config support

create openafs-client.conf and openafs-server.conf in respective ETC
dirs. enable afsd, ptserver, vlserver and fileserver option parsing from it

[afsd]
            dynroot = true
            dcache = 800
            cachedir = /var/db/openafs/cache

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

11 years agoLINUX: Do not lookup immediately recursive mtpts
Andrew Deason [Fri, 6 Apr 2012 19:56:07 +0000]
LINUX: Do not lookup immediately recursive mtpts

On Linux, having a mountpoint in a volume root that points to the same
volume can cause serious problems. By 'immediately recursive', I mean
a situation like the following:

fs mkm mtpt vol
fs mkm mtpt/mtpt vol

If there are multiple dentry aliases for the directory (which is
possible if the directory is a mountpoint), an 'rmdir' on the
recursive mountpoint can cause the client to deadlock. Since the
'rmdir' code path in Linux locks the parent directory inode to perform
the rmdir, and locks the child directory inode after performing a
couple of sanity checks. For an immediately recursive mountpoint,
these two inodes are the same, and so we will deadlock.

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

11 years agoLinux: Make dir dentry aliases act like symlinks
Andrew Deason [Fri, 6 Jul 2012 21:37:39 +0000]
Linux: Make dir dentry aliases act like symlinks

Currently, we try to invalidate other dentries that exist for a
particular dir inode when we look up a dentry. This is so we try to
avoid duplicate dentries for a directory, which Linux does not like
(you cannot have hardlinks to a dir).

If we cannot invalidate the other aliases (because they are being
used), right now we just return the alias. This can make it very easy
to panic the client, due to the sanity checks Linux performs when dong
things like 'rmdir'. If we do something like this:

mkdir dir1
fs mkm dir1/mtpt vol
mkdir dir1/mtpt/dir2
fs mkm dir1/mtpt/dir2/mtpt2 vol
cd dir1/mtpt
rmdir dir2/mtpt2

For the 'rmdir', we will lookup 'mtpt2'. Since 'mtpt' and 'mtpt2'
are mountpoints for the same volume, their dentries point to the same
directory inode. So when we lookup 'mtpt2', we will try to invalidate
the other dentry, but we cannot do that since it is the cwd. So we
return the alias dentry (for 'mtpt'). The Linux VFS layer then does a
sanity check for the rmdir operation, checking that the child dentry's
parent inode is the same as the inode we're performing the rmdir for.
Since the dentry we returned was for 'mtpt', whose parent is 'dir1',
and the actual dir we're performing the rmdir for is 'dir2', this
sanity check fails and we BUG.

To avoid this, make the dentry alias act like a symlink when we
encounter an uninvalidateable dentry alias. That is, we allow multiple
dentry aliases for a directory, however, when the dentry aliases are
actually used, we redirect to a common dentry (via d_automount where
possible, and follow_link elsewhere).

This means that such mountpoints will behave similarly to symlinks, in
that we 'point' to a specific mountpoint dentry. This means that if we
have multiple different ways to get to the same volume, and all are
accessed at the same time, all but one of those mountpoints will
behave like symlinks, pointing to the same mountpoint. So, the '..'
entries for each path will all point to the parent dir of one
mountpoint, meaning that the '..' entry will be "wrong", but for most
cases it will still be correct.

In order to try to make the 'target', pointed-to directory consistent,
we add a new field to struct vcache: target_link. This points to the
dentry we should redirect to, whenever that vcache is referenced. To
avoid (possibly not-feasibly-solvable) problems with refcounting, this
pointer is not actually a reference to the target dentry, but just
serves as a pointer to compare to.

FIXES 130273

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

11 years agodirpath: fix macos alternate client etc dir support
Derrick Brashear [Tue, 31 Jul 2012 15:47:58 +0000]
dirpath: fix macos alternate client etc dir support

we set a proper client etc dirpath but did not apply
it to children. do so.

Change-Id: I56da943838a13859a239e5edf4219c6400abfe35
Reviewed-on: http://gerrit.openafs.org/7904
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

11 years agoafs_server: delete code that has been ifdef'ed out for years
Garrett Wollman [Tue, 31 Jul 2012 02:05:04 +0000]
afs_server: delete code that has been ifdef'ed out for years

The comments in afs_SetServerPrefs() said "clean up, delete this".
The oldest one is a decade old.  Removing these #ifdefs will make
following the rest of the spaghetti #ifdefs a bit easier.

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

11 years agolibafs: afs_CacheFetchProc can't be called without a dcache pointer
Garrett Wollman [Tue, 9 Aug 2011 04:28:27 +0000]
libafs: afs_CacheFetchProc can't be called without a dcache pointer

An inspection of the only call site suggests that afs_CacheFetchProc()
can't be called with a null dcache pointer, and code further down
in this function dereferences adc unconditionally (assuming
rxfs_fetchInit() doesn't crash first) so remove the conditional
here.

Probably more of these parameters can and should be included in the
AFS_NONNULL.

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

11 years agodoc: Windows Release Notes Integrated Logon
Jeffrey Altman [Mon, 30 Jul 2012 19:19:57 +0000]
doc: Windows Release Notes Integrated Logon

Expand on support for integrated logon details.   Explain the
new capabilities for per-user configuration and name mapping.

Change-Id: I6aef3f99cb54aa964f9a6dbc3992031d6199e97d
Reviewed-on: http://gerrit.openafs.org/7905
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agodoc: Remove USA vs International from AdminGuide
Jeffrey Altman [Mon, 30 Jul 2012 04:43:01 +0000]
doc: Remove USA vs International from AdminGuide

OpenAFS does not have separate distributions for the United States
and the rest of the world.  Nor are there any restrictions on the
capabilities of the Update Server.

Change-Id: I834d86764bb3d8df4cce62b9cbaa33bff455bc30
Reviewed-on: http://gerrit.openafs.org/7902
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agovlserver: remove an unused global
Michael Meffie [Mon, 30 Jul 2012 02:15:14 +0000]
vlserver: remove an unused global

Remove the unused global variable extentaddr.

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

11 years agoopr: tweak nonnull macro to use nested parens
Derrick Brashear [Sun, 29 Jul 2012 23:09:22 +0000]
opr: tweak nonnull macro to use nested parens

throws an error on windows in some cases otherwise

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

11 years agoWindows: Rename cm_btree struct data
Simon Wilkinson [Sun, 29 Jul 2012 19:14:11 +0000]
Windows: Rename cm_btree struct data

Rename the "struct data" in cm_btree.h to something less generic in
order to avoid conflicts with other code.

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

11 years agovolser: restructure GetNextVol and clients to remove duplicate code
Garrett Wollman [Sat, 28 Jul 2012 05:10:09 +0000]
volser: restructure GetNextVol and clients to remove duplicate code

There are several odd-looking but stylized loops involving GetNextVol()
which can be radically simplified if only GetNextVol() would return
a meaningful value.  Move all of the code that skips non-volume-header
files in the directory into GetNextVol and have it return a truth value
(instead of always returning zero) that indicates whether it saw
something that looks like a volume header.  Then all the odd while
loops and strcmps just collapse into while(GetNextVol(...)).

GetNextVol() had external scope, but there are no callers in the
tree that use it outside of volprocs.c, and it's not part of a
public library interface, so make it static.

While here, don't strcmp() past the end of a filename that begins with
'V' but is too short to be a valid volume name.

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

11 years agoafscp: avoid null dereference in _GetSecurityObject error case
Garrett Wollman [Sat, 28 Jul 2012 04:18:00 +0000]
afscp: avoid null dereference in _GetSecurityObject error case

Handle the possible error return from krb5_get_host_realm in the
same way as the other error cases (using an anonymous security
object); otherwise "realm" would be left null.

Change-Id: I5ce7a614a3e272b3a9903a8e95545a8116d1af3c
Reviewed-on: http://gerrit.openafs.org/7891
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agopam: Use the right password variable in pam_sm_chauthtok()
Garrett Wollman [Sat, 28 Jul 2012 04:26:44 +0000]
pam: Use the right password variable in pam_sm_chauthtok()

"password" is known to be null at this point.  Use "prompt_password"
which is obviously the one intended.

Change-Id: I4ab566f93c4978438df2c2875d619177ad8f5bdd
Reviewed-on: http://gerrit.openafs.org/7892
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agobutc: don't pass NULL to strcpy in RcreateDump
Garrett Wollman [Fri, 27 Jul 2012 23:50:42 +0000]
butc: don't pass NULL to strcpy in RcreateDump

volumesetNamePtr can return a null pointer in certain error
conditions.  Check for this and return BUDB_BADARGUMENT rather
than dumping core.

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

11 years agoLINUX: Hold GLOCK for proc traversal
Andrew Deason [Thu, 26 Jul 2012 21:40:03 +0000]
LINUX: Hold GLOCK for proc traversal

The functions that traverse unixuser structures for display via /proc
(uu_start et al) call various libafs functions hold and release locks,
etc. To do any of that, we need GLOCK. Amongst other issues, we can
panic if we try to acquire a contested lock without GLOCK, since we
assert glock is held when we sleep for the lock or try to wake other
waiters. The same goes for the legacy CellServDB proc file.

So, hold and release GLOCK as appropriate.

Change-Id: I9ec2051bc5d914521d12a9d20d28da1076c090fc
Reviewed-on: http://gerrit.openafs.org/7885
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoLINUX: Fix osi_proc.c formatting
Andrew Deason [Thu, 26 Jul 2012 20:58:45 +0000]
LINUX: Fix osi_proc.c formatting

osi_proc.c had a few formatting issues:

 - Several function definitions did not have the function name at the
   beginning of the line

 - A few preprocessor directives were not indented

 - A few areas used a tab character for each indentation level, as
   opposed to 4 spaces, then 1 tab, as the rest of the tree has

 - Struct definitions were aligned using tabs, not spaces, causing
   misalignments when the indentation was fixed

Fix these.

Change-Id: I8d6b511473b89c42abd759553ec77332407daff0
Reviewed-on: http://gerrit.openafs.org/7884
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agorx: protect against ACKs with serial as prevPacket
Jeffrey Altman [Mon, 16 Jul 2012 21:29:54 +0000]
rx: protect against ACKs with serial as prevPacket

patchset 4e71409fe1305cde4b9b341247ba658d8d24f4d0 introduced a
check in rxi_ReceiveAckPacket for out of order ack packets which
relied upon the value of the previousPacket field.  Unfortunately,
some versions of RX store the previous packet's serial number in
the field instead of previous packet's sequence number.  Modify
the check to only discard out of order ACKs if the previousPacket
sequence number is within the valid window.

Change-Id: I72885a8c1aaa69eb263335be1827545f2b4c3e09
Reviewed-on: http://gerrit.openafs.org/7785
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorx: better rxi_FindRpcStat check for end of queue
Jeffrey Altman [Thu, 26 Jul 2012 22:35:48 +0000]
rx: better rxi_FindRpcStat check for end of queue

patchset 1f0cf8b2b4bb6e36d8d82323a15ced72d91db0ec tested for
an empty queue but what is really required is a test for end of
queue after the queue_Scan().  If the queue_Scan() completes
at the end of the queue, in other words, pointing at the list
head, then return NULL because no match was found.

Change-Id: I444531d3cfa85b4691eaa8960da0266de82a03a3
Reviewed-on: http://gerrit.openafs.org/7886
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorx: protect against invalid params in rx_Copy*RPCStats
Jeffrey Altman [Wed, 25 Jul 2012 05:55:27 +0000]
rx: protect against invalid params in rx_Copy*RPCStats

Protect against:

  . rxi_Alloc() failure

Change-Id: I3334855e261bb40d5720fd376e62028760f0cee5
Reviewed-on: http://gerrit.openafs.org/7873
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agovos: Minimize release impact for new RO sites
Andrew Deason [Wed, 9 May 2012 23:45:51 +0000]
vos: Minimize release impact for new RO sites

Currently, if a new RO site is added with 'vos addsite', the only way
to populate the new site with data is a 'vos release' (excepting hacks
using 'vos restore' and 'vos addsite -live', etc). Due to safeguards
in 'vos' ensuring that RO sites always all contain the same data when
marked as up-to-date in the VLDB, such a release always incurs some
amount of data to be transmitted to all sites, as well as remote sites
being brought offline briefly, even when the RW data has not changed
in very long time.

To alleviate this situation, make 'vos release' detect if new,
unpopulated RO sites have been added, and if the RW volume has not
changed since the release of any existing RO sites. If both of these
conditions are true, do not update any of the existing sites, but only
transmit volume data to the sites that did not already contain RO
volumes.

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

11 years agotabular_output: don't leak table struct on error exit
Garrett Wollman [Wed, 25 Jul 2012 04:41:05 +0000]
tabular_output: don't leak table struct on error exit

The caller is almost certainly going to exit when we return, but
all the same, don't leak the table description structure in the
error exit.  Makes the static analyzer happier.

Change-Id: I55e986a3601968751921ee38badf5bb86cd3174f
Reviewed-on: http://gerrit.openafs.org/7870
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoafsdump_extract: clarify logic to avoid freeing local buffer
Garrett Wollman [Wed, 25 Jul 2012 04:22:10 +0000]
afsdump_extract: clarify logic to avoid freeing local buffer

Sometimes vnodepath is set to a local buffer.  Sometimes it is set
to malloc'ed storage.  Simplify the logic for freeing vnodepath
by checking explicitly for this condition rather than the state
of other variables.  As a bonus, avoids a false (?) positive from
the static analyzer.

Change-Id: I3772cb97698acc5a6ac1f438977c673e6fea7722
Reviewed-on: http://gerrit.openafs.org/7869
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agovlserver: always use the hostaddress table in GetAddrsU
Michael Meffie [Fri, 22 Jun 2012 03:44:31 +0000]
vlserver: always use the hostaddress table in GetAddrsU

Use the hostaddress (IpMappedAddr) table when looking up hosts by IP
address and when listing addresses by index, instead of accessing
the multi-homed extensions directly.

The existing vos client calls the old GetAddrs rpc to first retrieve
a count of the number of addresses expected. This count is the
number of addresses in the hostaddress table.  If there are
unreferenced entries in the mh extension blocks, then vos can return
an incorrect or incomplete list of addresses.

To be consistent with the rest of the host address processing, use
the hostaddress table in GetAddrsU to lookup hosts by index or by IP
address.

The hostaddress table is already used when looking up addresses by
UUID.

Change-Id: I01aa29ae7d24d48bcd245f0320e329435f61548e
Reviewed-on: http://gerrit.openafs.org/7878
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoafs_conn: make release_conns_vector() actually work
Garrett Wollman [Mon, 23 Jul 2012 03:20:01 +0000]
afs_conn: make release_conns_vector() actually work

release_conns_vector must never have been called before with
a non-null parameter, because it could not possibly work.
The first line of the loop is a null pointer dereference, and
if that were fixed, there's also a modify-after-free bug as well.
It's not clear how what the old version was trying to do; this
version makes a stab at doing something sensible but might be
less than required.  (Note that this would be much simpler if
converted to queue(3) macros or a similar standard linked-list
data structure.)

Change-Id: I4c0fb7ed1ee977dcc0b4dfb32557882679069731
Reviewed-on: http://gerrit.openafs.org/7838
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>