openafs.git
11 years agoAdjust afs_lockctl to compensate for byte-range lock fixes
Anders Kaseorg [Sun, 21 Feb 2010 01:52:06 +0000]
Adjust afs_lockctl to compensate for byte-range lock fixes

As of commit 49b7bbdd3b45df694fadbef48f9ed99d9bfe07b9, l_len is no
longer 1 less than it should be.  Update afs_lockctl to expect this.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Change-Id: I3fb7665457d489e56564b14933795084a0958d6f
Reviewed-on: http://gerrit.openafs.org/1353
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: Fix conversion of whole-file locks
Anders Kaseorg [Sun, 21 Feb 2010 01:28:42 +0000]
Linux: Fix conversion of whole-file locks

An overflow bug in commit 49b7bbdd3b45df694fadbef48f9ed99d9bfe07b9
caused whole-file locks to be treated as byte-range locks, which fail
to be propagated to other machines.

Fix this by setting l_len = 0 for locks that range to the end of the
file.

FIXES 126561

Change-Id: Ie2dc9d04f33559c73b3b86b64152c549b785f8ad
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/1352
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAbstract /vicepX header traversal
Andrew Deason [Wed, 27 Jan 2010 21:08:34 +0000]
Abstract /vicepX header traversal

The code for examining all of the headers on a vice partition now exists
in two places: the VGC scanner, and the salvager. Create the
VWalkVolumeHeaders function that contains the common logic so it's in
one place, and take a couple of function callbacks for the differences.

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

11 years agoAllow GetSomeSpace_r to select an optimal host
Andrew Deason [Mon, 15 Feb 2010 22:22:56 +0000]
Allow GetSomeSpace_r to select an optimal host

Previously GetSomeSpace_r would never find an 'ideal' host for which to
clear callbacks, since lih0_r and lih1_r required a non-NULL rock to do
anything. Remove the requirement for the passed-in host rock to be
non-NULL, and make lih*_r more threadsafe, by passing in a parameter
struct for the rock.

Also attempt to make the GSS_r code a bit more clear with some
descriptive variable names and such.

FIXES 126451

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

11 years agoh_TossStuff_r: make sure host does not go away
Andrew Deason [Tue, 16 Feb 2010 17:08:38 +0000]
h_TossStuff_r: make sure host does not go away

When h_TossStuff_r h_NBLock_r's a host, it is not only possible for
someone else to grab a hold on the host, but in theory it's also
possible for someone to hold a host, release it, and for the host to be
deleted again (assuming some callers hold HOSTDELETED hosts, which they
should not be doing).

To make this safety check a bit more robust, hold the host in
h_TossStuff_r before h_NBLock_r'ing, to ensure that it does not go away
while we're waiting for H_LOCK.

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

11 years agoanalyze warning fix
Derrick Brashear [Mon, 22 Feb 2010 18:58:58 +0000]
analyze warning fix

initialize variable. warnings caught this in the other compiler

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

11 years agoPrevent deadlock if fs_stateSave panics
Andrew Deason [Mon, 22 Feb 2010 17:56:07 +0000]
Prevent deadlock if fs_stateSave panics

fs_stateSave can call ShutDownAndCore(PANIC) if it detects host list
corruption. Right now this will deadlock the shutdown thread, since
we're still holding a read lock on the FS state when we do so, and
ShutDownAndCore will attempt to acquire a write lock. Do two things to
make this a bit better:

 -- Unlock the FS state before calling fs_stateSave, sine we're no
 longer looking at the FS state (the 'state' in fs_stateSave refers to
 the host list and callback lists, not the state locked by
 FS_STATE_*LOCK)

 -- If ShutDownAndCore detects that it was called inside of
 ShutDownAndCore, skip shutting down the volume and host packages, since
 they have already been shut down

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

11 years agoCheck for HOSTDELETED before h_Hold_r
Andrew Deason [Fri, 12 Feb 2010 23:44:31 +0000]
Check for HOSTDELETED before h_Hold_r

A few places h_Hold_r a host and later drop and reacquire H_LOCK without
checking if the hostFlags contains HOSTDELETED. This can cause a race
with h_TossStuff_r where we later reference a host that is about to be
freed or already has been freed.

Add checks for HOSTDELETED in these places, and skip over the deleted
hosts.

FIXES 126454

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

11 years agoCorrect the h_Enumerate_r hostList safety check
Andrew Deason [Fri, 12 Feb 2010 22:30:44 +0000]
Correct the h_Enumerate_r hostList safety check

Ide1e5aca7c2c4a4af3f62bc07821db694f2f9999 added safety checks for a few
traversals through hostList, including the traversal in h_Enumerate_r.
Unfortunately, h_Enumerate_r may not hold H_LOCK over its entire
traversal (h_Release_r can drop and reacquire it), so the value of
hostCount is not guaranteed to stay the same.

A host may be deleted during the loop, or right near the end, decreasing
hostCount to below our current running 'count' of hosts, triggering the
panic unnecessarily.

Also, we break out of the loop if the H_ENUMERATE_ISSET_BAIL test
succeeds, making the panic also incorrectly trigger then.

