]> git.michaelhowe.org Git - packages/o/openafs.git/log
packages/o/openafs.git
14 years agodoc: Add aklog_dynamic_auth manpage
Andrew Deason [Fri, 15 Apr 2011 19:18:57 +0000 (14:18 -0500)]
doc: Add aklog_dynamic_auth manpage

Add a manpage for the aklog_dynamic_auth LAM module.

Change-Id: Ibb8583401d565ca0caea7688ac797aa85a0d6869
Reviewed-on: http://gerrit.openafs.org/4485
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoviced: Enable NAT ping on hosts
Andrew Deason [Thu, 12 May 2011 15:57:09 +0000 (10:57 -0500)]
viced: Enable NAT ping on hosts

Turn on NAT ping on the Rx connection for the callback channel for
hosts. This should help improve behavior for clients behind NATs and
stateful firewalls, even for clients that predate NAT ping
functionality.

Change-Id: I0f8e801c2225560192de9c09bfa06d0387e29af3
Reviewed-on: http://gerrit.openafs.org/4646
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: h_SetupCallbackConn_r in removeAddress_r
Andrew Deason [Thu, 12 May 2011 15:21:09 +0000 (10:21 -0500)]
viced: h_SetupCallbackConn_r in removeAddress_r

removeAddress_r has some code that is identical to the
h_SetupCallbackConn_r function. Call the function instead.

Change-Id: I3416dd1b5c94f0e836c2461771389045994e7152
Reviewed-on: http://gerrit.openafs.org/4645
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agodasalvager: unlink fsstate.dat when standalone
Andrew Deason [Fri, 6 May 2011 18:12:17 +0000 (13:12 -0500)]
dasalvager: unlink fsstate.dat when standalone

If the DAFS salvager is running in a standalone mode, unlink the
fileserver's fsstate.dat file if any volumes change. Otherwise, volume
data could have changed and the fileserver will retain callback
promises for the data in those volumes until it tries to attach the
volume. This way, callbacks are broken via callback state
reinitialization.

A better solution is to record which volumes have changed, and the
fileserver can break callbacks for them on startup. But this at least
eliminates a regression from non-DAFS behavior.

Change-Id: Ie443e7d43705c3015d21bd3cad1b1e05c88562be
Reviewed-on: http://gerrit.openafs.org/4638
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agocmd tests: Initialise string retval
Simon Wilkinson [Sun, 24 Apr 2011 19:29:37 +0000 (15:29 -0400)]
cmd tests: Initialise string retval

The cmd_OptionAsString function attempts to free the previous value
of the string passed to it. Make sure that we initialise the return
value to NULL before passing it in in the test suite.

Change-Id: I8500d5e6812f4d1655fc50618db472c745604e41
Reviewed-on: http://gerrit.openafs.org/4653
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Put back GetCapabilities user reference
Andrew Deason [Thu, 5 May 2011 22:13:21 +0000 (17:13 -0500)]
libafs: Put back GetCapabilities user reference

afs_GetCapabilities gets a user reference for the conn for the
GetCapabilities call. Put the ref back so we don't leak refs.

Reviewed-on: http://gerrit.openafs.org/4626
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 010fc998a51a0aae2499b128ee8c671885a84e13)

Change-Id: Ia505de8e5ec7ded14f2e2e40ac8bd3ef0b91c2fc
Reviewed-on: http://gerrit.openafs.org/4637
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Flush vcaches in afs_shutdown
Andrew Deason [Tue, 10 May 2011 19:16:06 +0000 (14:16 -0500)]
libafs: Flush vcaches in afs_shutdown

Currently, a few platforms (linux, linux24, solaris, irix) flush all
vcaches during shutdown. However, they do this before calling
afs_shutdown(), resulting in afs_FlushVCache queueing VCBs and
possibly trying to give the callbacks back to the server.

Instead of this, perform the flushes in afs_shutdown itself, so we do
this after we try to give up all callbacks to all servers, and we do
this while afs_shuttingdown is set, so we don't try to queue VCBs.
This also consolidates some of the duplicated code to flush all
vcaches, and now does this for all platforms.

Change-Id: I69c9e0862972f18ecc29ff709943d9a77f2db0a9
Reviewed-on: http://gerrit.openafs.org/4641
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: GiveUpAllCallBacks at shutdown again
Andrew Deason [Tue, 10 May 2011 18:45:26 +0000 (13:45 -0500)]
libafs: GiveUpAllCallBacks at shutdown again

Commit cee2c677d7de66a510d05978e3b41dcd5d8aca78 caused the cache
manager to give up all callbacks at shutdown. But
76158df491f47de56d1febe1d1d2d17d316c9a74 removed the call to
afs_FlushVCBs in afs_shutdown. Put it back.

Change-Id: I74b815af485482ab83b9115772e4f4221a731f3e
Reviewed-on: http://gerrit.openafs.org/4640
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Do not write-lock afs_xserver on ICBS
Andrew Deason [Tue, 10 May 2011 17:54:53 +0000 (12:54 -0500)]
libafs: Do not write-lock afs_xserver on ICBS

Our RXAFSCB_InitCallBackState* handler currently write-locks
afs_xserver when it clears the SCAPS_KNOWN flag for the relevant
server. However, the afs_xserver lock is for protecting the global
list and hash table of server structures, and is not necessary to
acquire in order to modify the flags of an individual server struct.
For instance, CkSrv_GetCaps does not acquire any locks to modify the
server flags.

Taking this lock conflicts with a read lock on afs_xserver acquired by
afs_FlushVCBs when it traverses the list of server structures.
afs_FlushVCBs may contact a server that then calls InitCallBackState
on us, causing a deadlock if ICBS waits for the afs_xserver lock.

So, avoid locking afs_xserver in this case, to avoid that deadlock.

Change-Id: Id4dea74ce85726a3da07f738e301600f46059297
Reviewed-on: http://gerrit.openafs.org/4639
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: fix permission op test for certain compilers
Marc Dionne [Sat, 14 May 2011 17:19:52 +0000 (13:19 -0400)]
Linux: fix permission op test for certain compilers

Some compilers complain that _inode is used uninitialised here.
Since this test requires -Werror, it causes the test to fail
and our permission op to be used in RCU mode, leading to lockups.

Initialise it to make the compilers happy.

Fixes a lockup seen on kernels 2.6.38+ on Gentoo and Debian.

Reviewed-on: http://gerrit.openafs.org/4654
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 050945e949135c1b98ed353fc05fcf9b8c1587bd)

Change-Id: Icc4e65946c8d04bd519c95b969dec1d2359dce51
Reviewed-on: http://gerrit.openafs.org/4655
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFix misspelling of writable as writeable
Russ Allbery [Sun, 15 May 2011 07:32:40 +0000 (00:32 -0700)]
Fix misspelling of writable as writeable

Caught by Lintian in the strings in the butc binary, so I did a global
search for any other occurrences.

Change-Id: I5d5b433e716a62dc43d1c5376841e41d49e29ba5
Reviewed-on: http://gerrit.openafs.org/4657
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoUpdate to standards version 3.9.2 debian/1.6.0.pre5-2
Russ Allbery [Sun, 15 May 2011 07:29:42 +0000 (00:29 -0700)]
Update to standards version 3.9.2

14 years agoFinalize changes for 1.6.0~pre5-2
Russ Allbery [Sun, 15 May 2011 07:13:05 +0000 (00:13 -0700)]
Finalize changes for 1.6.0~pre5-2

