]> git.michaelhowe.org Git - packages/o/openafs.git/log
packages/o/openafs.git
14 years agoSOLARIS: Include sys/varargs.h for kernel stdarg
Andrew Deason [Wed, 12 Jan 2011 16:29:46 +0000 (10:29 -0600)]
SOLARIS: Include sys/varargs.h for kernel stdarg

When compiling for the kernel, pre-10 Solaris seems to want
<sys/varargs.h> instead of <stdarg.h>, as documented in the Solaris
man pages. So include <sys/varargs.h> instead of <stdarg.h> where we
need variable arguments (afs_warn.c).

Reviewed-on: http://gerrit.openafs.org/3653
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 6d03eef7217be8f0b72f34ab023e69c976dea84d)

Change-Id: I473bcaa368c739265b911e79d596193f75ff8697
Reviewed-on: http://gerrit.openafs.org/3655
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: we're 64 bit capable
Derrick Brashear [Wed, 12 Jan 2011 21:55:09 +0000 (16:55 -0500)]
FBSD: we're 64 bit capable

define AFS_64BIT_ENV as we can support 64 bit long long integers.

Change-Id: If76168275333eca1b9505c5ead75b891550363ae
Reviewed-on: http://gerrit.openafs.org/3654
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD7: Don't sleep with the glock
Ben Kaduk [Mon, 20 Dec 2010 00:33:28 +0000 (19:33 -0500)]
FBSD7: Don't sleep with the glock

On FreeBSD 7.X, vinvalbuf() can (will) sleep; this results in a panic
when the kernel is configured with WITNESS and we hold the glock around
it.
Drop the glock in this case.

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

Change-Id: I3b22c12a20b33ca0e4df5a66c2edfc4167000a1c
Reviewed-on: http://gerrit.openafs.org/3650
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoBring FBSD 7.X client back to life
Ben Kaduk [Sun, 19 Dec 2010 04:52:44 +0000 (23:52 -0500)]
Bring FBSD 7.X client back to life

Having been untested for quite some time, we had several
places that needed more conditionals to compile on FreeBSD 7.

Now we compile and start on 7.3-RELEASE, but have locking issues
under actual use.

It seems that we are also incompatible with the Heimdal 0.6.3 in
the base system -- aklog is unable to actually obtain the needed
credential when compiled against that kerberos implementation;
using MIT krb5 1.6.3 from ports works without incident.

FIXES 128612

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

Change-Id: I148dbb0c5d8485d6f8fecae7a2d59e07a1a4d02b
Reviewed-on: http://gerrit.openafs.org/3649
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: switch to rx_Readv
Marc Dionne [Wed, 24 Nov 2010 00:08:24 +0000 (19:08 -0500)]
Cache bypass: switch to rx_Readv

Tests show that cache bypass doesn't scale very well past a few
concurrent processes, with a lot of lock contention in the RX
layer.  Switching the implementation to the iovec based rx_Readv
alleviates much of this.

Also take advantage of the fact that the upper layer readpages
only sends down contiguous lists of pages, and issue larger read
requests and populate the pagecache pages from the iovecs we
get back.  The loop logic is changed significantly to accomodate
the new pattern.

Read throughput is improved by about 30-40% for some parallel read
benchmarks I use.  Along with some other tweaks, it can allow the
throughput to be more than doubled.

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

Change-Id: Ie8801404c370f64b0075169d63cf790c71bf2537
Reviewed-on: http://gerrit.openafs.org/3647
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: Only compile bypass code for the Linux kernel
Marc Dionne [Tue, 23 Nov 2010 23:39:33 +0000 (18:39 -0500)]
Cache bypass: Only compile bypass code for the Linux kernel

Only compile the afs_bypasscache.c code if AFS_LINUX24_ENV is set,
since it's currently the only case where the code is actually used.
Only sections that caused problems for UKERNEL were previously
ifdef'ed.

Besides making the code cleaner, the main effect of this change
is to prevent compiling most of the bypass code for UKERNEL where
it isn't currently used.

If support for bypass is added for other platforms eventually, the
code here would need to be reworked anyway, ideally abstracting out
and moving any OS specific bits into the platform subdirectories.

Reviewed-on: http://gerrit.openafs.org/3374
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 46a6d6129d80c4027d8a9f0e1d06b32cc12d6367)

Change-Id: I042a30ac2a5e8156a233a0ff0f46aa5cd4fcd675
Reviewed-on: http://gerrit.openafs.org/3646
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: remove ifdefs under src/afs/LINUX
Marc Dionne [Tue, 23 Nov 2010 23:21:16 +0000 (18:21 -0500)]
Cache bypass: remove ifdefs under src/afs/LINUX

Compile cache bypass code unconditionally under src/afs/LINUX
since it is now always enabled.  Also remove syslog messages
about a "cache bypass patched module" when loading and unloading
the module.

Reviewed-on: http://gerrit.openafs.org/3373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9657695d34badaac654227be8c731a1512f2106b)

Change-Id: I57c44352f11ca7f68f6c3644345a7d48da8c1bf9
Reviewed-on: http://gerrit.openafs.org/3645
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: release and unlock pages when we get 0-length reply
Marc Dionne [Sun, 7 Nov 2010 20:06:16 +0000 (15:06 -0500)]
Cache bypass: release and unlock pages when we get 0-length reply

In some cases, such as reading past the end of file as known to the
server, fetchdata will get a 0 length reply.  Deal gracefully by
unlocking and releasing any pages reserved by readpages.  Failure
to do so here leads to deadlocks later as we can exit with some pages
still locked.

Reviewed-on: http://gerrit.openafs.org/3283
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e4250dc64eb26b5da1480e9f5bd58d016f81847f)

Change-Id: I54dc4ef040b816596cf48edf866976943220d988
Reviewed-on: http://gerrit.openafs.org/3644
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: adjust read size for non-contiguous readpages
Marc Dionne [Sun, 7 Nov 2010 18:35:36 +0000 (13:35 -0500)]
Cache bypass: adjust read size for non-contiguous readpages

The bypass code's readpages does deal with a non-contiguous list
of pages, but it doesn't adjust the size of the read it requests
from the background daemon accordingly.  As a result we'll ask the
server for pages we were not asked to read.

Reviewed-on: http://gerrit.openafs.org/3282
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 0b6b2b3cab09eacf9b03638d8770c83aeb0b8fea)

Change-Id: Ic7241fb27bd177eb7279292804def753f9120407
Reviewed-on: http://gerrit.openafs.org/3643
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: make readpage deal with reads at end of file
Marc Dionne [Sun, 7 Nov 2010 18:14:55 +0000 (13:14 -0500)]
Cache bypass: make readpage deal with reads at end of file

When a file's size is an exact multiple of the page size, the vfs
will issue a readpage for an extra page at the end, for which there
is no data.  Deal with it here instead of letting it trickle down
to the background daemon, which will issue an unnecessary read to the
server, and maybe get confused because there is no data.

Reviewed-on: http://gerrit.openafs.org/3281
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8ec31f26770ef1e85fb3a6005467f0e2d3ce1715)

Change-Id: Ib47a8cc62611c6e7c904898990b38ae48d8478e3
Reviewed-on: http://gerrit.openafs.org/3642
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: Remove AFS_KMAP_ATOMIC
Marc Dionne [Tue, 23 Nov 2010 22:50:25 +0000 (17:50 -0500)]
Cache bypass: Remove AFS_KMAP_ATOMIC

Since AFS_KMAP_ATOMIC is defined unconditionally, remove the ifdefs
and the code for the !AFS_KMAP_ATOMIC case.  We probably don't want
to support this feature on a kernel old enough not to have kmap_atomic.
This should exist on all 2.6 and even 2.4 linux kernels.

This simplifies the code for maintenance and later changes.

Reviewed-on: http://gerrit.openafs.org/3372
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1de6d5bb0122d00c398202451bf88042ea08aa3e)

Change-Id: I6d2970f9b8811e145e2a03105c64cbd6714c0c5a
Reviewed-on: http://gerrit.openafs.org/3641
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: fix use of incorrect "states"
Marc Dionne [Tue, 11 Jan 2011 02:31:18 +0000 (21:31 -0500)]
Cache bypass: fix use of incorrect "states"