So instead, remember the value of hostCount, and ensure that we've
actually exceeded that count in the post-loop check.

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

11 years agoh_TossStuff_r: check held-ness after lock
Andrew Deason [Mon, 15 Feb 2010 16:55:33 +0000]
h_TossStuff_r: check held-ness after lock

h_TossStuff_r checks if a host is held or locked by another thread
before trying to delete the host. Unfortunately, it checks if it is
locked before checking if it is held, and the lock check drops H_LOCK.
Thus, another thread could hold the host while we don't have H_LOCK, and
we could delete a host that is being held.

Although it is a bug if any thread holds a host that is being deleted,
some instances of this still exist, so make the check more robust.
Reverse the order of the tests, so we detect if someone held the host
while the lock check dropped H_LOCK.

Also log when this happens, as it indicates a bug occurring.

FIXES 126454

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

11 years agoanalyze paranoia
Derrick Brashear [Mon, 22 Feb 2010 17:15:15 +0000]
analyze paranoia

don't pass a null pointer to FindVolume in case one shows up

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

11 years agoidledead client dont interrupt writes
Derrick Brashear [Sun, 21 Feb 2010 22:15:26 +0000]
idledead client dont interrupt writes

allowing failover is nonsensical, there's nothing to fail to. keep trying to
write. if we want to change this, we need to handle it better than just this.

Change-Id: Ibed4c63182f44ed9e659895e4868b4192d004688
Reviewed-on: http://gerrit.openafs.org/1355
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoInit ih_synced for new ihandle
Rainer Toebbicke [Fri, 19 Feb 2010 09:26:57 +0000]
Init ih_synced for new ihandle

One small step towards a valgrind-tolerant universe: ih_synced
indicates that an inode should be synced which better be deterministic.

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

11 years agoAvoid dprintf conflict
Marc Dionne [Fri, 19 Feb 2010 02:20:20 +0000]
Avoid dprintf conflict

Rename dprintf to afs_dprintf to avoid potential conflict with
system headers on some platforms.

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

11 years agoLinux: bdi doesn't always have a name
Simon Wilkinson [Thu, 18 Feb 2010 23:09:40 +0000]
Linux: bdi doesn't always have a name

The 'name' element of the backing_dev_info structure is new in
2.6.32 - add yet another configure test, and #ifdef to protect our
setting of it.

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

11 years agoUnix: Fix objdir builds
Simon Wilkinson [Wed, 17 Feb 2010 13:46:23 +0000]
Unix: Fix objdir builds

Make some changes to the Unix build system so that object directory
builds work again. In particular, change the way that we call
xcodebuild on Darwin, so that source and binary can live in different
places.

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

11 years agoAdd xdrmem and xdrlen to shlib builds
Simon Wilkinson [Sun, 14 Feb 2010 00:45:19 +0000]
Add xdrmem and xdrlen to shlib builds

Another day, another set of forgotten build objects ...

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

11 years agoAdd support for amd64_obsd46
Andrew Deason [Wed, 17 Feb 2010 18:05:53 +0000]
Add support for amd64_obsd46

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

11 years agoInclude stdint.h when using intptr_t
Andrew Deason [Wed, 17 Feb 2010 18:56:51 +0000]
Include stdint.h when using intptr_t

Some platforms such as OpenBSD require including stdint.h before you can
use intptr_t. So, include stdint.h (if it is available) whenever we use
intptr_t.

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

11 years agokill macos prior to panther
Derrick Brashear [Wed, 17 Feb 2010 18:26:43 +0000]
kill macos prior to panther

we haven't had a 10.2 machine to build on in quite a while...

might as well pull it, it probably doesn't work anymore

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

11 years agosalvager: avoid needing temp files to stay around
Andrew Deason [Wed, 2 Dec 2009 19:37:27 +0000]
salvager: avoid needing temp files to stay around

The salvager makes use of a couple of temporary files to store some
information while doing a salvage. Instead of referring to these files
by path name everywhere, pass around file handles instead. That way we
can unlink the files immediately, and they will be deleted on close.
This removes one of the roadblocks to allowing multiple salvages on the
same partition to occur at once (since otherwise other salvagers would
remove the temporary files on startup), and also makes it much less
likely that old temporary files will be left lying around in the first
place.

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

11 years agoDAFS: Maintain viced volume group hierarchy cache
Andrew Deason [Thu, 4 Feb 2010 22:47:19 +0000]
DAFS: Maintain viced volume group hierarchy cache

When salvaging a volume (with DAFS or not), it is required to read the
volume headers of all volumes on the partition, so we know what volumes
are in the same volume group as the salvaged volume. Currently with
DAFS, this requirement can make demand-salvages very slow, since each
demand-salvage must read each volume header on the partition.

So, instead of having each demand-salvage read the volume headers
itself, have a demand-salvage request the required volume group
hierarchy information from the fileserver. The fileserver will scan the
partition's volume headers, and will keep the hierarchy cached in
memory. Any modifications to this hierarchy from volume
creation/deletion will update this volume group cache (VGC) via FSSYNC
commands.