14 years agoAdd quotes around compiler and linker flags
Russ Allbery [Sun, 15 May 2011 07:06:26 +0000 (00:06 -0700)]
Add quotes around compiler and linker flags

Protect them from the shell when passing them to configure.

14 years agoUse dpkg-buildflags to get compilation flags
Russ Allbery [Sun, 15 May 2011 06:55:04 +0000 (23:55 -0700)]
Use dpkg-buildflags to get compilation flags

* Use dpkg-buildflags to get the default values of CFLAGS, CPPFLAGS, and
  LDFLAGS.  Upstream does not entirely honor these yet, but we're
  getting closer.

14 years agoLinux: fix reading files larger than the chunk size
Marc Dionne [Sun, 15 May 2011 00:57:12 +0000 (20:57 -0400)]
Linux: fix reading files larger than the chunk size

Commit 2571b6285d5da8ef62ab38c3a938258ddd7bac4e fixed an issue with
the use of tmpfs as a disk cache and ftruncate() on files in AFS.
But it introduced a problem reading larger files as reported in
RT ticket 129880.

What should be compared against the current cache file size is the
offset into the current chunk, not the overall offset for the whole
file.

FIXES: 129880

Change-Id: I93008c8d0b1d70785b0b8a2e4289a04ac06cbbef

14 years agoAdd changelog entry for upstream chunk size file read patch
Russ Allbery [Sun, 15 May 2011 06:47:53 +0000 (23:47 -0700)]
Add changelog entry for upstream chunk size file read patch

14 years agoLinux: fix reading files larger than the chunk size
Marc Dionne [Sun, 15 May 2011 00:57:12 +0000 (20:57 -0400)]
Linux: fix reading files larger than the chunk size

Commit 2571b6285d5da8ef62ab38c3a938258ddd7bac4e fixed an issue with
the use of tmpfs as a disk cache and ftruncate() on files in AFS.
But it introduced a problem reading larger files as reported in
RT ticket 129880.

What should be compared against the current cache file size is the
offset into the current chunk, not the overall offset for the whole
file.

FIXES: 129880

Change-Id: I93008c8d0b1d70785b0b8a2e4289a04ac06cbbef
Reviewed-on: http://gerrit.openafs.org/4656
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorpm: Really undefine %dist
Andy Cobaugh [Wed, 11 May 2011 21:02:40 +0000 (17:02 -0400)]
rpm: Really undefine %dist

rpmbuild --eval '%undefine dist' wasn't sticking on redhat 5.x. I think
the correct way to undefine this is to --define 'dist %undefined'

Some redhat 5.x installs have %dist defined depending on what else has been
installed.

Change-Id: I9ad6854a337c2085bb2db5e5f98e7d2f9889c4e4
Reviewed-on: http://gerrit.openafs.org/4643
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: fix permission op test for certain compilers
Marc Dionne [Sat, 14 May 2011 17:19:52 +0000 (13:19 -0400)]
Linux: fix permission op test for certain compilers

Some compilers complain that _inode is used uninitialised here.
Since this test requires -Werror, it causes the test to fail
and our permission op to be used in RCU mode, leading to lockups.

Initialise it to make the compilers happy.

Fixes a lockup seen on kernels 2.6.38+ on Gentoo and Debian.

Change-Id: Id6325e3a5a918906d547d241a39de777fb394fdc
Reviewed-on: http://gerrit.openafs.org/4654
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFinalize changes for 1.6.0~pre5-1 debian/1.6.0.pre5-1
Russ Allbery [Sat, 14 May 2011 18:52:44 +0000 (11:52 -0700)]
Finalize changes for 1.6.0~pre5-1

14 years agoUpdate to Debian source format 3.0 (quilt)
Russ Allbery [Sat, 14 May 2011 18:52:17 +0000 (11:52 -0700)]
Update to Debian source format 3.0 (quilt)

* Change to Debian source format 3.0 (quilt).  Force a single Debian
  patch for simplicity since the packaging is maintained in Git using
  branches, and include a patch header explaining why.

14 years agoLinux: fix permission op test for certain compilers
Marc Dionne [Sat, 14 May 2011 17:19:52 +0000 (13:19 -0400)]
Linux: fix permission op test for certain compilers

Some compilers complain that _inode is used uninitialised here.
Since this test requires -Werror, it causes the test to fail
and our permission op to be used in RCU mode, leading to lockups.

Initialise it to make the compilers happy.

Fixes a lockup seen on kernels 2.6.38+ on Gentoo and Debian.

Change-Id: Id6325e3a5a918906d547d241a39de777fb394fdc

14 years agoAdd changelog entry for upstream kernel lockup patch
Russ Allbery [Sat, 14 May 2011 18:06:58 +0000 (11:06 -0700)]
Add changelog entry for upstream kernel lockup patch

14 years agoAdd changelog for 1.6.0pre5
Russ Allbery [Sat, 14 May 2011 17:50:55 +0000 (10:50 -0700)]
Add changelog for 1.6.0pre5

14 years agoMerge branch 'upstream'
Russ Allbery [Sat, 14 May 2011 17:44:50 +0000 (10:44 -0700)]
Merge branch 'upstream'

Conflicts:
acinclude.m4
src/afs/LINUX/osi_compat.h
src/afs/LINUX/osi_misc.c

14 years agoImported upstream tag openafs-stable-1_6_0pre5 via tarball upstream/1.6.0.pre5
Russ Allbery [Sat, 14 May 2011 17:42:32 +0000 (10:42 -0700)]
Imported upstream tag openafs-stable-1_6_0pre5 via tarball

14 years agoUpdate changelog for 1.6.0pre5
Russ Allbery [Sat, 14 May 2011 17:41:06 +0000 (10:41 -0700)]
Update changelog for 1.6.0pre5

14 years agoUpdate packaging infrastructure for repository branch renaming
Russ Allbery [Sat, 14 May 2011 17:13:44 +0000 (10:13 -0700)]
Update packaging infrastructure for repository branch renaming

* Update import-upstream and README.source for moving 1.6 from the
  experimental and upstream-1.5 branches to the master and upstream
  branches.

14 years agoafscp: tellmeaboutyourself stub wants host byte order
Derrick Brashear [Thu, 12 May 2011 14:59:53 +0000 (10:59 -0400)]
afscp: tellmeaboutyourself stub wants host byte order

we get network byte order addresses from rx_getAllAddr; swap back
to host order.

Change-Id: Id0c5e70399422593c574958f905984c9edf8e6d4
Reviewed-on: http://gerrit.openafs.org/4644
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: always try afs/cell@USER-REALM first
Jeffrey Altman [Mon, 9 May 2011 14:46:46 +0000 (10:46 -0400)]
Windows: always try afs/cell@USER-REALM first

In the KFW_AFS library, always try afs/cell@USER-REALM
first, even when KFW_AFS_klog() is called with an explicit
realm mapping for the cell.  An afs service principal from
the user's realm is always preferred.  No cross realm and
if the realm is AD, the ability to avoid the inclusion of
a PAC.

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

14 years agoWindows: support dotted names in aklog
Jeffrey Altman [Mon, 9 May 2011 14:45:33 +0000 (10:45 -0400)]
Windows: support dotted names in aklog

Do not reject dotted principal names if the registry
configuration states that they should be accepted.