Test and set the correct field for cache bypass flags.  There was
some confusion between cachingStates and the states associated with
vcache entries in a few places.

Reviewed-on: http://gerrit.openafs.org/3637
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8c541079573274d726180d3d9679c6a26cda84ea)

Change-Id: Ibaae9a766ef01cf4c68995c2bef454bae5d03b38
Reviewed-on: http://gerrit.openafs.org/3640
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: Fix oops in bypass transition functions
Marc Dionne [Fri, 5 Nov 2010 00:49:41 +0000 (20:49 -0400)]
Cache bypass: Fix oops in bypass transition functions

The FCSBypass flag might change between the time we check it before
entering afs_TransitionToCaching or afs_TransitionToBypass and when
we check it again within the functions.

Instead of panicing, just exit if someone beat us to it.  Also move
the checks within the write lock region to make sure the code
doesn't get run multiple times.

Reviewed-on: http://gerrit.openafs.org/3266
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f2c6ae300a211460c24c87752cf9400b9e61ee1f)

Change-Id: I3b7ad3f9672975a87dbe337256d42166fc638b34
Reviewed-on: http://gerrit.openafs.org/3639
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoZero rx_multi_lock before initializing it
Ben Kaduk [Mon, 20 Dec 2010 00:29:17 +0000 (19:29 -0500)]
Zero rx_multi_lock before initializing it

FreeBSD's kernel debugging facilities will panic if it detects
an attempt to re-initialize an already-initialized lock, as detected
through some particular bits being nonzero.  Zero everything out
before starting, to prevent this panic.

Reviewed-on: http://gerrit.openafs.org/3550
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 37c20528df26a43ec81b8e0f7658f1516d3c1b39)

Change-Id: I7e78989c313269388808c26d521f4075c0749cd4
Reviewed-on: http://gerrit.openafs.org/3638
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoprovide more verbose logging when VGetVolumeByVp_r fails
Tom Keiser [Wed, 13 Oct 2010 05:16:25 +0000 (01:16 -0400)]
provide more verbose logging when VGetVolumeByVp_r fails

FSYNC_com_VolOff() commits sepuku when VGetVolumeByVp_r() fails to return
a heavyweight ref to the volume.  This small patch provides more detailed
debugging information so we have a better idea why VGetVolumeByVp_r failed.

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

Change-Id: Ieebbf65b1764304f0b8e38bb32f0e4f61c332932
Reviewed-on: http://gerrit.openafs.org/3620
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: StopListener glocking fixup
Ben Kaduk [Sun, 19 Dec 2010 05:06:13 +0000 (00:06 -0500)]
FBSD: StopListener glocking fixup

afs_osi_Sleep requires the glock (so that it can sleep on it); we
dropped the glock earlier in osi_StopListener because soshutdown and
soclose can sleep, but we must (unconditionally!) acquire it for our
loop waiting on rxk_ListenerPid.

Change-Id: Ibea3da2c5d18a2609989b547a1c587c25e3f07ff
Reviewed-on: http://gerrit.openafs.org/3549
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 28032bc1c1aaa4c25e94025a8fa9e2b4e8131ce3)
Reviewed-on: http://gerrit.openafs.org/3633

14 years agovos: free ubulkentries with xdr_free
Jeffrey Altman [Fri, 24 Dec 2010 15:06:05 +0000 (10:06 -0500)]
vos: free ubulkentries with xdr_free

Instead of using free() to free the ubulkentries data structure
use xdr_free().

Reviewed-on: http://gerrit.openafs.org/3590
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit a7836dda8c1aab18c937c7e8909d4d9a678a53fa)

Change-Id: I9af8aee92e0e187923ccd952a5487ea419446720
Reviewed-on: http://gerrit.openafs.org/3626
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovos release: Avoid full dump on all sites
Andrew Deason [Thu, 11 Nov 2010 20:45:04 +0000 (14:45 -0600)]
vos release: Avoid full dump on all sites

Commit 9fed169b1c5c823fd96cea94daf712b2cf06c901 attempts to remove any
remote RO site that has RO_DONTUSE set. However, we set RO_DONTUSE on
all sites earlier in the release process if this is a full release,
resulting in all sites getting a full dump.

Correct this by remembering in 'origflags' what flags each site has
before we messed with the vldb entry.

Thanks to Mike Meffie.

Reviewed-on: http://gerrit.openafs.org/3296
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit 97474963e58253f8c891e9f6596403213d53527b)

Change-Id: I5a14c490dba7e1ad815856ccb3f90e210e09f50d
Reviewed-on: http://gerrit.openafs.org/3624
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agovolser: Fix broken bulk conversion
Simon Wilkinson [Sun, 26 Dec 2010 14:14:38 +0000 (14:14 +0000)]
volser: Fix broken bulk conversion

The converstions between the original, N and U bulk list return
values were all broken in various ways:

1/ Shifting from malloc to xdr_alloc() (in 4f1efdc8b73ed)
   subtly changed the behaviour when handling an empty list. The
   correct XDR representation of an empty list is {0, NULL}, not
   {0, &memZero}. Fix the code so that if the source list is empty,
   an empty destination list is returned.
2/ The destination list length was never being filled in. This means
   that xdr_free() could not be safely used on this list, as the wrong
   length would be passed to the allocator. Fill in the destination
   list length as part of the conversion.
3/ xdr_free(...) is a no-op when called with an empty list - there's
   no need to check before calling it. Remove these checks to improve
   the code's readability.
4/ xdr_free(...) should only be called when the RPC returned
   sucessfully. The stub is responsible for freeing data should the call
   fail mid way through unmarshalling.
5/ Where an RPC returns the number of entries independently of the
   length of a counted array, it is unsafe to use that length to
   iterate the array without checking that it is within the array
   bounds. Instead, just use the array length when performing
   conversions.

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

Change-Id: I1d3ec3929a8974d571e9b3712e53db4fceab4879
Reviewed-on: http://gerrit.openafs.org/3635
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovos: Abstract out bulk list conversion
Simon Wilkinson [Sun, 26 Dec 2010 14:00:42 +0000 (14:00 +0000)]
vos: Abstract out bulk list conversion

Pull the various segments of code that do bulk list conversion into
their own functions. This is purely code reorganisation at this point,
fixes for these functions will follow in subsequent patches.

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

Change-Id: Ib6b32fe942f5083e18f32404156a42cd82bf5c5a
Reviewed-on: http://gerrit.openafs.org/3634
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: band-aid vnode locking in lookup
Ben Kaduk [Sun, 24 Oct 2010 04:29:07 +0000 (00:29 -0400)]
FBSD: band-aid vnode locking in lookup

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

Change-Id: I594f31ba05c3847e5d83d89748266d24547bf97b
Reviewed-on: http://gerrit.openafs.org/3035
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/3632
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: close race in afs_root
Ben Kaduk [Sat, 6 Nov 2010 04:02:31 +0000 (00:02 -0400)]
FBSD: close race in afs_root

Previously, we called afs_PutVCache(afs_globalVp) directly.  This
is unsafe because PutVCache acquires locks which can sleep, losing
the serialization of the GLOCK.  In rare circumstances, this can
result in two threads simultaneously making that call, and the
second one would panic in vputx() with a negative refcount.
Close the race by using a local variable for the afs_PutVCache()
calls, applying the change to afs_globalVp before dropping the GLOCK.
While here, fix up other race conditions.

Change-Id: I4733489d50d3459172ee2eb021190d013f68018a
Reviewed-on: http://gerrit.openafs.org/3275
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/3631
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoUse afs_foff_t for file offsets
Andrew Deason [Wed, 10 Nov 2010 15:11:47 +0000 (09:11 -0600)]
Use afs_foff_t for file offsets

Some callers in vol and volser were not using afs_foff_t for file
offsets for calls to STREAM_ASEEK, FDH_TRUNC, FDH_PREAD, or
FDH_PWRITE. Most notably, in code for volume cloning, purging, and
dumping operations. Fix them to use afs_foff_t to prevent errors when
dealing with large special files.

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