This results in a dramatic salvaging speedup when many demand-salvages
are requested, and eliminates the cases where DAFS salvaging can be
significantly slower than non-DAFS salvaging.

FIXES 124488

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

11 years agoAdd a general file-level locking API
Andrew Deason [Thu, 4 Feb 2010 22:08:48 +0000]
Add a general file-level locking API

Add an API for acquiring and releasing file-level locks. This abstracts
away the platform-specific aspects of file locking, and also makes the
locking work when several threads attempt to acquire a lock within the
same process.

This commit just adds the functions and datatypes; nothing actually uses
them. The users will be added in (hopefully nearby) future commits.

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

11 years agolinux bdi allocate memory
Derrick Brashear [Tue, 16 Feb 2010 18:10:09 +0000]
linux bdi allocate memory

allocate bdi with osi_Alloc (and free with osi_Free)
seems to fix an oops

FIXES 126514

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

11 years agoaklog: Refactor token management operations
Simon Wilkinson [Sat, 13 Feb 2010 01:14:07 +0000]
aklog: Refactor token management operations

Pull the token management operations (get, set and compare tokens) out
into their own functions. Again, this is purely a refactoring exercise -
no behaviour changes are anticipated as a result of this change.

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

11 years agoaklog: Refactor token acquisition code
Simon Wilkinson [Fri, 12 Feb 2010 23:38:09 +0000]
aklog: Refactor token acquisition code

This change refactors all of the rxkad specific token acquisition code
out of the common auth_cell loop, and into a number of functions of its
own. There should be no functional changes.

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

11 years agoaklog: Use a function to print debug statements
Simon Wilkinson [Fri, 12 Feb 2010 11:54:17 +0000]
aklog: Use a function to print debug statements

aklog was scattered with things like
    if (dflag) {
printf("Oh no, the world is ending\n");
    }

Simplify these by adding a dprintf() function, which only prints its
arguments if dflag is defined. Use this throughout the code.

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

11 years agoaklog: Actually use new get_realm_from_cred fn
Simon Wilkinson [Wed, 17 Feb 2010 14:01:14 +0000]
aklog: Actually use new get_realm_from_cred fn

An earlier patch added the new get_realm_from_cred function,
but failed to update the callsite to use it. Fix that.

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

11 years agoaklog: Tidy realm handling
Simon Wilkinson [Fri, 12 Feb 2010 11:13:16 +0000]
aklog: Tidy realm handling

Assorted small changes to the way realms are handled by aklog:
  * Remove static buffers when realms are passed between functions
  * Add cleanup for all dynamically allocated strings to auth_to_cell
  * Create an extract_realm helper function to handle extracting realm
    information from principals.
  * Add a function to handle extracting realm information from decoded
    tickets

Change-Id: I320389033f4862d30774b40103e536fd5bac841b
Reviewed-on: http://gerrit.openafs.org/1323
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoaklog: Dispose of the pointless confname string
Simon Wilkinson [Fri, 12 Feb 2010 10:29:00 +0000]
aklog: Dispose of the pointless confname string

confname makes a static copy of the AFSDIR_CLIENT_ETC_DIRPATH string. As
pr_Initialize takes it as const, there's no need to maintain our own
copy, and so this is superfluous. Remove it.

Change-Id: I64b13aae80b15f6b7511a040f39467bca76186b8
Reviewed-on: http://gerrit.openafs.org/1322
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoaklog: Clean up cell handling
Simon Wilkinson [Fri, 12 Feb 2010 10:19:26 +0000]
aklog: Clean up cell handling

Clean up the aklog get_cellconfig routine, so that it is no longer
reliant upon global variables.
  * Tidy the handling of local_cell, and use dynamically allocated,
    rather than fixed length buffers.
  * Use the cell name contained within the afsconf_cell structure,
    rather than a local copy
  * Access linked cell information from afsconf_cell, rather than
    explicitly returning it
  * Don't use globals for linkedcell

Change-Id: I6ad42c70dcac7f285997be7c95a77dc67bf63679
Reviewed-on: http://gerrit.openafs.org/1321
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoaklog: Cosmetic cleanup
Simon Wilkinson [Fri, 12 Feb 2010 09:48:44 +0000]
aklog: Cosmetic cleanup

Fix indentation so that code lines up correctly,
Fix function declarations so they match the house style.
Remove some dead code and comments
Move comment blocks so they're above the code that they're describing.
Remove unused 'lastcell' string

Change-Id: Ief924675384e28885e4b7b88c4d5932279c9b26e
Reviewed-on: http://gerrit.openafs.org/1320
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoUnix CM: Tidy up the statistics interface
Simon Wilkinson [Sun, 7 Feb 2010 20:51:55 +0000]
Unix CM: Tidy up the statistics interface

Sort out the function call statistics interface. Whilst it's still
wretched, this makes it a little less so.
*) Add some warnings at the start of the afs_CMStats structure about
   what needs to be done when adding things there
*) Remove the conditionals around the CacheBypass counters, so that stats
   clients don't need to be built with the same options as servers
*) Add all of the stats entries added after IBM to the xstat_cm_test
   routine