Change-Id: I68a3054e77236ff307cc45b6563f34ec6605113a
Reviewed-on: http://gerrit.openafs.org/4632
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4634
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: always try afs/cell@USER-REALM first
Jeffrey Altman [Mon, 9 May 2011 14:46:46 +0000 (10:46 -0400)]
Windows: always try afs/cell@USER-REALM first

In the KFW_AFS library, always try afs/cell@USER-REALM
first, even when KFW_AFS_klog() is called with an explicit
realm mapping for the cell.  An afs service principal from
the user's realm is always preferred.  No cross realm and
if the realm is AD, the ability to avoid the inclusion of
a PAC.

Change-Id: Ia29085e03d7c8a7c05e0c8d7991bc48b780b84fa
Reviewed-on: http://gerrit.openafs.org/4633
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoWindows: support dotted names in aklog
Jeffrey Altman [Mon, 9 May 2011 14:45:33 +0000 (10:45 -0400)]
Windows: support dotted names in aklog

Do not reject dotted principal names if the registry
configuration states that they should be accepted.

Change-Id: I675bec085f61ae2f5dc1cfd93a811655f87e0577
Reviewed-on: http://gerrit.openafs.org/4632
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
14 years agolibafs: Put back GetCapabilities user reference
Andrew Deason [Thu, 5 May 2011 22:13:21 +0000 (17:13 -0500)]
libafs: Put back GetCapabilities user reference

afs_GetCapabilities gets a user reference for the conn for the
GetCapabilities call. Put the ref back so we don't leak refs.

Change-Id: I46304ea13c3d78216641f468718b23b665d046ff
Reviewed-on: http://gerrit.openafs.org/4626
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Get rx conn ref with afs conn ref
Andrew Deason [Thu, 5 May 2011 16:18:08 +0000 (11:18 -0500)]
libafs: Get rx conn ref with afs conn ref

When we get a reference to an afs_conn with afs_Conn and its variants,
we assume we can use the tc->id rx connection without holding any
locks. However, if tc->forceConnectFS gets set, the tc->id connection
can be destroyed and recreated out from under us. So, to avoid using a
possibly freed rx connection, grab a reference to the rx connection at
the same time as we grab a reference to the afs conn. And also put
back the same reference with afs_PutConn.

Change-Id: I442886ee89c6f3fa609e47261317e647e124eecc
Reviewed-on: http://gerrit.openafs.org/4625
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: replace CYGWIN envvar with CYGWINDIR
Jeffrey Altman [Fri, 6 May 2011 13:49:52 +0000 (09:49 -0400)]
Windows: replace CYGWIN envvar with CYGWINDIR

The environment variable CYGWIN (starting with cygwin 1.7.1) is
now used by CYGWIN to set configuration parameters for the cygwin
runtime library.  OpenAFS used it to indicate the location of the
Cygwin install directory.  Since there is a conflict, rename CYGWIN
to CYGWINDIR.

Change-Id: I32cd79eba33fc80e15308010fafdaecb527d23f0
Reviewed-on: http://gerrit.openafs.org/4629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4630
Tested-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoWindows: replace CYGWIN envvar with CYGWINDIR
Jeffrey Altman [Fri, 6 May 2011 13:49:52 +0000 (09:49 -0400)]
Windows: replace CYGWIN envvar with CYGWINDIR

The environment variable CYGWIN (starting with cygwin 1.7.1) is
now used by CYGWIN to set configuration parameters for the cygwin
runtime library.  OpenAFS used it to indicate the location of the
Cygwin install directory.  Since there is a conflict, rename CYGWIN
to CYGWINDIR.

Change-Id: I98f6a7095ede4c6a91dd71d48312b0d1a55b8091
Reviewed-on: http://gerrit.openafs.org/4629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoWindows: change log for 1.5.9905
Jeffrey Altman [Fri, 6 May 2011 00:36:38 +0000 (20:36 -0400)]
Windows: change log for 1.5.9905

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

14 years agoWindows: change log for 1.5.9905
Jeffrey Altman [Fri, 6 May 2011 00:36:38 +0000 (20:36 -0400)]
Windows: change log for 1.5.9905

Change-Id: If230ae5f0dcb811954130e118fc0ae81dc396111
Reviewed-on: http://gerrit.openafs.org/4627
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
14 years agolibafs: Correct afs_LoopServers flags
Andrew Deason [Thu, 5 May 2011 16:37:12 +0000 (11:37 -0500)]
libafs: Correct afs_LoopServers flags

AFS_LS_DOWN was actually checking up servers, and AFS_LS_UP was
checking down servers. Fix the handling of the 'adown' flag so we do
the right thing. Also make afs_FlushVCBs use the symbolic name for
adown.

Change-Id: I601faf1bb712a2f76f0bb2447530af38111a71fd
Reviewed-on: http://gerrit.openafs.org/4624
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agovol: switch to rk_closesocket
Jeffrey Altman [Wed, 4 May 2011 23:53:22 +0000 (19:53 -0400)]
vol: switch to rk_closesocket

Use roken's rk_closesocket instead of #ifdef AFS_NT40_ENV
conditional tests.

Change-Id: I3602705cea61f07b0e05c633ab57125e43cde506
Reviewed-on: http://gerrit.openafs.org/4623
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoafscp: use closesocket when closing sockets
Jeffrey Altman [Wed, 4 May 2011 18:41:03 +0000 (14:41 -0400)]
afscp: use closesocket when closing sockets

close() is not portable to platforms where a socket is
not a file descriptor.

Change-Id: I7077643f45b969f8aa274f4fbb0dfbf375d6542f
Reviewed-on: http://gerrit.openafs.org/4620
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agomake 1.6.0pre5
Derrick Brashear [Tue, 3 May 2011 12:47:31 +0000 (08:47 -0400)]
make 1.6.0pre5

update bits needed for pre5

Change-Id: Iec57e2a69ea02c25b1c71b3d7ac4beb6eafc69c1
Reviewed-on: http://gerrit.openafs.org/4618
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoNetBSD: DEBUG can not typically be defined
Jonathan A. Kollasch [Mon, 2 May 2011 21:06:34 +0000 (21:06 +0000)]
NetBSD: DEBUG can not typically be defined

Like IRIX 6.5, some NetBSD kernel structures change size in the presence
of the DEBUG preprocessor symbol.

Reviewed-on: http://gerrit.openafs.org/4605
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 48633351c597278d4c8efd5a80163f0637c85aaf)

Change-Id: I15771316dc657474d8b906df26f927fdbefe384c
Reviewed-on: http://gerrit.openafs.org/4617
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoNetBSD: translate timeval structure format in clock_GetTime()
Jonathan A. Kollasch [Mon, 2 May 2011 20:03:50 +0000 (20:03 +0000)]
NetBSD: translate timeval structure format in clock_GetTime()

Reviewed-on: http://gerrit.openafs.org/4604
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 350786b3e092150a91bb4542263f648d683e3b7c)

Change-Id: I819abb0b3207517f4a560e10896db211006f1980
Reviewed-on: http://gerrit.openafs.org/4616
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoavoid downward vcache pressure when entries are free
Derrick Brashear [Fri, 29 Apr 2011 07:59:19 +0000 (03:59 -0400)]
avoid downward vcache pressure when entries are free

we try to keep VCACHE_FREE entries free. if there's already that many free,
do nothing.

Reviewed-on: http://gerrit.openafs.org/4595
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit fd545c51fe34b1452f09d4fbf6458f5b1557e895)