Change-Id: I6f950fd23eba9e00470e424ae49ee6ce9d7ca6f4
Reviewed-on: http://gerrit.openafs.org/3618
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoHPUX: Allow des.c to compile
Andrew Deason [Tue, 21 Dec 2010 21:11:50 +0000 (16:11 -0500)]
HPUX: Allow des.c to compile

The HP-UX compiler does not like des.c without 'register' keywords. Be
sufficiently retro so the build can continue.

Change-Id: Ief032712893d96c2c198da82238eefe6807082cd
Reviewed-on: http://gerrit.openafs.org/3571
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoUpdate NEWS for 1.5.78 and 1.6.0pre1
Russ Allbery [Fri, 24 Dec 2010 18:53:22 +0000 (10:53 -0800)]
Update NEWS for 1.5.78 and 1.6.0pre1

Based on the release notes.  Add an entry for 1.6.0 with in progress
instead of a date to hold the release notes for 1.6.0pre1 rather than
creating separate entries for each release candidate.  Users who track
the release candidates can refer to the public announcements, and this
will be cleaner when reading history later on.

Reviewed-on: http://gerrit.openafs.org/3592
Tested-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 676a4efc232bc77fe20e46c2dbe45e89f89cd670)

Change-Id: I324e55c82bf2e353143368ccd4ca074a646d11d1
Reviewed-on: http://gerrit.openafs.org/3594
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoLINUX: Avoid unnecessary afs_ShakeLooseVCaches
Andrew Deason [Tue, 21 Dec 2010 15:31:39 +0000 (10:31 -0500)]
LINUX: Avoid unnecessary afs_ShakeLooseVCaches

Before some of the NewVCache refactoring, we only called
afs_ShakeLooseVCaches when afs_vcount was over (or equal to)
afs_maxvcount. Do this again, so we only try to shake loose vcaches
when we need more vcaches. Otherwise, we will call
afs_ShakeLooseVCaches every single time we want a new vcache when
dynamic vcaches are disabled (such as 2.4 Linux), and we log a warning
when we can't free any (which is likely when there are only 1 or 2
vcaches in use).

FIXES 128756

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

Change-Id: I9a108b38fa30e1a45f07c5d5d7d680d2b7d0257f
Reviewed-on: http://gerrit.openafs.org/3578
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: remove ifdefs under src/afs/LINUX24
Andrew Deason [Mon, 20 Dec 2010 22:29:37 +0000 (17:29 -0500)]
Cache bypass: remove ifdefs under src/afs/LINUX24

Same as commit 9657695d34badaac654227be8c731a1512f2106b, but for
LINUX24. Remove the AFS_CACHE_BYPASS references in LINUX24, since it
is always enabled. Also remove messages about a "cache bypass patched
module".

Reviewed-on: http://gerrit.openafs.org/3568
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 64e564b29e95898a6eb85dc527d046aab241fb8f)

Change-Id: Ia1165e1ff37c18417deef56e79ed791ca77d7a53
Reviewed-on: http://gerrit.openafs.org/3577
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: remove ifdefs under src/afs/LINUX
Marc Dionne [Tue, 23 Nov 2010 23:21:16 +0000 (18:21 -0500)]
Cache bypass: remove ifdefs under src/afs/LINUX

Compile cache bypass code unconditionally under src/afs/LINUX
since it is now always enabled.  Also remove syslog messages
about a "cache bypass patched module" when loading and unloading
the module.

Reviewed-on: http://gerrit.openafs.org/3373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9657695d34badaac654227be8c731a1512f2106b)

Change-Id: Id663878335875d191280f289b8b353c7834648de
Reviewed-on: http://gerrit.openafs.org/3576
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
15 years agoDARWIN: replace resource merge script ref with binary
Derrick Brashear [Tue, 21 Dec 2010 14:17:38 +0000 (09:17 -0500)]
DARWIN: replace resource merge script ref with binary

Ro is a helper tool; use Rez directly

Reviewed-on: http://gerrit.openafs.org/3565
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 468ff8e4d298baba9c2d4f96d1a3ec12cf64d0c7)
Change-Id: Ia1fed7345c38b891d644f459b97b36a9f2611a0a
Reviewed-on: http://gerrit.openafs.org/3567

15 years agoDARWIN: make growlagent build not run afoul of ._ fun
Derrick Brashear [Tue, 21 Dec 2010 13:58:31 +0000 (08:58 -0500)]
DARWIN: make growlagent build not run afoul of ._ fun

in some cases a git checkout would promptly merge the ._ file away,
meaning a subsequent build would fail. just use the developer tools
to set an icon instead of clever tricks.

(cherry picked from commit 0ef3ce2006b81f590c62a51b7ec903ebff24b9c8)
Reviewed-on: http://gerrit.openafs.org/3563
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I9c30a9b05fb776bff9b19adf58a701799cce0a27
Reviewed-on: http://gerrit.openafs.org/3566
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoSolaris: Support -i in shlib-build
Andrew Deason [Sun, 21 Nov 2010 23:57:22 +0000 (18:57 -0500)]
Solaris: Support -i in shlib-build

Our librokenafs.map file contains symbols that we may not actually
define, since the list of exported symbols varies depending on the
platform's capabilities. This causes errors during linking, which can
be suppressed by marking all symbols as "= EXTERN". Do so by having
shlib-build modify the mapfile at link-time, when -i is specified to
indicate ignoring undefined symbols.

Reviewed-on: http://gerrit.openafs.org/3365
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 222067f6f8fd4f596302befbc48918e10547ed1d)
Change-Id: I4bdf000bbdc10b0818c2fab6eaff912f18e1f4fb
Reviewed-on: http://gerrit.openafs.org/3561
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agobackup: pass in valid dummy pid for LWP
Derrick Brashear [Mon, 20 Dec 2010 21:24:26 +0000 (16:24 -0500)]
backup: pass in valid dummy pid for LWP

LWP_CreateProcess needs memory passed in; instead of a null pointer,
pass in a pointer to a PROCESS.

Reviewed-on: http://gerrit.openafs.org/3555
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 4f89d4ad348f1b20b9f27e8985fa09eafb6212e0)
Change-Id: I10c81fc3242294266468560628ff4f328e6e6997
Reviewed-on: http://gerrit.openafs.org/3560

15 years agoLINUX24: Define afs_linux_can_bypass
Andrew Deason [Mon, 20 Dec 2010 16:05:46 +0000 (11:05 -0500)]
LINUX24: Define afs_linux_can_bypass

We call afs_linux_can_bypass, so make sure it exists.

Reviewed-on: http://gerrit.openafs.org/3554
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ad0b390ec5303576cee37fa49bfd2a732b365a83)

Change-Id: Ie31976505170bb01895dfd8734267ab497af901c
Reviewed-on: http://gerrit.openafs.org/3559
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoLINUX24: Include linux/pagemap.h
Andrew Deason [Mon, 20 Dec 2010 15:07:11 +0000 (10:07 -0500)]
LINUX24: Include linux/pagemap.h

For 2.4 Linux we need to include linux/pagemap.h, otherwise we get
undeclared references to KM_USER0 and PAGE_CACHE_SIZE.

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

Change-Id: If290faf297c3c3267cd0969bbbc3036bae256f8e
Reviewed-on: http://gerrit.openafs.org/3558
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoOnly specify CFLAGS_NO* with --enable-checking
Andrew Deason [Tue, 23 Nov 2010 03:54:32 +0000 (22:54 -0500)]
Only specify CFLAGS_NO* with --enable-checking

Currently we are always specifying e.g. CFLAGS_NOUNUSED as -Wno-unused
when we think we are compiling with gcc. Since autoconf always tries
to use gcc when possible, this breaks the build if we have a gcc
available but we use another cc for building.

This should be fixed otherwise, but in the meantime at least make this
only happen if warnings are actually turned on, so the build is less
likely to break with a default ./configure invocation.

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

Change-Id: Ifd31548dfecdd1a4838047e2548a8b2265422d26
Reviewed-on: http://gerrit.openafs.org/3557
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agodarwin: fix fixed setpag error handling
Derrick Brashear [Sat, 18 Dec 2010 02:16:52 +0000 (21:16 -0500)]
darwin: fix fixed setpag error handling