*) Add a warning to xstat_cm_test if the data returned from the server
   differs in size to the local stats structure.

Change-Id: If1ffb68c84bca972f685ae619febba8c6f8b5e17
Reviewed-on: http://gerrit.openafs.org/1319
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoprdb_verify -rebuild with supergroups fix
Jason Rogers [Mon, 15 Feb 2010 23:19:12 +0000]
prdb_verify -rebuild with supergroups fix

This change eliminates the redundant iteration over the
supergroup[] array in DumpRecreate. By iterating over both
this array and entries[], duplicate au lines are created
and the count variable becomes incorrect. Furthermore,
the au lines created in the supergroups[] section were
incorrectly in the form of au <group> <member> instead
of au <member> <group>.

FIXES 126500

Change-Id: I087772b63934406273f153f4b8a581d965f1e4d5
Reviewed-on: http://gerrit.openafs.org/1316
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agomacos bulkstat support
Derrick Brashear [Fri, 12 Feb 2010 21:46:33 +0000]
macos bulkstat support

add KPI-based bulkstat support for macos

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

11 years agoxdrmem for ukernel
Derrick Brashear [Tue, 16 Feb 2010 04:51:52 +0000]
xdrmem for ukernel

fix up the build for ukernel when warnings are enabled

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

11 years agoUnix CM: Add xdrmem and xdrlen to kernel builds
Simon Wilkinson [Sun, 14 Feb 2010 00:45:19 +0000]
Unix CM: Add xdrmem and xdrlen to kernel builds

Add the new xdrmem and xdrlen XDR sources to kernel space. Make some
changes to the xdrmem header file to permit it to build in kernel space.

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

11 years agoAdd xdrlen and xdrmem to pthread build
Simon Wilkinson [Sun, 14 Feb 2010 00:38:47 +0000]
Add xdrlen and xdrmem to pthread build

Add xdrlen and xdrmem to libafsrpc, so they're available to pthreaded
binaries.

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

11 years agoRemove the old new token interface
Simon Wilkinson [Sat, 6 Feb 2010 13:20:34 +0000]
Remove the old new token interface

ktc.c has had for a long, long time a 'new' token interface, which
was only enabled if KERNEL_KTC_COMPAT is set. However, this is never
defined in our tree, relies on a syscall that just won't work on
platforms such as Linux, and won't support any of the new token
formats we're planning. So, just remove this interface from our
code - it's in version control should we want to revisit it in the
future.

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

11 years agoHave bosserver catch SIGTERM and shut down gracefully.
Adam Megacz [Mon, 15 Feb 2010 01:30:42 +0000]
Have bosserver catch SIGTERM and shut down gracefully.

Many modern process supervision systems (runsv, daemontools, sysvinit)
expect to be able to terminate a process gracefully by sending it a
SIGTERM; although SIGQUIT is nominally used for this purpose it seems
to have fallen into disuse as a matter of practice.  Therefore, to
integrate as smoothly as possible with the outside world, bosserver
should catch SIGTERM and interpret it as a request to shut down
gracefully.

When used with process supervision (runsv or daemontools), the
previous behavior would cause bosserver to die but leave its children
running, and then bosserver would get restarted by the supervisor.
The result is a situation where there would be two copies of every
bnode process.  Mayhem ensues.

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

11 years agoSome minor rewording and grammatical tweaks of the CellAlias man page
Jason Edgecombe [Sat, 13 Feb 2010 14:16:22 +0000]
Some minor rewording and grammatical tweaks of the CellAlias man page

Added some text that the CellAlias file is only used on Unix.

LICENSE BSD

Change-Id: I913d6a0774240ffc16cf92cfa92c4b2d06f41fd6
Reviewed-on: http://gerrit.openafs.org/1307
Tested-by: Jason Edgecombe <jason@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoadd bulk newvcache method
Derrick Brashear [Fri, 12 Feb 2010 21:37:19 +0000]
add bulk newvcache method

let NewVCache return a vcache which is already configured for bulkfetching
takes the bulkstatus "sequence number" and sets the flags and length

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

11 years agoInitialize variable that can potentially be used uninitialized
Marc Dionne [Sat, 13 Feb 2010 00:23:52 +0000]
Initialize variable that can potentially be used uninitialized

Some compiler versions complain that "code" might be used uninitialized
here.  If opening the configuration files fails, conf would be null
and the condition would indeed test an uninitialized variable.

Change-Id: I1d4da49a5afc94ac6617201110be84a0e5548f38
Reviewed-on: http://gerrit.openafs.org/1306
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agodarwin vn hold dead code removal
Derrick Brashear [Fri, 12 Feb 2010 21:16:56 +0000]
darwin vn hold dead code removal

pull out the unused code which tries to cope with a failed vnode hold.
if we become able to do so, we can do so later

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

11 years agoirix stdarg printing
Derrick Brashear [Wed, 10 Feb 2010 20:57:48 +0000]
irix stdarg printing

use icmn_err facility to print error (and panic for osi_Panic)
note that solaris vcmn_err is basically the same, but there
may be issues per some commenters.

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