Change-Id: Ia19b748596eadc75c6487d5fe854d2c7c4a4595a
Reviewed-on: http://gerrit.openafs.org/4615
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFix com_err renaming
Simon Wilkinson [Tue, 3 May 2011 09:03:22 +0000 (10:03 +0100)]
Fix com_err renaming

The pull up of 352c3e366c2e0a8de4550547192276e62afd2cc1 to the 1.6
branch missed replacing occurences of com_err with afscom_err in
the sgistuff and pam directories. Fix this so that Irix builds
again.

Change-Id: I38ab02859a7cb2ebd60e455e6db4dc2c47710766
Reviewed-on: http://gerrit.openafs.org/4614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFurther fix gssapi.m4 for Heimdal without libroken
Russ Allbery [Mon, 2 May 2011 21:54:35 +0000 (14:54 -0700)]
Further fix gssapi.m4 for Heimdal without libroken

The gssapi.m4 fix for Heimdal without libroken was incomplete.  It now
doesn't attempt to link with libroken when probing for GSS-API
symbols.  Thanks, Antoine Verheijen.

Change-Id: Ie994c321f68d7ffba96d2cf31dcf287be8546121
Reviewed-on: http://gerrit.openafs.org/4607
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agolibafs: Drop xvcache for AllocCBR
Andrew Deason [Tue, 15 Feb 2011 18:04:32 +0000 (12:04 -0600)]
libafs: Drop xvcache for AllocCBR

Normally when we AllocCBR, we are holding xvcache write-locked, since
it is called from FlushVCache. Before
a309e274632993c5aeec04c6e090f5ac95837a40, when AllocCBR needs to flush
CBRs due to a lack of space, we hit the net, giving up callbacks on
fileservers.

This can cause a problem if one of those fileservers needs to contact
us in order to complete that request, since the callback service
thread may be waiting for xvcache, causing a deadlock (that is
eventually broken by network timeouts).

To avoid this, drop xvcache if AllocCBR looks like it does not have
sufficient space. Fix all callers of afs_FlushVCache to handle the
case where we sleep, since with this change, afs_FlushVCache can sleep
on all platforms.

This partially reverts a309e274632993c5aeec04c6e090f5ac95837a40, as it
contains an alternative method of avoiding the xvcache lock in this
situation. This commit restores much of the code path to be much more
similar to how it used to be, except that it allows for dropping
xvcache for AllocCBR. This should make any change to our prior
behavior smaller/simpler, and thus safer and more consistent with
existing clients. This reintroduces the hard limit to how much space
we allocate for CBRs, although the part of
a309e274632993c5aeec04c6e090f5ac95837a40 that raised this limit is
retained.

Reviewed-on: http://gerrit.openafs.org/3958
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 76158df491f47de56d1febe1d1d2d17d316c9a74)

Change-Id: I6d2d7512682b93e6524f8f60bb8e15818d888e00
Reviewed-on: http://gerrit.openafs.org/4603
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Use vcount, not maxvcount to trim vcaches
Andrew Deason [Thu, 28 Apr 2011 16:48:18 +0000 (11:48 -0500)]
libafs: Use vcount, not maxvcount to trim vcaches

Every five minutes we afs_ShakeLooseVCaches to try and return the
number of vcaches in use down to the originally configured -stat level
(when we are using dynamic vcaches). We should calculate how many
vcaches to flush based on the number of currently active vcaches
(afs_vcount), not the peak number (afs_maxvcount). Otherwise, once we
exceed the configured -stat level, we will always keep trying to flush
numerous vcaches, even if we barely have any vcaches in use.

Reviewed-on: http://gerrit.openafs.org/4584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2a2206bfe16815a6625fee4d37520e9676d88ab4)

Change-Id: I80cfbf31ba81d7cf23013c0efcea0b8ac8c341db
Reviewed-on: http://gerrit.openafs.org/4602
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: Don't read pages beyond the cache eof
Simon Wilkinson [Mon, 25 Apr 2011 18:18:39 +0000 (14:18 -0400)]
Linux: Don't read pages beyond the cache eof

If we attempt to read past the end of the current cache file (for
example, when we're extending the file with ftruncate), don't force
the backend filesystem to populate that page with non-existent data.

This will hopefully fix a bus error when using tmpfs as a backing
cache.

FIXES 128452

Reviewed-on: http://gerrit.openafs.org/4562
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 79d5b5cce65b10134004c4cb2b7b34ac509cba6a)

Change-Id: Id9956be824a4c4d8db7deb65403f4d9740758e42
Reviewed-on: http://gerrit.openafs.org/4600
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Improve deleted client log messages
Andrew Deason [Wed, 27 Apr 2011 21:24:46 +0000 (16:24 -0500)]
viced: Improve deleted client log messages

Change the information logged related to deleted clients to be a
little more useful. In particular this includes adding the client and
host refcounts, to help see if the cause is a reference count leak.

Reviewed-on: http://gerrit.openafs.org/4583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 047cc473037efa62fa7698878e055ca4665e85ef)

Change-Id: I3bfcf49587f826129979b81de95b92cb2b332790
Reviewed-on: http://gerrit.openafs.org/4593
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Avoid ref leak on origin callback break
Andrew Deason [Wed, 27 Apr 2011 19:23:43 +0000 (14:23 -0500)]
viced: Avoid ref leak on origin callback break

When breaking a callback, sometimes we send a callback to the host
that performed the callback-inducing operation. When we do this,
currently BreakCallBack gives the origin host structure to
MultiBreakCallBack_r, which avoids releasing that host after the
callback is broken.

However, BreakCallBack obtains a reference to every host to which it
delivers a callback, even if it is the origin host, so a reference is
leaked. Fix this by not ever passing a host to MultiBreakCallBack_r,
and just have MultiBreakCallBack_r release a reference for every host
to which it delivers a callback break.

FIXES 129376

Reviewed-on: http://gerrit.openafs.org/4581
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit af175ce2c7a4785ef1992d096adfdb27daa86ee4)

Change-Id: Ifd59c8ce93939f7b23e9f64bd7c0e527d3a2fa52
Reviewed-on: http://gerrit.openafs.org/4592
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Transfer host ref in h_FindClient_r
Andrew Deason [Wed, 27 Apr 2011 18:51:23 +0000 (13:51 -0500)]
viced: Transfer host ref in h_FindClient_r

In h_FindClient_r, we can change which client structure we're dealing
with if we find a different client struct in the Rx conn-specific
data. We adjust the refcounts for the client structures themselves,
but not the associated hosts. While the host structures should be the
same most of the time, we are not guaranteed that, so adjust their
refcounts as well.

Reviewed-on: http://gerrit.openafs.org/4580
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9a4e3ade396583d412a85c4e03238d18d5c533ee)

Change-Id: I9ec5ed707ef6b726c358fcaa46d81b9ea1a17ce7
Reviewed-on: http://gerrit.openafs.org/4591
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Release all hosts in h_Enumerate*
Andrew Deason [Sat, 23 Apr 2011 21:52:30 +0000 (16:52 -0500)]
viced: Release all hosts in h_Enumerate*

h_Enumerate and h_Enumerate_r were not releasing all of the holds they
obtained when the callback function caused the enumeration to bail
early. Correct them so all host holds are released.

Reviewed-on: http://gerrit.openafs.org/4530
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 211e906c86be9ad9cba324e776d56093579b6653)