looks like testing 9da7f3cc73bf990427a9dd80ba2bbbb618383ea3
failed to have the right dependencies. fixing the fix!

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

Change-Id: I461955f97646be673a73ca64d3e511b0b113a477
Reviewed-on: http://gerrit.openafs.org/3543
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoopenafs 1.6.0 pre1 openafs-stable-1_6_0pre1
Derrick Brashear [Thu, 16 Dec 2010 18:39:02 +0000 (13:39 -0500)]
openafs 1.6.0 pre1

make changes for prerelase 1 of 1.6.0

Change-Id: I04c61080dff4827b95b22238bfb08a26a4514955
Reviewed-on: http://gerrit.openafs.org/3536
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agomacos nfs translator vnode ref fix
Derrick Brashear [Wed, 15 Dec 2010 10:22:26 +0000 (05:22 -0500)]
macos nfs translator vnode ref fix

code won't trigger today but we might as well get it right.
we already ref the vnode. don't leak refs.

Change-Id: I6752819239cd3a88e1782596554595c3e862c413
Reviewed-on: http://gerrit.openafs.org/3535
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoLinux: Fix AFS_NORETURN violation with osi_AssertFailK
Anders Kaseorg [Sat, 6 Nov 2010 07:03:19 +0000 (03:03 -0400)]
Linux: Fix AFS_NORETURN violation with osi_AssertFailK

Commit d86f0c44d3c5910a6b54895484dc0286eac9bc73 changed the
AFS_LINUX26_ENV implementation of osi_AssertFailK so that it returns,
contradicting its AFS_NORETURN prototype, in an effort to make the
following BUG() display the right line number.  To fix this, move the
returning implementation into its only caller, the osi_Assert macro.

This fixes possible compiler misoptimizations due to

rx_kcommon.c:255:1: warning: ‘noreturn’ function does return

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3276
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1519144f83925d82117f31ce0872f77660f197ee)

Change-Id: I2b630a3264d04d6fbb626b7ef997da9bf081ade1
Reviewed-on: http://gerrit.openafs.org/3513
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
15 years agoAdd ioctl-based AFS calls for Solaris 11
Andrew Deason [Thu, 9 Dec 2010 00:16:14 +0000 (18:16 -0600)]
Add ioctl-based AFS calls for Solaris 11

Switch from using syscall-based AFS calls to ioctl-based AFS calls,
since syscall 65 was repurposed in some kernels in Solaris 11 and
OpenSolaris. Update the provided afs init script to accomodate the
additional steps needing for starting the AFS client.

Partially based off of some work by Derrick Brashear.

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

Change-Id: I4f10e0de116dc3e19b7bbcb3eb304c894a67160e
Reviewed-on: http://gerrit.openafs.org/3509
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoDARWIN: Fix setpag syscall error detection
Andrew Deason [Thu, 9 Dec 2010 19:02:16 +0000 (13:02 -0600)]
DARWIN: Fix setpag syscall error detection

Darwin uses the same variable as the return value for
ioctl_afs_syscall, and as the last 'out' parmater, so the return value
for ioctl_afs_syscall will always overwrite whatever is written to the
last 'out' parameter. Instead, record two different variables, and
allow the returned error to overridte the error set as the last
parameter.

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

Change-Id: I440d33e5cdd94dc5c7d12ddef1e63a05e53d787d
Reviewed-on: http://gerrit.openafs.org/3508
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoAdd afs init script for Solaris 11
Andrew Deason [Fri, 10 Dec 2010 20:43:24 +0000 (14:43 -0600)]
Add afs init script for Solaris 11

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

Change-Id: Iaf0241a8f5651dda1ad84ebb097350f0dc2bab85
Reviewed-on: http://gerrit.openafs.org/3507
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agouse computed values in src/gtx/curseswindows.c
Christof Hanke [Sun, 21 Nov 2010 19:09:23 +0000 (20:09 +0100)]
use computed values in src/gtx/curseswindows.c

compiling failed, because of -Wunused-value.
Use the return code of wstandout and wstandend and pass
it upwards.

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

Change-Id: I4623ba9c00ea19b33d73831f6f11ba2d2e32b1a0
Reviewed-on: http://gerrit.openafs.org/3511
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoUKERNEL: f_fsid is a struct on AIX
Andrew Deason [Thu, 4 Nov 2010 15:57:30 +0000 (10:57 -0500)]
UKERNEL: f_fsid is a struct on AIX

The statvfs f_fsid member is a struct with two fields on AIX when
_ALL_SOURCE is defined (which we define to get various extensions). So
in the AIX case, use it as such a struct instead of a single integer.

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

Change-Id: If8912f8cba8e12525f12f75cd53cf77bb7d4c547
Reviewed-on: http://gerrit.openafs.org/3510
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agorxi_NatKeepAliveEvent: Shrink excessive stack buffer
Anders Kaseorg [Wed, 8 Dec 2010 06:21:16 +0000 (01:21 -0500)]
rxi_NatKeepAliveEvent: Shrink excessive stack buffer

Fixes
rx.c:6138:1: warning: the frame size of 1600 bytes is larger than 1024 bytes

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3491
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3fd789dfbdc05c7c00798bc305d743deea05e155)

Change-Id: I8b39e5d4156a99e5435f7329d7d1b3465ddcadc2
Reviewed-on: http://gerrit.openafs.org/3506
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoCellServDB update 13 Dec 2010
GCO Public CellServDB [Mon, 13 Dec 2010 15:53:05 +0000 (10:53 -0500)]
CellServDB update 13 Dec 2010

Change-Id: I5048d1932943687bc2829326e32b530b2a8a9c41
Reviewed-on: http://gerrit.openafs.org/3504
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
15 years agouse proper 64bit casting for pointer-math
Christof Hanke [Fri, 19 Nov 2010 20:30:21 +0000 (21:30 +0100)]
use proper 64bit casting for pointer-math

building with "./configure --enable-checking --enable-supergroups"
fails, because on 64bit, the casting in map.c gives a warning.
Just add another ifdef and cast according to the size of a pointer.

Reviewed-on: http://gerrit.openafs.org/3341
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit acdef43d818ee56e6c1f1dc29f508c02793c8355)
Change-Id: If7dbe6f41f015025447e68eb1fc9ea14e56d6fe2
Reviewed-on: http://gerrit.openafs.org/3496
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoLinux: define llseek operations
Marc Dionne [Fri, 5 Nov 2010 21:30:02 +0000 (17:30 -0400)]
Linux: define llseek operations

With kernel 2.6.37 it is now mandatory to define the llseek operation
for files and directories.  If these are not defined, no_llseek is
called, and any attempt to seek returns ESPIPE.

Most file systems use generic_file_llseek, but it seems safer to use
default_llseek which is what the vfs used to call for us by default.
In 2.6.37 these two functions are actually functionally identical.

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

Change-Id: I30890cc3ad3f1a932218b6c8aac653cf747cdf2c
Reviewed-on: http://gerrit.openafs.org/3495
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoLinux: Fix prototypes for afs_xsetgroups and sys_setgroupsp and friends
Anders Kaseorg [Sat, 6 Nov 2010 07:17:17 +0000 (03:17 -0400)]
Linux: Fix prototypes for afs_xsetgroups and sys_setgroupsp and friends

Fixes some “warning: function declaration isn’t a prototype”, and
makes the prototypes consistent with the corresponding definitions.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3278
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c07b47169adb85621c328a3687ea62ef84e43bb1)

Change-Id: Ia91a598fc4b25f5fd7f29aed38a7caa3437ffc89
Reviewed-on: http://gerrit.openafs.org/3490
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agomodify FindIndex to compare uuids
Jeffrey Altman [Tue, 7 Dec 2010 04:24:18 +0000 (23:24 -0500)]
modify FindIndex to compare uuids

If FindIndex is provided a server address and entry has a valid
uuid, obtain the uuid for 'server' and use that search for a
matching entry.

This modification is necessary in order to permit operations
against multi-homed servers in split horizon DNS configurations.