11 years agoDocument FSSYNC commands
Andrew Deason [Thu, 4 Feb 2010 19:00:47 +0000]
Document FSSYNC commands

Provide some explanation for the various FSSYNC commands, and what they
are there for.

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

11 years agoirix test kernel cleanup
Derrick Brashear [Fri, 12 Feb 2010 05:07:02 +0000]
irix test kernel cleanup

add missing paren for irix test kernel case

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

11 years agoWindows: Prevent explorer shell extension from crashing if symbolic link add fails
Jeffrey Altman [Fri, 12 Feb 2010 02:45:40 +0000]
Windows: Prevent explorer shell extension from crashing if symbolic link add fails

The explorer shell extension was passing the wrong parameters to
the MessageBox API when a symbolic link add failed.   The end result
was stack corruption.

FIXES 126406

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

11 years agoremove erroneous disabling of darwin rx event scheduling hook openafs-devel-1_5_72
Derrick Brashear [Thu, 11 Feb 2010 05:30:54 +0000]
remove erroneous disabling of darwin rx event scheduling hook

the hook added to force reschedule to be noticed was disabled in the
course of testing. re-enable it.

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

11 years agoWindows: 1.5.72
Jeffrey Altman [Thu, 11 Feb 2010 04:57:57 +0000]
Windows: 1.5.72

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

11 years agomake unix 1.5.72
Derrick Brashear [Thu, 11 Feb 2010 04:41:58 +0000]
make unix 1.5.72

update version for next release

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

11 years agoset minimum darwin kernel rx sleep
Derrick Brashear [Thu, 11 Feb 2010 03:12:04 +0000]
set minimum darwin kernel rx sleep

never be willing to sleep less than 500ms. additional tweaks to the
rx scheduler may be needed however before we always slept for 500; now
we'll sleep longer if no events are pending (but not forever)

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

11 years agoLinux: Use current_creds() if stashed creds fail
Simon Wilkinson [Tue, 9 Feb 2010 19:53:40 +0000]
Linux: Use current_creds() if stashed creds fail

If we can't use our stashed credentials (because SELinux hates us,
most likely), then fall back to trying the processes current credentials
instead of just oopsing.

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

11 years agoRemove warnings in src/ptserver/ptclient.c
Jeffrey Altman [Wed, 10 Feb 2010 21:45:33 +0000]
Remove warnings in src/ptserver/ptclient.c

1. Signed vs unsigned warnings.

2. Casting of struct prentry * to struct prdebugentry * for
ubik_PR_DumpEntry call.

3. Casting of char * to struct in_addr *.

4. ANSIfication of PrintHelp() and skip().

5. Inclusion of ptuser.h to avoid missing prototypes.

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

11 years agotweak osi_Panic until all platforms can grok stdarg
Derrick Brashear [Wed, 10 Feb 2010 18:52:43 +0000]
tweak osi_Panic until all platforms can grok stdarg

for now, just move it to the end of the file

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

11 years agoremove osi_Panic prototype on irix
Derrick Brashear [Wed, 10 Feb 2010 04:45:23 +0000]
remove osi_Panic prototype on irix

just don't prototype this on irix

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

11 years agodarwin rxevent sleep instead of polling
Derrick Brashear [Tue, 5 Jan 2010 06:50:49 +0000]
darwin rxevent sleep instead of polling

use an interruptible sleep (and wakeups on shutdown or schedule) instead of
polling, on macos

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

11 years agoreclaim CCore1 vcache state
Derrick Brashear [Tue, 9 Feb 2010 20:07:09 +0000]
reclaim CCore1 vcache state

and the one place it was used it seems to have been used wrong anyway

it's a relic from osf1

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

11 years agoWindows: Permit Windows to build
Jeffrey Altman [Tue, 9 Feb 2010 05:42:41 +0000]
Windows: Permit Windows to build

Recent changes added a new dependency of afspioctl.lib to all
server binaries.

Export new afsconf_ functions from libafsauthent.dll

Fix afsconf_* usage in afsio.c

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

11 years agoConsolidate code for reading/writing vol headers
Andrew Deason [Thu, 4 Feb 2010 22:26:21 +0000]
Consolidate code for reading/writing vol headers

The code for reading in and overwriting/replacing volume headers is
duplicated many times throughout the volume package. Consolidate the
code into the functions VReadVolumeHeader, VWriteVolumeHeader,
VCreateVolumeHeader, and VDestroyVolumeHeader. This makes it easy to
change the semantics of how headers are read/written, though this commit
should not change them.

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

11 years agoafs_TruncateAllSegments() make sure correct afs_size_t comparison is
Rainer Toebbicke [Mon, 8 Feb 2010 14:18:04 +0000]
afs_TruncateAllSegments() make sure correct afs_size_t comparison is
used when selecting dcache entries for truncation

Insure that afs_TruncateAllSegments() uses the correct [64-bit]
comparison when deciding whether to truncate chunks:
alen - AFS_CHUNKTOBASE(tdc->f.chunk) for a file > 2GB would fail
to be recognised negative with an "afs_int32 newSize", even with
alen = 0 and big tdc->f.chunk.

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