Change-Id: Iceb1e2961e9bbb11640c6fccdeb8713a9657df99
Reviewed-on: http://gerrit.openafs.org/4534
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Print a warning when using a deleted client
Andrew Deason [Sat, 23 Apr 2011 21:44:41 +0000 (16:44 -0500)]
viced: Print a warning when using a deleted client

We should never get a deleted client back from GetClient. Log a
message if we do, to explain why access may suddenly appear to fail,
and assist in determining why.

Note that we still try to service the request, since the accessing
user may still have enough access to do whatever was requested.

Reviewed-on: http://gerrit.openafs.org/4529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8b07814e037d19dc9868dd202e82d69b96fbdcae)

Change-Id: I0b1d9fe46e5b83b93b59ff6facc2421db9136c12
Reviewed-on: http://gerrit.openafs.org/4533
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Force valid host enumeration flags
Andrew Deason [Sat, 23 Apr 2011 21:32:10 +0000 (16:32 -0500)]
viced: Force valid host enumeration flags

Make sure that the callback functions for h_Enumerate and
h_Enumerate_r give us back valid flags values by aborting if they
return an invalid value.

Reviewed-on: http://gerrit.openafs.org/4528
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 484b5b4cf4f88a9ddd04cdbe870d9c2959ef266c)

Change-Id: Ia1b7537d7988203bd8c0bbc619c04f5b3f9387a1
Reviewed-on: http://gerrit.openafs.org/4532
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoNetBSD: DEBUG can not typically be defined
Jonathan A. Kollasch [Mon, 2 May 2011 21:06:34 +0000 (21:06 +0000)]
NetBSD: DEBUG can not typically be defined

Like IRIX 6.5, some NetBSD kernel structures change size in the presence
of the DEBUG preprocessor symbol.

Change-Id: I3c5acba7afd22be9b179f628dfa0c1c402c08e2a
Reviewed-on: http://gerrit.openafs.org/4605
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoNetBSD: translate timeval structure format in clock_GetTime()
Jonathan A. Kollasch [Mon, 2 May 2011 20:03:50 +0000 (20:03 +0000)]
NetBSD: translate timeval structure format in clock_GetTime()

Change-Id: I4fb81a5b809437786064402b3ced0b1659d4476b
Reviewed-on: http://gerrit.openafs.org/4604
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agodoc: Fix 'vos endtrans' copyright
Andrew Deason [Thu, 28 Apr 2011 18:55:09 +0000 (13:55 -0500)]
doc: Fix 'vos endtrans' copyright

SNA owns this, not me.

Reviewed-on: http://gerrit.openafs.org/4586
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c7212aaaf155f60e28bf592a13e5a50c960e5017)

Change-Id: Ib260b89ced9616d31242237048a900616ca9820b
Reviewed-on: http://gerrit.openafs.org/4601
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Improve deleted client log messages
Andrew Deason [Wed, 27 Apr 2011 21:24:46 +0000 (16:24 -0500)]
viced: Improve deleted client log messages

Change the information logged related to deleted clients to be a
little more useful. In particular this includes adding the client and
host refcounts, to help see if the cause is a reference count leak.

Change-Id: Iba156fb32a4838cdbd567ca4e55072337c63ba67
Reviewed-on: http://gerrit.openafs.org/4583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Do not try to reuse deleted client
Andrew Deason [Wed, 27 Apr 2011 20:36:44 +0000 (15:36 -0500)]
viced: Do not try to reuse deleted client

When h_FindClient_r encounters a deleted client structure, it does not
try to find a different client structure to use. Force it to use a new
client structure by setting client to NULL when it detects a deleted
client.

This arguably reverts part of
4e55e30f5b2c149b350b6d6875793adf722fdc21, but the code paths in
h_FindClient_r are very different now, so that commit is probably not
too relevant.

Change-Id: I8e5004c8a9a3d99919da8df4436e5aa97e338825
Reviewed-on: http://gerrit.openafs.org/4582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRemove unused variable
Jonathan A. Kollasch [Mon, 2 May 2011 18:32:29 +0000 (18:32 +0000)]
Remove unused variable

Change-Id: Ib91cf666f3b66b9d8aae7bfcab290e6fede61280
Reviewed-on: http://gerrit.openafs.org/4599
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoWindows: Fix caching of non-existing vols
Jeffrey Altman [Sun, 1 May 2011 04:11:13 +0000 (00:11 -0400)]
Windows: Fix caching of non-existing vols

In cm_UpdateVolumeLocation() the conditional that would
trigger the immediate return of CM_ERROR_NOSUCHVOLUME
was backwards which prevented the caching from working.

cm_CheckOfflineVolumes() is called by the daemon thread
to reset the status of offline volumes.  Non-existing
volumes are by definition offline and cannot be brought
online.  Therefore, the cm_CheckOfflineVolumes() function
should skip volumes with the CM_VOLUMEFLAG_NOEXIST flag
set.

Change-Id: I65534b78842b4887d2fde67162a9d854437001ed
Reviewed-on: http://gerrit.openafs.org/4597
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4598
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: Fix caching of non-existing vols
Jeffrey Altman [Sun, 1 May 2011 04:11:13 +0000 (00:11 -0400)]
Windows: Fix caching of non-existing vols

In cm_UpdateVolumeLocation() the conditional that would
trigger the immediate return of CM_ERROR_NOSUCHVOLUME
was backwards which prevented the caching from working.

cm_CheckOfflineVolumes() is called by the daemon thread
to reset the status of offline volumes.  Non-existing
volumes are by definition offline and cannot be brought
online.  Therefore, the cm_CheckOfflineVolumes() function
should skip volumes with the CM_VOLUMEFLAG_NOEXIST flag
set.

Change-Id: If4093132322e7dd02d71c0f18d6492abbea53e01
Reviewed-on: http://gerrit.openafs.org/4597
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoAdd missing LIB_roken references
Andrew Deason [Thu, 28 Apr 2011 21:13:20 +0000 (16:13 -0500)]
Add missing LIB_roken references

With the usage of asprintf in libcmd, some more binaries require
libroken to link. Add LIB_roken to their link lines. In src/venus for
the fstrace rule, this causes the HP-UX case to be identical to the
default case, so just remove the HP-UX special case.

Change-Id: Ib4677b17a194cf79742bd5767d3f5cf2442973d3
Reviewed-on: http://gerrit.openafs.org/4590
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoavoid downward vcache pressure when entries are free
Derrick Brashear [Fri, 29 Apr 2011 07:59:19 +0000 (03:59 -0400)]
avoid downward vcache pressure when entries are free

we try to keep VCACHE_FREE entries free. if there's already that many free,
do nothing.

Change-Id: I7e92430329a17250f94d0435de7641fa331dd461
Reviewed-on: http://gerrit.openafs.org/4595
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Drop xvcache for AllocCBR
Andrew Deason [Tue, 15 Feb 2011 18:04:32 +0000 (12:04 -0600)]
libafs: Drop xvcache for AllocCBR

Normally when we AllocCBR, we are holding xvcache write-locked, since
it is called from FlushVCache. Before
a309e274632993c5aeec04c6e090f5ac95837a40, when AllocCBR needs to flush
CBRs due to a lack of space, we hit the net, giving up callbacks on
fileservers.

This can cause a problem if one of those fileservers needs to contact
us in order to complete that request, since the callback service
thread may be waiting for xvcache, causing a deadlock (that is
eventually broken by network timeouts).