Reviewed-on: http://gerrit.openafs.org/3468
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9aad0979e9ff0601c249eb66a6ecfb3e76264702)
Change-Id: If819975bd24e29da1142531c3f0eb27755e65afb
Reviewed-on: http://gerrit.openafs.org/3489

15 years agoConvert from using nvldbentry to uvldbentry
Jeffrey Altman [Sun, 6 Jun 2010 15:03:44 +0000 (11:03 -0400)]
Convert from using nvldbentry to uvldbentry

The support routines relied upon by vos use the older nvldbentry
data structures which do not include the UUID for the server.
This patchset updates the code to use the uvldbentry structure
so that a future patchset can make use of UUID values when available.

Any functions from vsprocs.c which are referenced by vos.c are
considered public.  This includes all of the VL_xxxx, UV_xxxx
and Lp_xxxx functions, the EnumerateEntry, SubEnumerateEntry, and
host mapping functions.  For any which references an nvldbentry as a
parameter a new 'U' version is created that accepts a uvldbentry.
These new 'U' functions are then used throughout vos.c and the internal
routines.

Reviewed-on: http://gerrit.openafs.org/2089
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 4f1efdc8b73ed734197925766530d033c6f9794a)
Change-Id: I85c8f56b706f5ad335968f3f9857b284a28024ef
Reviewed-on: http://gerrit.openafs.org/3488
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agovolser: Do not FSYNC_VOL_DONE temporary volumes
Andrew Deason [Thu, 30 Sep 2010 16:34:59 +0000 (11:34 -0500)]
volser: Do not FSYNC_VOL_DONE temporary volumes

Currently, the volserver just looks at the destroyMe field in a volume
header to see if it should tell the fileserver a volume has been
deleted (FSYNC_VOL_DONE opcode). However, temporary volumes created by
the volserver (such as new volumes or clones) have destroyMe set, but
are obviously not deleted, and so the fileserver should just be told
FSYNC_VOL_LEAVE_OFF about these volumes instead.

With commit bb9caf9822a53ad07cd3a5d6cea7f6b7eeeedd59, FSYNC_VOL_DONE
and FSYNC_VOL_LEAVE_OFF actually do different things, so this does
make a difference.

Note that this commit slightly changes the meaning of the
vp->needsPutBack field. Now it must be set to VOL_PUTBACK_DELETE to
tell the fileserver that the volume has been deleted, and set to
VOL_PUTBACK if it just needs to be given back to the fileserver.

Reviewed-on: http://gerrit.openafs.org/2872
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5988923898e15cb50d550e54119869b38cb5bc5b)
Change-Id: I1cbc48537a0b038838a8bc102842b05195d685c3
Reviewed-on: http://gerrit.openafs.org/3481

15 years agovol: Do not give back not-checked-out vols
Andrew Deason [Fri, 5 Nov 2010 21:48:28 +0000 (16:48 -0500)]
vol: Do not give back not-checked-out vols

VAttachVolumeByName_r has logic to give back a volume over FSSYNC if
we checked out a volume but failed to attach it for whatever reason.
However, the logic used for determining if the volume was checked out
or not is a bit inaccurate (even moreso than the comments imply),
potentially causing us to VOL_ON volumes that don't exist at all.

Instead of trying to guess based on various conditions whether or not
we checked out the volume, keep track of a variable that is only set
when we actually checkout the volume from the fileserver. Then only
give back the volume if it is set.

Reviewed-on: http://gerrit.openafs.org/3274
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e890f090e11d09b6e6b929642cbd92a56fb6e66e)
Change-Id: I3f42b2c0f54f30989f7a1a3fd18171deb4b814f1
Reviewed-on: http://gerrit.openafs.org/3480

15 years agoDAFS: Do not let VScheduleSalvage_r free vp
Andrew Deason [Fri, 5 Nov 2010 19:34:05 +0000 (14:34 -0500)]
DAFS: Do not let VScheduleSalvage_r free vp

In VScheduleSalvage_r, we were calling VCancelReservation_r, which has
the possibility of free'ing vp. Since we still use vp after doing this
(and since we're already inside VCancelReservation_r to begin with),
we must not free vp. Instead, just decrement nWaiters without
triggering any of the dtor code in VCancelReservation_r. This is safe
as long as all VScheduleSalvage_r callers ensure that they check to
free the vp if necessary, which they all do.

Thanks to Derrick Brashear.

Reviewed-on: http://gerrit.openafs.org/3272
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ef4b9e13ef6a79d7e5f540297e486189fdedf085)
Change-Id: I2f49d5eb6f9bad2343ee9a9c84ccbc1f323cc8a8
Reviewed-on: http://gerrit.openafs.org/3479

15 years agotweak afs server conn error handling
Derrick Brashear [Tue, 7 Dec 2010 05:34:11 +0000 (00:34 -0500)]
tweak afs server conn error handling

a bug in a 1.6 pullup of be770d4336c2fd7b8a83f18577ae6bb23a3f3e99,
properly mark servers down for rx errors except OPCODE

pulled up and failed to push edited change.

Change-Id: I329ab83646c30597548b08d5ed0a4f1f6cd3115d
Reviewed-on: http://gerrit.openafs.org/3470
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoafsd: Pass cacheMountDir to aix_vmount
Andrew Deason [Thu, 4 Nov 2010 15:33:17 +0000 (10:33 -0500)]
afsd: Pass cacheMountDir to aix_vmount

cacheMountDir is no longer global, so aix_vmount() needs it passed as
an argument. Do so.

Reviewed-on: http://gerrit.openafs.org/3259
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8401d0281f833638c1cfc5cb862d77fe97232ecb)
Change-Id: I2bd574981d6a63fca88f1a635db09521f6347e9f
Reviewed-on: http://gerrit.openafs.org/3461

15 years agoFBSD: clean up rx_socket teardown
Ben Kaduk [Sun, 28 Nov 2010 04:25:03 +0000 (23:25 -0500)]
FBSD: clean up rx_socket teardown

We had previously been waiting for the SO_ISDISCONNECTED flag
to show up in the so_state field, but the flags are not really
used for stateless protocols such as UDP, and that flag never
shows up.  Even with a full three-second wait, the rxk_Listener
sometimes still failed to fully terminate, preventing the reuse
of the rx port for a restarted afsd.
Copy from Solaris and loop until rxk_ListenerPid is zero, doing
bogus one-byte NetSends in the body of the loop.

Reviewed-on: http://gerrit.openafs.org/3391
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 622403c87a8cbcedcd1212fd32414285d103887b)

Change-Id: Ic5cfc4db2ff5b55730de31832b64bc1bf0696767
Reviewed-on: http://gerrit.openafs.org/3459
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
15 years agoFBSD: warning cleanups
Ben Kaduk [Sat, 30 Oct 2010 06:23:24 +0000 (02:23 -0400)]
FBSD: warning cleanups

Only declare 'p' if it will be used; other unused variables;
signedness mismatches.

Kill spl with fire.

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

Change-Id: Iac808cf603043a8996f1c8657765ef8a0a7e6d88
Change-Id: I163a4314a0598eec9a514bbc564d8dc2ff91acae
Reviewed-on: http://gerrit.openafs.org/3458
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
15 years agoCatch up on FBSD releases
Ben Kaduk [Sat, 27 Nov 2010 04:28:50 +0000 (23:28 -0500)]
Catch up on FBSD releases

Add param.foo.h and sysname entries for the past and forthcoming
FreeBSD 7.2, 7.3, 7.4, and 8.2 releases.  Also update the
MakefileProto.FBSD.ins that need touching, simplifying the libuafs
one in the process.

Reviewed-on: http://gerrit.openafs.org/3389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a4e4ed9de93d202d21cab4c40d37fcfacc85694e)
Change-Id: Icccc9f116c707a9af776f59231fc4999865b6344
Reviewed-on: http://gerrit.openafs.org/3457
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoproperly mark servers down for rx errors except OPCODE
Derrick Brashear [Mon, 6 Dec 2010 18:55:22 +0000 (13:55 -0500)]
properly mark servers down for rx errors except OPCODE

if we get a negative (rx) error, it means the server is down,
*except* for RXGEN_OPCODE. make this handling consistent
(cherry picked from commit be770d4336c2fd7b8a83f18577ae6bb23a3f3e99)