11 years agoensure secObj is initialized in afs_ConnBySA
Derrick Brashear [Tue, 9 Feb 2010 18:54:30 +0000]
ensure secObj is initialized in afs_ConnBySA

NULL it so we don't compare against garbage

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

11 years agoprovide afs_osi_TimedSleep
Derrick Brashear [Thu, 4 Feb 2010 08:22:15 +0000]
provide afs_osi_TimedSleep

this interface works how osi_Wait *should*, except on some platforms Wait
appears to wake up all waiters(!) by using a single wait channel in the
backend. rather than change that and risk problems, introduce an interface
using the same system of events we use for osi_Sleep

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

11 years agointernationalize comerr
Derrick Brashear [Wed, 3 Feb 2010 15:16:53 +0000]
internationalize comerr

reuse the Heimdal method for internationalizing comerr. as a side effect
provide heimdal-compatible com_right.

LICENSE BSD

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

11 years agoUnix CM: Make cache bypass build again
Simon Wilkinson [Sat, 6 Feb 2010 13:04:50 +0000]
Unix CM: Make cache bypass build again

My recent afs_pioctl changes broke the build when cache bypass is
enabled. Fix this.

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

11 years agoUnix CM: Just use Bogus for VenusLogging
Simon Wilkinson [Fri, 5 Feb 2010 12:49:27 +0000]
Unix CM: Just use Bogus for VenusLogging

The VenusLogging function no longer exists - instead of having a
stub the returns EINVAL, just use the existing Bogus stub (which
returns EINVAL) instead.

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

11 years agoUnix CM: Wrap afs_pioctl.c at 80 columes
Simon Wilkinson [Fri, 5 Feb 2010 12:18:42 +0000]
Unix CM: Wrap afs_pioctl.c at 80 columes

Much of the documentation in afs_pioctl.c spanned many many lines.
Wrap it all at 80 columns for a more pleasant reading experience.

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

11 years agoRefactor afs_ioctl code
Simon Wilkinson [Thu, 4 Feb 2010 17:27:32 +0000]
Refactor afs_ioctl code

The ioctl code was a nightmare of #ifdefs. This patch reworks it
so that there is a single function for each operating system, which
makes it much easier to see what's going on. Eventually it should be
possible to move these reworked functions out into the osi directories

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

11 years agoUKERNEL: End the #define u insanity
Simon Wilkinson [Thu, 4 Feb 2010 16:08:26 +0000]
UKERNEL: End the #define u insanity

UKERNEL redefines the character 'u' to do a function call. This
hurts other kernel developers in all sorts of interesting ways. Remove
the definition, and instead explicitly reference the get_user_struct()
function in those places that we need to.

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

11 years agoAdd rx security index enum
Simon Wilkinson [Thu, 4 Feb 2010 15:09:34 +0000]
Add rx security index enum

Add a enumerated type for rx security indexes, initially containing
the values reserved for null, kad, gk, and k5. Start to use this type,
and related names, rather than hard values throughout the code.

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

11 years agosalvager: alias -f to -force
Andrew Deason [Mon, 8 Feb 2010 21:03:08 +0000]
salvager: alias -f to -force

DAFS added the -forceDAFS flag, which made the '-f' flag ambiguous, when
it used to be short for '-force'. Restore the previous meaning of '-f'
to reduce backwards incompatibility.

FIXES 124916

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

11 years agoUnix CM: Simplify #ifdef ladder in lock.h
Simon Wilkinson [Thu, 4 Feb 2010 12:23:58 +0000]
Unix CM: Simplify #ifdef ladder in lock.h

Hugely simplify the ifdef ladder in lock.h, by using #elif, rather than
multiple levels of nested ifdefs

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

11 years agoUnix CM: Indent #ifdef ladder in lock.h
Simon Wilkinson [Thu, 4 Feb 2010 12:18:30 +0000]
Unix CM: Indent #ifdef ladder in lock.h

The ifdef ladder in lock.h was a pain to read. Indent it to make it
clearer.

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

11 years agoUnix CM: Reorganise security object code
Simon Wilkinson [Wed, 3 Feb 2010 16:00:47 +0000]
Unix CM: Reorganise security object code

Reorganise the code which creates a client security object for the
Unix CM into its own function.

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

11 years agoInitialise ptuser to NULL
Simon Wilkinson [Tue, 9 Feb 2010 16:26:57 +0000]
Initialise ptuser to NULL

Fix fallout from d008089a79ef268bbca91d660a840f32cb416865 - sc wasn't
being initialised when it was declared, and some code paths would fail
to set it. This led to the == NULL check failing, and a new rx
connection being created with an invalid pointer as a security context.
Disaster ensued ...

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

11 years agoOpenBSD: don't use AFS_GLOBAL_SUNLOCK on single processor system
Antoine Verheijen [Mon, 8 Feb 2010 21:57:51 +0000]
OpenBSD: don't use AFS_GLOBAL_SUNLOCK on single processor system