To avoid this, drop xvcache if AllocCBR looks like it does not have
sufficient space. Fix all callers of afs_FlushVCache to handle the
case where we sleep, since with this change, afs_FlushVCache can sleep
on all platforms.

This partially reverts a309e274632993c5aeec04c6e090f5ac95837a40, as it
contains an alternative method of avoiding the xvcache lock in this
situation. This commit restores much of the code path to be much more
similar to how it used to be, except that it allows for dropping
xvcache for AllocCBR. This should make any change to our prior
behavior smaller/simpler, and thus safer and more consistent with
existing clients. This reintroduces the hard limit to how much space
we allocate for CBRs, although the part of
a309e274632993c5aeec04c6e090f5ac95837a40 that raised this limit is
retained.

Change-Id: Id4aaa941b3908f59390873e83e23429041c0828f
Reviewed-on: http://gerrit.openafs.org/3958
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agolibafs: Use vcount, not maxvcount to trim vcaches
Andrew Deason [Thu, 28 Apr 2011 16:48:18 +0000 (11:48 -0500)]
libafs: Use vcount, not maxvcount to trim vcaches

Every five minutes we afs_ShakeLooseVCaches to try and return the
number of vcaches in use down to the originally configured -stat level
(when we are using dynamic vcaches). We should calculate how many
vcaches to flush based on the number of currently active vcaches
(afs_vcount), not the peak number (afs_maxvcount). Otherwise, once we
exceed the configured -stat level, we will always keep trying to flush
numerous vcaches, even if we barely have any vcaches in use.

Change-Id: I875fc1d33c817dde2230946b852bb74f8ffd84c2
Reviewed-on: http://gerrit.openafs.org/4584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRename libcom_err to libafscom_err
Ben Kaduk [Sun, 19 Dec 2010 04:52:43 +0000 (23:52 -0500)]
Rename libcom_err to libafscom_err

We no longer provide a compatible libcom_err, and in fact
we renamed the symbols in our libcom_err several years ago
to reflect this fact.
When we build on a system where KRB5_LIBS includes
-lkrb5 -lcom_err , the new Unix build system will pick up
our libcom_err (as $(AFS_LDFLAGS) is the first argument in
AFS_LDRULE and pulls in a linker search path for our libcom_err)
which does not provide all the needed symbols for libkrb5.

Fully rename our libcom_err away to avoid these conflicts.

FIXES 128640

Reviewed-on: http://gerrit.openafs.org/3547
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 352c3e366c2e0a8de4550547192276e62afd2cc1)

Change-Id: I3aa116d280fe1b0efdfda79787f53fbee336a4e3
Reviewed-on: http://gerrit.openafs.org/4572
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoResync test harness with C TAP Harness 1.7
Russ Allbery [Thu, 28 Apr 2011 20:00:43 +0000 (13:00 -0700)]
Resync test harness with C TAP Harness 1.7

Includes the following upstream changes:

Add a more complete usage message to runtests and add support for a -h
command-line flag to display the usage message.

is_double() now takes a third argument, an epsilon.  Two numbers are
considered equal if their absolute difference is less than epsilon.
is_double() also now treats wanted and seen values of NaN (not a
number) as equal.  Thanks to PICCA Frédéric-Emmanuel for the proposed
changes.

The ok_program function in the shell libtap.sh library no longer
strips text after a colon and a space from the program output if the
expected status is non-zero.  Instead, if program output may contain
system-specific error messages after a colon and a space, put the new
function strip_colon_error before the program to do this stripping.
Thanks to Carsten Hey for the idea.

strip_colon_error is now smarter about preserving an initial word
ending in a colon (which is generally the program name) while still
stripping error messages later in the line.

The test_file_path function in the shell libtap.sh library now always
returns the empty string, rather than possible absolute paths starting
at /, if $BUILD and $SOURCE are not set.

Flush standard error in the C TAP library before printing results for
more deterministic output.  Thanks to Carsten Hey for the idea.

All of C TAP Harness now compiles with gcc -ansi -pedantic and should
be fully C89-compatible.  Note that either C99 or SUSv3 is required to
build C TAP Harness.  (This should not be a problem on any modern
platform.)  Based on work by Carsten Hey.

Simplify and improve output formatting in the summary of failing tests
in some edge cases.

Add explicit license statements to the files meant to be copied into
other packages rather than referring to LICENSE.

Add a test_file_path() function to the basic C and shell TAP
libraries, which searches the build and source directories for a
particular file and returns the full path.  This is a utility function
that can be used to find test data files.

Change-Id: I3ef84218f0e3a8b75f550c8b629b058330659b31
Reviewed-on: http://gerrit.openafs.org/4589
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoFix various build problems with the test suite
Russ Allbery [Thu, 28 Apr 2011 23:10:23 +0000 (16:10 -0700)]
Fix various build problems with the test suite

The cmd/command-t test requires libroken and was misspelled in the
TESTS file.  Multiple tests require LD_LIBRARY_PATH to be set to find
libafsroken if it hasn't been installed, so set it when running
runtests via make check.  (Note that this means runtests -o will not
work properly unless the user also sets LD_LIBRARY_PATH.)

Change-Id: Ib64f0505b3b75db33adb6c7b6452dcaac0b05dbc
Reviewed-on: http://gerrit.openafs.org/4594
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoResync Autoconf macros from rra-c-util 3.3
Russ Allbery [Thu, 28 Apr 2011 19:56:11 +0000 (12:56 -0700)]
Resync Autoconf macros from rra-c-util 3.3

This includes the following fixes:

* Include krb5.h before probing for the IBM-specific header file for
  obtaining error strings to avoid Autoconf warnings on AIX.

* Use [] to mark empty arguments to Autoconf macros.

* Add an explicit license statement to these Autoconf macros, matching
  the normal Autoconf macro license.

* Ensure rra_use_kerberos is always set so that other parts of configure
  can rely on it.

Change-Id: I521d38ad6834808cf09c798aeba0efc0dd741fd6
Reviewed-on: http://gerrit.openafs.org/4588
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoResync src/cf/gssapi.m4 with rra-c-util 3.3 (fixes OpenBSD)
Russ Allbery [Thu, 28 Apr 2011 19:50:35 +0000 (12:50 -0700)]
Resync src/cf/gssapi.m4 with rra-c-util 3.3 (fixes OpenBSD)

Resynchronize src/cf/gssapi.m4 with rra-c-util 3.3.  This includes
the following fixes:

* Handle the Heimdal GSS-API library on OpenBSD, which does not have
  a separate libroken.  Thanks to Antoine Verheijen for the analysis.

* Search /usr/kerberos/bin for krb5-config even if that isn't on the
  user's PATH to find krb5-config on some Red Hat versions.

* Use [] to mark empty arguments to Autoconf macros.

* Add an explicit license (matching the normal Autoconf macro license).

Change-Id: I6934ebcb3bfb0d763713aef159484b08849d4985
Reviewed-on: http://gerrit.openafs.org/4587
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agodoc: Fix 'vos endtrans' copyright
Andrew Deason [Thu, 28 Apr 2011 18:55:09 +0000 (13:55 -0500)]
doc: Fix 'vos endtrans' copyright

SNA owns this, not me.