Change-Id: I97f161e19140591c304e748eead8dcc46852f94a
Reviewed-on: http://gerrit.openafs.org/3456
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoOpenBSD: Fix variable name typo in osi_vcache.c
Antoine Verheijen [Wed, 1 Dec 2010 22:40:04 +0000 (15:40 -0700)]
OpenBSD: Fix variable name typo in osi_vcache.c

The osi_PostPopulateVCache() routine in the OpenBSD version of
osi_vcache.c tries to use the non-existent variable "vc" instead
of "avc". This fixes it.

Reviewed-on: http://gerrit.openafs.org/3418
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit eaaba59773002ca3ba3e15d1aea69ae4b9493359)
Change-Id: Id2e4af53a371c3b9e605752424c74c082d0c4182
Reviewed-on: http://gerrit.openafs.org/3455
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoOpenBSD: Fix use of mstat Length field in osi_vm.c
Antoine Verheijen [Wed, 1 Dec 2010 21:24:26 +0000 (14:24 -0700)]
OpenBSD: Fix use of mstat Length field in osi_vm.c

The code for osi_VM_FlushPages() in osi_vm.c for OpenBSD incorrectly
tries to access field "m.Length" in the vcache structure "avc"
instead of "f.m.Length".

Reviewed-on: http://gerrit.openafs.org/3417
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 35daebc577ab11a5fd80d678764a3a681cc5f2f3)
Change-Id: Iffbccfdf0f066d0cb02bb39146afd9520c9bc277
Reviewed-on: http://gerrit.openafs.org/3454

15 years agoOpenBSD: Use Darwin version of afsi_SetServerIPRank() for OpenBSD 4.7 and above.
Antoine Verheijen [Wed, 1 Dec 2010 20:22:45 +0000 (13:22 -0700)]
OpenBSD: Use Darwin version of afsi_SetServerIPRank() for OpenBSD 4.7 and above.

With OpenBSD 4.7, the ia_subnet and ia_subnetmask fields have been removed
from the in_ifaddr structure as part of a cleanup that considers them
unnecessary. Thus, the version of afsi_SetServerIPRank() that OpenBSD was
using no longer compiles. On the other hand, the Darwin version of this
routine seems suited to OpenBSD's needs since it doesn't use those fields
so we'll use that version for OpenBSD 4.7 and above instead.

Reviewed-on: http://gerrit.openafs.org/3405
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2d2ac3ca5fbd221d297861c0b5c409e9e004545c)
Change-Id: I60c8aeb69484c87b10cdda8a317702d2f80ee849
Reviewed-on: http://gerrit.openafs.org/3453

15 years agoDarwin: Assign correct value to myDstaddr in afsi_SetServerIPRank()
Antoine Verheijen [Wed, 1 Dec 2010 18:54:23 +0000 (11:54 -0700)]
Darwin: Assign correct value to myDstaddr in afsi_SetServerIPRank()

The value in sin->sin_addr.s_addr that's assigned to myDstaddr in the
Darwin version of afsi_SetServerIPRank() is in network byte order but
really needs to be in host byte order.

Note: This patch assumes that change I66f5c790d8c55b359e3550b6d71f3abe040a2820
      has been previously installed. The patch fails otherwise.
Reviewed-on: http://gerrit.openafs.org/3402
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2822416059fe192dc7e3c261b1e93510f2f10f3e)
Change-Id: I6fba524733ecf35e60419d449838e93a7a5255a6
Reviewed-on: http://gerrit.openafs.org/3452

15 years agoDARWIN: Fix processing using rx_ifaddr_* macros in afsi_SetServerIPRank()
Antoine Verheijen [Wed, 1 Dec 2010 18:37:02 +0000 (11:37 -0700)]
DARWIN: Fix processing using rx_ifaddr_* macros in afsi_SetServerIPRank()

The macros rx_ifaddr_address, rx_ifaddr_netmask, and rx_ifaddr_dstaddress
all expand to a call to memcpy() which returns the destination address as
its return value. The test in the DARWIN version of afsi_SetServerIPRank()
for completion when using this macro, however, seems to assume that success
returns zero, which is wrong and results in myAddr, subnetmask, and
myDstaddr always being set to zero. This patch corrects this behaviour.

Reviewed-on: http://gerrit.openafs.org/3401
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8fa01c4d602fac6d5d81b119d0593f02087e4302)
Change-Id: If4a47f57a804a2492659d74a5e930f4a962f1748
Reviewed-on: http://gerrit.openafs.org/3451

15 years agofreebsd: properly track vcache references
Derrick Brashear [Thu, 2 Dec 2010 06:55:34 +0000 (01:55 -0500)]
freebsd: properly track vcache references

previously both root and reclaim could end up leaking refs. fix it.

Reviewed-on: http://gerrit.openafs.org/3424
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 6eb1088aad9163ab8d4a4dda513444290c55daa6)
Change-Id: I0c5c8554caf777e8c97529a7d640a79211a0300c
Reviewed-on: http://gerrit.openafs.org/3450

15 years agobalance afs_vcount in non-linux CM
Derrick Brashear [Thu, 2 Dec 2010 06:48:53 +0000 (01:48 -0500)]
balance afs_vcount in non-linux CM

when we dole out a vcache, count it.

Reviewed-on: http://gerrit.openafs.org/3423
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit bd2e024dc230693b1c6cbcfe40d4270a475b02d0)
Change-Id: Ie80dfd0be5e8c5560763b3fa50a27ed766340aa5
Reviewed-on: http://gerrit.openafs.org/3449

15 years agoLinux: 2.6.37 - replace get_sb with mount
Marc Dionne [Wed, 3 Nov 2010 00:54:20 +0000 (20:54 -0400)]
Linux: 2.6.37 - replace get_sb with mount

With kernel 2.6.37 the new entry point for mounting a filesystem
is the mount() operation instead of get_sb().

Replace afs_get_sb with afs_mount if the new operation is
available, and use mount_nodev instead of get_sb_nodev.

Note that this is not strictly required for 2.6.37 since the old
interfaces are still around, but we might as well switch now.

Reviewed-on: http://gerrit.openafs.org/3245
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2ea841feac2de8ade987c18cb7043aacfebe0d83)
Change-Id: I1f17068a1a06654568f30b75c5c65da0100995cd
Reviewed-on: http://gerrit.openafs.org/3251

15 years agoredhat init script fix missing space
Derrick Brashear [Mon, 22 Nov 2010 16:36:55 +0000 (11:36 -0500)]
redhat init script fix missing space

the if [] needed a space before the ]. fix it.

Reviewed-on: http://gerrit.openafs.org/3357
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 53d1fae4c422317dab0b7bf7fb0dedc5eb1f3607)
Change-Id: Iab0a729f44ad32c416c5898078c57d93142d3c5e
Reviewed-on: http://gerrit.openafs.org/3359

15 years agoLinux: Fix prototypes for sys_setgroups_stub and sys32_setgroups_stub
Anders Kaseorg [Sat, 6 Nov 2010 07:15:06 +0000 (03:15 -0400)]
Linux: Fix prototypes for sys_setgroups_stub and sys32_setgroups_stub

Fixes “warning: function declaration isn’t a prototype”.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3277
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 14980b477822ecc66e95f8c2a71f0fc11839afbd)

Change-Id: I8bbee19ae1a36b2222df224856d08ea71ce91d83
Reviewed-on: http://gerrit.openafs.org/3306
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoLinux: use DEFINE_MUTEX for afs_linux_alloc_sem on newer kernels
Alejandro R. Sedeño [Fri, 5 Nov 2010 21:24:43 +0000 (17:24 -0400)]
Linux: use DEFINE_MUTEX for afs_linux_alloc_sem on newer kernels

DECLARE_MUTEX is gone as of 2.6.37; afs_global_lock switches from
DECLARE_MUTEX to DEFINE_MUTEX at 2.6.16, so do the same here.

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3273
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f9409fcdffa594aff9530038a5ac81a2495da3b6)