Put back the header directives that only turns on AFS_GLOBAL_SUNLOCK
when compiling for multiprocessors system. When enabled on a single
processor OpenBSD system, it is possible to put the entire system
into a lengthy (minutes) lock state when performing multiple AFS
activities. The system behaves MUCH better when AFS_GLOBAL_SUNLOCK
is not set (no problems encopuntered). This whole locking mechanism
needs a bit more examination on OpenBSD before this is useful in
single processor mode.

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

11 years agoOpenBSD: allow for more graceful shutdown
Antoine Verheijen [Mon, 8 Feb 2010 22:33:38 +0000]
OpenBSD: allow for more graceful shutdown

A shutdown or unmount of AFS on OpenBSD will invariably result in a kernel
panic. This is because the afs_unmount() routine does not (can not?) force
vnode releases if the vnode is still busy. However, it continues on
nonetheless and dies a horrible death a little later.

This update causes a return from afs_unmount() with EBUSY if all the vnodes
weren't released. This results in error messages on shutdown but the overall
process continues more reliably and reboots, for example, work.

There is likely a better solution to this but at least this is no worse than
a system crash and it doesn't require console (or power button) intervention
so it should do until I have the chance to explore further.

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

11 years agoOpenBSD: fix lookup of network interfaces
Antoine Verheijen [Mon, 8 Feb 2010 22:23:03 +0000]
OpenBSD: fix lookup of network interfaces

Starting with OpenBSD 4.2, the interface list returned by sysctl using
NET_RT_IFLIST contains multiple versions of the data. This really
messes up the rx_getAllAddr_internal() routine that returns a list of
valid interfaces for the system (to the point where none are returned).

This change adds a routine that cleans up the data returned by sysctl
so it returns only a single (the most current) version of the data.
That stops afsd (among others) from being cranky when it starts up.

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

11 years agoWindows: add xdrlen
Jeffrey Altman [Tue, 9 Feb 2010 05:40:20 +0000]
Windows: add xdrlen

Adds xdrlen.c to librx.a and libafsrpc.dll

Exports xdrlen_create from libafsrp.dll

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

11 years agoOpenBSD: move AFS memory type offet
Antoine Verheijen [Mon, 8 Feb 2010 22:07:09 +0000]
OpenBSD: move AFS memory type offet

The internal malloc memory types for IPv6 (M_IP6OPT, ...) conflict
with the type numbers used to designate AFS memory (M_AFSFID, etc.).
This change moves the AFS memory type to a new number that does not
conflict. This is not a serious issue but can create real confusion
when trying to debug or track memory issues, among other things.

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

11 years agoFix segmentation fault in vsu_GetVolumeID
Antoine Verheijen [Mon, 8 Feb 2010 23:01:46 +0000]
Fix segmentation fault in vsu_GetVolumeID

When determining the volume type of a volume, vsu_GetVolumeID() checks
to see if the volume name ends in '.backup' or '.readonly' by backing
up the appropriate number of characters from the end of the name. It
does not, however, check to see if it skips past the beginning of the
volume name. This can result in a segmentation fault (which it has for
me on many occasions during a vos release) depending on where memory
is allocated or how/if memory is protected.

This patch corrects this behaviour by checking the volume name string
length prior to doing the string comparison.

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

11 years agoirix label changes rx subdir
Chaz Chandler [Tue, 9 Feb 2010 01:59:10 +0000]
irix label changes rx subdir

no label support in non-c99 irix cc, xdr_len.c and xdr_mem.c
changed accordingly

Change-Id: I9f9780254cd7e80649d40b3df6bcdd84a2f90404
modified:   src/rx/xdr_len.c
modified:   src/rx/xdr_mem.c
Reviewed-on: http://gerrit.openafs.org/1266
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agofix AFS_ASSERT_GLOCK on irix and aix
Chaz Chandler [Tue, 9 Feb 2010 02:42:35 +0000]
fix AFS_ASSERT_GLOCK on irix and aix

irix and aix do not have a vararg version of osi_Panic, fixed
AFS_ASSERT_GLOCK macro definition in afs/afs_osi.h for those two
platforms

Change-Id: I0b541d2c1edad1364ef1c91dec84b9d4319c4e62
modified:   src/afs/afs_osi.h
Reviewed-on: http://gerrit.openafs.org/1267
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd support for OpenBSD 4.6
Antoine Verheijen [Mon, 8 Feb 2010 22:45:25 +0000]
Add support for OpenBSD 4.6

Add config param header and sysname number for OpenBSD 4.6.

As well, add an additional parameter to a call to ifa_ifwithnet()
when looking up the MTU for an interface to indicate that the call
should use the default routing table. With the advent of OpenBSD
4.6, the system has started to make provisions for multiple routing
tables which included a change to the calling sequence for this
routine.

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

11 years agotubik: Initialize mutexes and cvs
Steven Jenkins [Mon, 8 Feb 2010 20:38:49 +0000]
tubik: Initialize mutexes and cvs

Initialize some mutexes and condition variables for pthreaded ubik.

FIXES 124977

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

11 years agodarwin vnodeops cleanup
Derrick Brashear [Sun, 7 Feb 2010 03:36:18 +0000]
darwin vnodeops cleanup