Change-Id: I0ca601504467b825fffeca5a0529a2a529e37383
Reviewed-on: http://gerrit.openafs.org/4586
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Avoid ref leak on origin callback break
Andrew Deason [Wed, 27 Apr 2011 19:23:43 +0000 (14:23 -0500)]
viced: Avoid ref leak on origin callback break

When breaking a callback, sometimes we send a callback to the host
that performed the callback-inducing operation. When we do this,
currently BreakCallBack gives the origin host structure to
MultiBreakCallBack_r, which avoids releasing that host after the
callback is broken.

However, BreakCallBack obtains a reference to every host to which it
delivers a callback, even if it is the origin host, so a reference is
leaked. Fix this by not ever passing a host to MultiBreakCallBack_r,
and just have MultiBreakCallBack_r release a reference for every host
to which it delivers a callback break.

FIXES 129376

Change-Id: I88503f29f80d4233c062ff448fc4d912e401e8e4
Reviewed-on: http://gerrit.openafs.org/4581
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Transfer host ref in h_FindClient_r
Andrew Deason [Wed, 27 Apr 2011 18:51:23 +0000 (13:51 -0500)]
viced: Transfer host ref in h_FindClient_r

In h_FindClient_r, we can change which client structure we're dealing
with if we find a different client struct in the Rx conn-specific
data. We adjust the refcounts for the client structures themselves,
but not the associated hosts. While the host structures should be the
same most of the time, we are not guaranteed that, so adjust their
refcounts as well.

Change-Id: I01f447da3dd2dd4306525b99049c4cd7e27f5181
Reviewed-on: http://gerrit.openafs.org/4580
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agomacos: further next version support
Derrick Brashear [Tue, 26 Apr 2011 14:46:41 +0000 (10:46 -0400)]
macos: further next version support

try to optimize out things which will be missing

Reviewed-on: http://gerrit.openafs.org/4569
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a33f77b6e11214326f5e752de171602c0e9efe86)

Change-Id: Ie20120aad8cb477d532594b9462aca3cf993aabb
Reviewed-on: http://gerrit.openafs.org/4571
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoIRIX: set vfs pointer when creating new vcaches
Derrick Brashear [Tue, 26 Apr 2011 02:23:40 +0000 (22:23 -0400)]
IRIX: set vfs pointer when creating new vcaches

add missing call to set our vfsp on irix.

Reviewed-on: http://gerrit.openafs.org/4561
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7d72a8c5c4b9df417c9337c01e8a7f26d8f6280b)

Change-Id: If0cccaa47f1110eca347734bfbaedc0456e53b21
Reviewed-on: http://gerrit.openafs.org/4579
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoIRIX: set vfs pointer when creating new vcaches
Derrick Brashear [Tue, 26 Apr 2011 02:23:40 +0000 (22:23 -0400)]
IRIX: set vfs pointer when creating new vcaches

add missing call to set our vfsp on irix.

Change-Id: Id3b1c3d088e59ed535c20ef7516ce93004e78bff
Reviewed-on: http://gerrit.openafs.org/4561
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agocmd: Support splitting switches and values with '='
Simon Wilkinson [Wed, 20 Apr 2011 21:26:14 +0000 (22:26 +0100)]
cmd: Support splitting switches and values with '='

Some of our code uses arguments of the form -name=value. Add support
to libcmd for dealing with this type of argument, where name is
declared as CMD_SINGLE (or CMD_SINGLE_OR_FLAG)

Change-Id: Ifb7486abc4f6bf26594936ef11749c4fe29a2e9b
Reviewed-on: http://gerrit.openafs.org/4547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agocmd: Tidy up -help output
Simon Wilkinson [Tue, 19 Apr 2011 18:59:13 +0000 (19:59 +0100)]
cmd: Tidy up -help output

Tidy up the output that comes from cmd's -help option by wrapping
at 78 characters, and picking the breaks sensibly. This changes:

Usage: ./vos move -id <volume name or ID> -fromserver <machine name on source> -
frompartition <partition name on source> -toserver <machine name on destination>
 -topartition <partition name on destination> [-live] [-cell <cell name>] [-noau
th] [-localauth] [-verbose] [-encrypt] [-noresolve] [-help]

to...

Usage: ./vos move -id <volume name or ID>
         -fromserver <machine name on source>
         -frompartition <partition name on source>
         -toserver <machine name on destination>
         -topartition <partition name on destination> [-live]
         [-cell <cell name>] [-noauth] [-localauth] [-verbose]
         [-encrypt] [-noresolve] [-help]

Change-Id: I494c287a9370d052763b464df33e69a936edef71
Reviewed-on: http://gerrit.openafs.org/4546
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agocmd: Add support for params with optional values
Simon Wilkinson [Tue, 19 Apr 2011 18:37:37 +0000 (19:37 +0100)]
cmd: Add support for params with optional values

Add the CMD_SINGLE_OR_FLAG option which permits a parameter to
either have a single value, or no value at all. If it has no value,
then it behaves in the same way as the current 'flag' implementation.

Change-Id: I49cf313f1d3b9c369f87b1ff66bfcc038b8aa08a
Reviewed-on: http://gerrit.openafs.org/4545
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agocmd: Add parameter aliasing
Simon Wilkinson [Tue, 19 Apr 2011 11:20:14 +0000 (12:20 +0100)]
cmd: Add parameter aliasing

Add support for adding aliases for parameters, in the same way as we
can for syntaxes. This allows multiple different names for a single
option, as well as providing a way around problems with abbreviations.

Aliases may not be abbreviated.

Change-Id: I5c440cf006cd5fd0065ecf1e54213745428063f7
Reviewed-on: http://gerrit.openafs.org/4544
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agocmd: Add accessor functions for options
Simon Wilkinson [Tue, 19 Apr 2011 10:41:54 +0000 (11:41 +0100)]
cmd: Add accessor functions for options

Add a load of accessor functions to help with pulling values out
from the the cmd_syndesc structure. The idea here is to make it
simpler to manipulate command line values, as well as starting to
hide the structure of the cmd_syndesc structure from callers, with
a view to eventually making it private to the cmd library.

Change-Id: I38757d776364ceacd43e98fda16e995da35da65c
Reviewed-on: http://gerrit.openafs.org/4543
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agocmd: Add option to add a param at a specific pos
Simon Wilkinson [Tue, 19 Apr 2011 08:01:25 +0000 (09:01 +0100)]
cmd: Add option to add a param at a specific pos