Change-Id: If14d34183d8a28232f5f38fbe807c23dce1abf1b
Reviewed-on: http://gerrit.openafs.org/3287
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoviced: fix missing host lock in h_Enumerate
Michael Meffie [Thu, 11 Nov 2010 17:17:05 +0000 (12:17 -0500)]
viced: fix missing host lock in h_Enumerate

The global host lock must be held over h_Release_r. Fix the
the case in h_Enumerate where h_Release_r is called without
the global host lock held.

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

Change-Id: I10ac0ce495f2784ec270ebb50fc92c983cc0308b
Reviewed-on: http://gerrit.openafs.org/3295
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoRedHat: Remove potpourri.h from RedHat SPEC file manifest
Jonathan Billings [Fri, 5 Nov 2010 13:38:43 +0000 (09:38 -0400)]
RedHat:  Remove potpourri.h from RedHat SPEC file manifest

potpourri.h is no longer needed, so it should be removed from the
list of files to be installed.  The missing file was causing the
RPM package build process to fail.

Change-Id: I2226bfa5ce170cce252c8d55c13b23552a682150
Reviewed-on: http://gerrit.openafs.org/3267
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoopenafs 16 merge error on rx mutex inversion fix openafs-devel-1_5_78
Derrick Brashear [Thu, 4 Nov 2010 12:23:52 +0000 (08:23 -0400)]
openafs 16 merge error on rx mutex inversion fix

remove an extra bogus line left when cherry-picking.
(cherry picked from commit d5ce8d19ace9b87816dd36663420136f5f2ad746)

Change-Id: I4fa8cf8c4f0aafc04ffe7a9e48f2437dfb9e19db
Reviewed-on: http://gerrit.openafs.org/3256
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
15 years agoRX: Add rx_InterruptCall
Andrew Deason [Fri, 8 Oct 2010 20:39:21 +0000 (15:39 -0500)]
RX: Add rx_InterruptCall

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

Reviewed-on: http://gerrit.openafs.org/2982
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9fa496d11ff2a361b4693034f6caad90da995312)

Change-Id: I2e0f5eb2942830523b19d2596c50d0fba0fc9a1a
Reviewed-on: http://gerrit.openafs.org/3248
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
15 years agoWindows: Do not leak cm_volume_t objects from the LRU queue
Jeffrey Altman [Tue, 2 Nov 2010 20:16:20 +0000 (16:16 -0400)]
Windows: Do not leak cm_volume_t objects from the LRU queue

During cm_volume_t object recycling the object is removed
from the LRU to ensure that a single object is not recycled
by multiple threads at the same time.  Before cm_FindVolumeByName()
exits the object must be re-inserted into the LRU if it is not
present.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/3220
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 862e29a98aee72918fc25e960556f732ba80522c)
Change-Id: I11847718cb5321ff2b08850786cc147390040f42
Reviewed-on: http://gerrit.openafs.org/3246
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoRPM scripts should allow newbinary restart to restart
Derrick Brashear [Wed, 27 Oct 2010 00:13:38 +0000 (20:13 -0400)]
RPM scripts should allow newbinary restart to restart

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

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

Reviewed-on: http://gerrit.openafs.org/3163
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 812333c9a0d4722142d22186fe9b07b39fe6993b)
Change-Id: I54e58a5bb2ae88bfd4518c248fc9d3377c0c0981
Reviewed-on: http://gerrit.openafs.org/3235

15 years agorx mutex inversion fix
Derrick Brashear [Tue, 2 Nov 2010 18:47:35 +0000 (14:47 -0400)]
rx mutex inversion fix

as discovered by Benjamin Kaduk, we were usually holding rx_refcnt_mutex
but briefly, and here we held it longer, and thus around acquiring freepktQ
mutex. undo it by simply setting STATE_RESET sooner as newcall does.

(cherry picked from commit d5ce8d19ace9b87816dd36663420136f5f2ad746)

Change-Id: Ic4b13dcf09006d3c8171b63f254129fe202e7155
Reviewed-on: http://gerrit.openafs.org/3243
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoRx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex
Jeffrey Altman [Wed, 22 Sep 2010 23:36:03 +0000 (16:36 -0700)]
Rx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex

Add a new global mutex rx_refcnt_mutex to protect the conn->refCount
and call->refCount in place of relying upon the conn->conn_data_lock
and the call->lock.

This will relieve some lock contention with rx_ReceivePacket().

Reviewed-on: http://gerrit.openafs.org/2837
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5613ea60fc9431dbc87bc8ad6439f9b5af38af5c)

Change-Id: Ie8e72b1c3d68e698048594b5ceddf90910fbc05e
Reviewed-on: http://gerrit.openafs.org/3249
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
15 years agoviced don't double-print start time
Derrick Brashear [Wed, 27 Oct 2010 18:18:28 +0000 (14:18 -0400)]
viced don't double-print start time

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

Reviewed-on: http://gerrit.openafs.org/3173
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9749e5284cb8915d5e9b886bd74f1580d5bff28c)
Change-Id: I72975f54e7434f20fac32e4821801d43d13846ce
Reviewed-on: http://gerrit.openafs.org/3242
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agodon't duplicate work of ctime_s
Jeffrey Altman [Wed, 27 Oct 2010 18:25:10 +0000 (14:25 -0400)]
don't duplicate work of ctime_s

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

Reviewed-on: http://gerrit.openafs.org/3174
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 46cf6c8f365d25122c550b76be61a880d16f531b)
Change-Id: If9b63e4d8a377bc23be07ab82f3dc73779d95fa1
Reviewed-on: http://gerrit.openafs.org/3241
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agowindows: preserve lasterror prior to calling free
Rod Widdowson [Wed, 27 Oct 2010 19:08:28 +0000 (21:08 +0200)]
windows: preserve lasterror prior to calling free

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

Reviewed-on: http://gerrit.openafs.org/3175
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e1ed8ab1d93906e1b556de332fa32601a9a489fc)
Change-Id: I028a96a669fff3db48c05f2d894e9c6ef31fad12
Reviewed-on: http://gerrit.openafs.org/3240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agoWindows: fix built in touch
Rod Widdowson [Thu, 28 Oct 2010 17:34:41 +0000 (18:34 +0100)]
Windows:  fix built in touch

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

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

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

Reviewed-on: http://gerrit.openafs.org/3182
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 68aace4054430105ceaf52ce8e316f3ae01e7dc8)
Change-Id: Ia481b1b36dbecbeca5a9e69dbcd78b7a754f9cc9
Reviewed-on: http://gerrit.openafs.org/3239
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agobucoord: parallel make fix
Marc Dionne [Wed, 27 Oct 2010 00:33:41 +0000 (20:33 -0400)]
bucoord: parallel make fix

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

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

Reviewed-on: http://gerrit.openafs.org/3165
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0cc3cc9412c232e2ec799ee1f1a9a90f3e56ab66)
Change-Id: I453e6eced8145a0b361ce4a54baf9f7411128d2f
Reviewed-on: http://gerrit.openafs.org/3238
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agoFBSD: fix dumb panic when we can't pfind rxk_Listener
Ben Kaduk [Fri, 29 Oct 2010 02:45:33 +0000 (22:45 -0400)]
FBSD: fix dumb panic when we can't pfind rxk_Listener

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

Reviewed-on: http://gerrit.openafs.org/3186
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 832607318b9ad4ab38bb62515cdb4959cc21a656)
Change-Id: Ic4274a4a5640166669714798b909b2efb3b84cdb
Reviewed-on: http://gerrit.openafs.org/3237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agoWindows: Finish converting vol apps to pthread only
Jeffrey Altman [Thu, 28 Oct 2010 05:19:17 +0000 (01:19 -0400)]
Windows: Finish converting vol apps to pthread only

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

Reviewed-on: http://gerrit.openafs.org/3181
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5fce5754cee4f466f99681fcd7f42e5735e9776d)
Change-Id: I3b2215f017aae91a91e1a1955f34bf149679223b
Reviewed-on: http://gerrit.openafs.org/3236
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agoFBSD: lock interlock around v_usecount accesses
Ben Kaduk [Fri, 29 Oct 2010 16:01:04 +0000 (12:01 -0400)]
FBSD: lock interlock around v_usecount accesses

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