remove dead code, and retabify

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

11 years agomacos package allow backrev
Derrick Brashear [Sun, 7 Feb 2010 00:48:44 +0000]
macos package allow backrev

in order to go back versions, tell the install not to enforce
"no backrev"

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

11 years agofetchstore reorg
Derrick Brashear [Sat, 6 Feb 2010 01:40:22 +0000]
fetchstore reorg

shift the functions around to avoid forward decl

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

11 years agoset storeproc for non-linux
Derrick Brashear [Sat, 6 Feb 2010 00:54:22 +0000]
set storeproc for non-linux

forgot to push this with 0683c04a

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

11 years agodecode-panic deal with kextload
Derrick Brashear [Fri, 5 Feb 2010 20:01:31 +0000]
decode-panic deal with kextload

kextload won't handle -arch. deal appropriately.

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

11 years agoWindows: Remove use of AFS_AFSDB_ENV from kauth/user_nt.c
Jeffrey Altman [Fri, 5 Feb 2010 18:45:48 +0000]
Windows: Remove use of AFS_AFSDB_ENV from kauth/user_nt.c

AFS_AFSDB_ENV was removed from the rest of the source tree.
Now remove it from kauth/user_nt.c so that DNS lookups can
be performed from the ka_ authentication routines.

FIXES 126366

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

11 years agomacos prefs pane spelling
Derrick Brashear [Thu, 4 Feb 2010 02:46:06 +0000]
macos prefs pane spelling

fix spelling of link to the usual unix spelling

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

11 years agoDon't clear afs_stats_cmperf too early during shutdown
Marc Dionne [Thu, 4 Feb 2010 02:34:24 +0000]
Don't clear afs_stats_cmperf too early during shutdown

Commit 21cbf7fee0a089d94f62baa7df2422e7bc8293f7 activated some
previously unused cleanup code.  Part of this clears afs_stats_cmperf,
but these stats are used later to check for leaks of chunks allocated
with afs_AllocSmallSpace and afs_AllocLargeSpace.  The result is a
message about unfreed blocks in the syslog with negative counts.

Since the structure is already cleared later in the shutdown process,
just remove this instance.

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

11 years agofakestat should preclude afsdb lookups too
Derrick Brashear [Thu, 4 Feb 2010 00:01:28 +0000]
fakestat should preclude afsdb lookups too

macos tries to look up ._foo stuff. correctly identify those (mvstat 2, not
1) and also use tryEvalOnly to preclude AFSDB lookups

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

11 years agomacos installer scripts shouldn't echo
Derrick Brashear [Wed, 3 Feb 2010 21:49:23 +0000]
macos installer scripts shouldn't echo

remove the other echoes from these scripts

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

11 years agoformat fallout
Derrick Brashear [Wed, 3 Feb 2010 21:40:29 +0000]
format fallout

this was missed somehow in my verification. fix it now.

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

11 years agoFix fs storebehind on files with 2 or more servers
Simon Wilkinson [Wed, 3 Feb 2010 00:37:20 +0000]
Fix fs storebehind on files with 2 or more servers

fs storebehind didn't allocate a large enough buffer for its call
to VIOCWHERIS. This meant that when it was called on a file with
more than one server (one in a readonly volume), it would error
out with E2BIG, rather than a more appropriate message.

Fix this, by using the generic 'space' buffer for the VIOCWHERIS
call.

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

11 years agoFix pioctl input and output handling
Simon Wilkinson [Wed, 3 Feb 2010 00:31:32 +0000]
Fix pioctl input and output handling

Pioctl input and output handling was being handled in an adhoc
manner, with little or no detection of input and output buffer
overflow. Whilst overflow is difficult to provoke on a real system,
due to the size of the buffers being allocated for output, the code
was difficult to read, and fragile to maintain.

This patch adds an XDR like abstraction for marshalling and
unmarshalling pioctl data. Whilst the real XDR can't be used and
maintain backwards compatibility, this gives a similar elegance.

Input and output pointers are replaced with instances of
struct afs_pdata, which store both a pointer to the current position
in the data stream, and a note of where the stream ends.

All access to a data stream is now performed through a set of helper
functions, which handle the reading and writing of integers, strings,
and arbitrary blocks of bytes. An 'inline' function is provided for
those cases where direct access to the stream is required.

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

11 years agoMake twiddle build
Simon Wilkinson [Wed, 3 Feb 2010 00:25:17 +0000]
Make twiddle build

Update the twiddle utility (for manipulating rx settings in the
Unix CM) so that it builds with error checking enabled.

Also, add the binary to the gitignore file in that directory.

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

11 years agoAdd xdr_len, to work out required buffer size
Simon Wilkinson [Sat, 30 Jan 2010 22:28:47 +0000]
Add xdr_len, to work out required buffer size

Currently, code which uses xdr_mem needs to take a guess at the
buffer size required, allocate that guess, and error out if the
data being encoded actually exceeds the guess.

This adds a new XDR mechanism - xdr_len, which can return
(using xdr_getpos) the length of the buffer required to XDR
encode a given structure.

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