Rather than having to use cmd_Seek, followed by cmd_AddParam,
followed by another cmd_Seek, add a function which permits parameters
to be added at specific reference points. This allows programs to
declare a list (either as an enum or specific #defines) of parameter
code points, rather than using raw numbers.

Change-Id: I25c0d501e678aa2818d296c776d8c5d03b8cdabe
Reviewed-on: http://gerrit.openafs.org/4542
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoAdd -usetokens option to libadmin test 'afscp'
Thomas L. Kula [Sun, 6 Feb 2011 01:11:56 +0000 (20:11 -0500)]
Add -usetokens option to libadmin test 'afscp'

This adds a -usetokens option to poorly named libadmin test 'afscp' program.
If called with this flag, 'afscp' will assume you have already acquired
tokens, and will fetch and use them. If ran with the -authcell option,
it will look for tokens for that cell, otherwise it will look for tokens
in the local cell. Since the function used to fetch local tokens is
incompatable with the kas functions, all of the kas commands have been
modified to complain and exit if any of them all called with -usetokens.

Fixed whitespace, again.

Change-Id: I4f9bcbae42f6eb179168bb5d152ed36df3db8dd5
Reviewed-on: http://gerrit.openafs.org/3899
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Steve Simmons <scs@umich.edu>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: Don't read pages beyond the cache eof
Simon Wilkinson [Mon, 25 Apr 2011 18:18:39 +0000 (14:18 -0400)]
Linux: Don't read pages beyond the cache eof

If we attempt to read past the end of the current cache file (for
example, when we're extending the file with ftruncate), don't force
the backend filesystem to populate that page with non-existent data.

This will hopefully fix a bus error when using tmpfs as a backing
cache.

FIXES 128452

Change-Id: I087aa1587885e97493130e5d05db6a1ed961181a
Reviewed-on: http://gerrit.openafs.org/4562
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoBuild libafscp when we lack kerberos
Andrew Deason [Tue, 26 Apr 2011 19:44:46 +0000 (14:44 -0500)]
Build libafscp when we lack kerberos

Currently, venus fails to build without kerberos, since the
dependencies for afsio always include afscp.h, which does not exist
when we do not build libafscp. To fix this the easy way, and since
libafscp is still very useful without kerberos, allow libafscp to
build without kerberos support (which limits it to anonymous
connections only).

Change-Id: Ief620ca99223f195795dcbe746b47fcbfa2e7450
Reviewed-on: http://gerrit.openafs.org/4577
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoIrix: Add a simple osi_ReadRandom implementation
Simon Wilkinson [Tue, 26 Apr 2011 19:48:32 +0000 (15:48 -0400)]
Irix: Add a simple osi_ReadRandom implementation

Add an implementation of osi_ReadRandom for Irix, which just panics
(Irix has no source of cryptographically safe entropy in the kernel).
Whilst hcrypto requires an implementation of osi_ReadRandom, nothing
in the current kernel module will cause it to be called, so this
panic should never be reached.

Change-Id: I7aa52f445182f8e660586241304a7379770afcaa
Reviewed-on: http://gerrit.openafs.org/4575
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chaz Chandler <clc31@inbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: Fix fallout from path_lookup commit
Marc Dionne [Wed, 30 Mar 2011 22:32:04 +0000 (18:32 -0400)]
Linux: Fix fallout from path_lookup commit

Fix a few issues with the recent commit to deal withg the removal
of path_lookup, spotted on RHEL 5:
- the configure tests needs fs.h to be included before namei.h, to
get the definition of struct inode
- we need to avoid the use of struct path unless its needed; on
older kernels the structure doesn't exist

(cherry-picked from commit f2e91cc3fe61956e7661eae9da82ddf746e63824)

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

14 years agosrc/afs: Set but unused variables warning fixes
Marc Dionne [Sat, 16 Apr 2011 20:38:45 +0000 (16:38 -0400)]
src/afs: Set but unused variables warning fixes

Fix a few simple cases of set but unused variables under src/afs.

Change-Id: I78964b7128590d5db1f2c01dd7157c23966c26a0
Reviewed-on: http://gerrit.openafs.org/4491
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoFix --without-krb5
Andrew Deason [Tue, 26 Apr 2011 19:32:25 +0000 (14:32 -0500)]
Fix --without-krb5

Currently, specifying --without-krb5 causes the AM_CONDITIONAL
KRB5_USES_COM_ERR to not be defined, which makes configure refuse to
run successfully. Fix this by forcing KRB5_USES_COM_ERR to always be
false if we are running explicitly without krb5.

Change-Id: I96274847a3dbbb8436ef04f24476606cb15c6618
Reviewed-on: http://gerrit.openafs.org/4576
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoRewrite asetkey to support extended key types
Simon Wilkinson [Tue, 1 Mar 2011 14:59:55 +0000 (14:59 +0000)]
Rewrite asetkey to support extended key types

Rewrite the asetkey binary so that it can support managing extended
key files.

Change-Id: Iad53e8cd4c193d8410d5f85d46d72629399b3189
Reviewed-on: http://gerrit.openafs.org/4574
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoafsio: remove unnecessary reference to malloc.h
Chaz Chandler [Tue, 26 Apr 2011 20:49:39 +0000 (16:49 -0400)]
afsio: remove unnecessary reference to malloc.h

Fixes breakage on freebsd for missing malloc.h, reported by GAWollman,
and, since roken.h already includes stdlib.h to pull in malloc, is no
longer necessary

Change-Id: Ie7785198124fe0dee394d7c15f032f0dadb6db8c
Change-Id: I1d5947155ba33de61d8fd23197e11c51e4791935
Reviewed-on: http://gerrit.openafs.org/4578
Reviewed-by: Chaz Chandler <clc31@inbox.com>
Tested-by: Chaz Chandler <clc31@inbox.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoubik: add uvote_HaveSyncAndVersion
Marc Dionne [Sat, 23 Apr 2011 02:23:21 +0000 (22:23 -0400)]
ubik: add uvote_HaveSyncAndVersion

Add a new function uvote_HaveSyncAndVersion() that combines the
logic from uvote_GetSyncSite and uvote_eq_dbVersion, without
releasing the vote lock in between.  Make use of it in
urecovery_AllBetter.

Change-Id: Ia44337da0f4335bd312cd686904f633ac19f1b63
Reviewed-on: http://gerrit.openafs.org/4526
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoubik: Defer updateUbikNetworkAddress until after RX startup
Marc Dionne [Sat, 23 Apr 2011 01:24:34 +0000 (21:24 -0400)]
ubik: Defer updateUbikNetworkAddress until after RX startup

The beacon package initialization has been moved to precede starting
RX services, but the broadcast of addresses to other servers should
be deferred until after RX is started.

Make updateUbikNetworkAddress an exported function and call it
from the general initilization sequence.

Change-Id: I903398ed275f460cc8373340eed9dac6a560e1da
Reviewed-on: http://gerrit.openafs.org/4525
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoubik: locking in recovery.c
Marc Dionne [Sat, 29 Jan 2011 19:37:23 +0000 (14:37 -0500)]
ubik: locking in recovery.c

Locking changes in recovery.c:
- In urecovery_Initialize, hold the DB lock over ReplayLog
and InitializeDB
- Hold the DB lock over larger portions of urecovery_interact.
Some values which should be protected were examined and modified
without holding any locks.
- In the early part of urecovery_interact, only take the DB lock
when it's really needed, now that some values are protected by other
locks.
- DoProbe is now called without the DB lock, so it doesn't need to
drop and re-aquire it.

Change-Id: I1899b672687f0ab0eb59c74ff802750cdc377ae6
Reviewed-on: http://gerrit.openafs.org/4524
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoubik: always hold DB lock for urecovery_ResetState()
Marc Dionne [Sat, 16 Apr 2011 18:19:57 +0000 (14:19 -0400)]
ubik: always hold DB lock for urecovery_ResetState()

ubik_ResetState requires callers to hold the DB lock, since it modifies
urecovery_state.  All callers of ubeacon_AmSyncSite outside of the beacon
package hold the DB lock, but calls from the beacon thread do not, and
can't block on getting the DB lock if we're sync site.

Add a beacon internal version of ubeacon_AmSyncSite that skips the
call to ResetState, and have the callers take the DB lock and call
ResetState themselves if needed.  They can take the lock in this case
because we know we're not the sync site.  Refactor the exported
ubeacon_AmSyncSite in terms of this new function.

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