Reviewed-on: http://gerrit.openafs.org/3195
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b6367aa84b9d1c7529b6f3a12bbfeacc91384ffb)
Change-Id: I41ccb2b84347c4182d5b782faee176c9800d640a
Reviewed-on: http://gerrit.openafs.org/3234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agoFBSD: correct and simplify vcache eviction routines
Ben Kaduk [Fri, 29 Oct 2010 07:18:02 +0000 (03:18 -0400)]
FBSD: correct and simplify vcache eviction routines

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

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

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

Remove some stale comments.

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

Reviewed-on: http://gerrit.openafs.org/3196
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit aad83a30a82407bfa6ac15b49fd31d69b563e898)
Change-Id: Ibf7f1744f0030c92b45b1558d7f5e52409208e60
Reviewed-on: http://gerrit.openafs.org/3233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agoQuickStart Unix: use dafs type and name for demand attach file services
Rod Widdowson [Fri, 29 Oct 2010 18:57:50 +0000 (19:57 +0100)]
QuickStart Unix: use dafs type and name for demand attach file services

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

Reviewed-on: http://gerrit.openafs.org/3197
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 4f5cdd73f665434f531144151f9b6e1f4702cf02)
Change-Id: I301f61e507ad5947a786709af907a99b91725021
Reviewed-on: http://gerrit.openafs.org/3232
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agofs getfid defaults to '.', like other path-related commands
Phillip Moore [Tue, 19 Oct 2010 15:31:47 +0000 (11:31 -0400)]
fs getfid defaults to '.', like other path-related commands

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

Reviewed-on: http://gerrit.openafs.org/3008
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c77ac5ce976b6f3e5a13a3f739ddbb6e32a177b1)
Change-Id: I94ada76f835ccd01e2061034bd6585d6f1d5dccb
Reviewed-on: http://gerrit.openafs.org/3231

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

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

Reviewed-on: http://gerrit.openafs.org/3007
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d390df097cac0fb7815c43e071040559612b6360)
Change-Id: I930627e92672dd5012d5bca08d469f7fb7624be1
Reviewed-on: http://gerrit.openafs.org/3230

15 years agoMakes fs getfid error handling consistent with other fs commands
Phillip Moore [Tue, 19 Oct 2010 12:24:41 +0000 (08:24 -0400)]
Makes fs getfid error handling consistent with other fs commands

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

FIXES 128372

Reviewed-on: http://gerrit.openafs.org/3005
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b04a450df2e54a549f9c7e014016475fa566937b)
Change-Id: I63ae7edeff59bcd264a371c3bfd71220da4b4a39
Reviewed-on: http://gerrit.openafs.org/3229

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

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

Reviewed-on: http://gerrit.openafs.org/3009
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1fa575c09ea7aa66e657b226465cb90dbba4af70)
Change-Id: I0e748b513bcb97c436bd10c8a80222fc10fce08c
Reviewed-on: http://gerrit.openafs.org/3228

15 years agoQuickstart Guide: Add some verbiage about /vicepXX/AlwaysAttach
Jason Edgecombe [Tue, 26 Oct 2010 19:00:58 +0000 (15:00 -0400)]
Quickstart Guide: Add some verbiage about /vicepXX/AlwaysAttach

Reviewed-on: http://gerrit.openafs.org/3158
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9c8d58cd93b98120a7ff31a90b3f9f0ef354a1bc)
Change-Id: I11a6177257338520602e1cb6be029583e94c4b43
Reviewed-on: http://gerrit.openafs.org/3227
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agoLinux: remove stale prototype and references for read_super
Marc Dionne [Fri, 29 Oct 2010 20:23:07 +0000 (16:23 -0400)]
Linux: remove stale prototype and references for read_super

The 2.6 code doesn't have an afs_read_super, so remove the
prototype and the outdated comments that reference it.

Reviewed-on: http://gerrit.openafs.org/3199
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a546fc1707bc32ecb71d42dd48f91eebe3876439)
Change-Id: Id46c636faaf356bf6d7e08b4e22380f50e8dd944
Reviewed-on: http://gerrit.openafs.org/3226

15 years agokill off afs/debug.h
Derrick Brashear [Fri, 29 Oct 2010 17:47:17 +0000 (13:47 -0400)]
kill off afs/debug.h

as reported by Marc Dionne, debug.h was still redefinining assert()

yeah, let's be done with that.

(cherry picked from commit af0951f373224ce17b341bc5d227fdd5ea621762)
Reviewed-on: http://gerrit.openafs.org/3194
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I2af9e1a54bd291f779b5380c0f45f9527e3c7cd8
Reviewed-on: http://gerrit.openafs.org/3225
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
15 years agoQSG: DAFS uses dasalvager
Andrew Deason [Mon, 1 Nov 2010 22:30:20 +0000 (17:30 -0500)]
QSG: DAFS uses dasalvager

For DAFS, you want to use 'dasalvager' not 'salvager'. One place was
still referencing 'salvager' in a DAFS example, so fix it.

Reviewed-on: http://gerrit.openafs.org/3217
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 81602ffa3b6d981ab96ca17d970e585b7be28e6d)
Change-Id: I65f8e7816c8505cc2daddd4d646b65e6062cf686
Reviewed-on: http://gerrit.openafs.org/3224

15 years agoDAFS: Fix demand-salvages of attached volumes
Andrew Deason [Fri, 2 Jul 2010 21:57:42 +0000 (16:57 -0500)]
DAFS: Fix demand-salvages of attached volumes

Currently, when an error is encountered for an attached volume, we
call VRequestSalvage_r, which makes the volume go into the
VOL_STATE_SALVAGING state. This state implies that the volume is
offline, however, which is not necessarily the case if we're calling
VRequestSalvage_r from, for example, VAllocVnode_r or VUpdateVolume_r.

So now, make a new state called VOL_STATE_SALVAGE_REQ to indicate when
a salvage has been requested but the volume is not offline yet (and
thus is not yet ready to give to the salvager). If VCheckSalvage finds
a volume in this state, it offlines the volume first. The FSSYNC
VOL_OFF handler now checks for this state, and if we're giving the
volume to the salvager, we wait for the volume to exit that state.

VRequestSalvage_r also gains a new flag, VOL_SALVAGE_NO_OFFLINE. This
is to ensure that the existing salvaging code paths for unattached
volumes does not change (for when VRequesetSalvage_r is called from
attach2). If this flag is passed, we do what we used to do, which is
just salvage the volume without offlining it.

Reviewed-on: http://gerrit.openafs.org/2329
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0aa7fac246ce044c757530ebe96d3a05c2f33894)
Change-Id: I76db861c862789801d74578c4965a2bc41c2047b
Reviewed-on: http://gerrit.openafs.org/3223

15 years agoafs: minor cleanup for LINUX struct vcache
Chas Williams (CONTRACTOR) [Sat, 30 Oct 2010 22:10:34 +0000 (18:10 -0400)]
afs: minor cleanup for LINUX struct vcache

mapcnt is no longer used in either linux client and should be removed
to save a little space/sanity.

Reviewed-on: http://gerrit.openafs.org/3207
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c120f5c9b64a1333f965125dcfc435e922b47356)
Change-Id: I33e3f312ca07e9e2f7f5453495d6695a42e2cc19
Reviewed-on: http://gerrit.openafs.org/3222
Tested-by: BuildBot <buildbot@rampaginggeek.com>
15 years agovol: attach2 must always return with VOL_LOCK held
Jeffrey Altman [Thu, 28 Oct 2010 04:37:03 +0000 (00:37 -0400)]
vol: attach2 must always return with VOL_LOCK held

attach2() is required to return with the VOL_LOCK held
even though it is called without it.  This must be true
for error conditions as well.  Not all error paths are
obtaining the VOL_LOCK before returning.  Add out paths for
lock held and lock unheld error cases.

(cherry picked from commit 58901738ad6280d0777dd8e77f8c09cc45da04bc)
Reviewed-on: http://gerrit.openafs.org/3177
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I6918987cd784e4e550c2525b537bda290dbacae8
Reviewed-on: http://gerrit.openafs.org/3221
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>