openafs.git
13 years agolibafs: Indent afs_call.c ifdef maze
Andrew Deason [Tue, 8 Mar 2011 20:59:44 +0000]
libafs: Indent afs_call.c ifdef maze

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

13 years agoihandle: One more indentation fix
Andrew Deason [Fri, 25 Mar 2011 19:11:16 +0000]
ihandle: One more indentation fix

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

13 years agosalvager: Stop asking for DAFSness on SYNC_FAILED
Andrew Deason [Thu, 24 Mar 2011 22:57:32 +0000]
salvager: Stop asking for DAFSness on SYNC_FAILED

Break out of the loop so we stop asking the same thing repeatedly.

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

13 years agoDAFS: Allow the volumeSalvager to checkout volumes
Andrew Deason [Wed, 23 Mar 2011 22:38:35 +0000]
DAFS: Allow the volumeSalvager to checkout volumes

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

13 years agoWindows: trailing dot not part of volume name
Jeffrey Altman [Fri, 25 Mar 2011 12:58:20 +0000]
Windows: trailing dot not part of volume name

When dynamically adding new cell mount points to the Freelance
directory do not include a trailing dot when specifying the root.cell
volume name.

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

13 years agoadd AFS_DEMAND_ATTACH_UTIL
Derrick Brashear [Thu, 24 Mar 2011 20:11:17 +0000]
add AFS_DEMAND_ATTACH_UTIL

use this for non-pthreads "support code" e.g. salvager.

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

13 years agoutil: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 15:26:38 +0000]
util: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

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

13 years agovlserver: Tidy header includes
Simon Wilkinson [Thu, 24 Mar 2011 10:54:44 +0000]
vlserver: Tidy header includes

Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times

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

13 years agoDAFS: Correct FSYNC_VOL_QUERY_VOP checks
Andrew Deason [Thu, 24 Mar 2011 15:22:52 +0000]
DAFS: Correct FSYNC_VOL_QUERY_VOP checks

Check that the given partition matches the vp partition, and ensure
the vp is not in an exclusive state when we check the state.
Otherwise, we may return pending vol ops for a volume on a different
partition, or we may incorrectly return that there is no pending vol
op when in fact the volume does not exist at all.

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

13 years agoCorrectly document the AFS client setuid defaults
Russ Allbery [Thu, 24 Mar 2011 19:56:56 +0000]
Correctly document the AFS client setuid defaults

AFS no longer honors setuid status by default.  Update the admin
guide documentation appropriately and add a warning recommending
against enabling setuid status given the limitations of the current
AFS protocol.

Reformat this section of the admin guide to make it easier to
maintain.

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

13 years agoWindows: avoid recursive cm_CheckOfflineVolume
Jeffrey Altman [Wed, 16 Mar 2011 06:17:38 +0000]
Windows: avoid recursive cm_CheckOfflineVolume

Add a new cm_req_t flag CM_REQ_OFFLINE_VOL_CHK which is used
to prevent cm_Analyze() from performing recursive
cm_CheckOfflineVolume operations that will exhaust the stack.

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

13 years agosalvager: Give back volumes when exiting early
Andrew Deason [Wed, 23 Mar 2011 22:25:03 +0000]
salvager: Give back volumes when exiting early

Sometimes the salvager exits a bit earlier than normal. For instance,
when no applicable inodes are found for a volume group, or if the
-inodes command line option was given. In these cases, we have already
checked out singleVolumeNumber from the fileserver (if we're salvaging
a single VG), so we need to give it back. So, give it back in those
instances.

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

13 years agoDAFS: Do not record vol ops for DELETED vols
Andrew Deason [Wed, 23 Mar 2011 21:46:47 +0000]
DAFS: Do not record vol ops for DELETED vols

When a volume is VOL_STATE_DELETED, it effectively does not exist, so
there is little point in recording a vp->pending_vol_op structure for
it. Just let callers checkout the volume as they would a nonexistent
volume: without recording anything about the operation.

This just reduces some edge cases and confusing debugging info, so we
don't have to worry about cleaning up pending_vol_op structures for
nonexistent volumes.

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

13 years agosalvager: Do not AskOnline nonexistent volumes
Andrew Deason [Wed, 23 Mar 2011 21:12:20 +0000]
salvager: Do not AskOnline nonexistent volumes

If singleVolumeNumber is not in our volume summary list, then the
singleVolumeNumber volume does not exist. So, don't try to bring it
back online. Still do try to make sure we don't have the volume
checked out, though, so issue an AskDelete, so ensure that it's not
checked out and that the fileserver does not think it exists.

Change AskDelete so we don't care if we tried to delete a volume that
the fileserver thinks already doesn't exist. Change the FSYNC_VOL_DONE
handler so it does not complain about already-deleted volumes.

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

13 years agonamei: Log ListViceInodes write failures
Andrew Deason [Wed, 23 Mar 2011 20:19:03 +0000]
namei: Log ListViceInodes write failures

If we fail to write to the inodeFile given by ListViceInodes, we
should log the failure. Otherwise, no indication is given as to what
failed, when a salvage gathers the inode list.

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

13 years agosalvager: Fix conversion from stdio calls
Andrew Deason [Wed, 23 Mar 2011 19:30:18 +0000]
salvager: Fix conversion from stdio calls

Commit 5247fa38a4faebfdffba178ca01e5b419f034d5d converted some I/O
calls in the salvager from stdio to OS_OPEN/OS_WRITE/etc. Fix some of
the conversions, including:

 - We need to pass O_CREAT to OS_OPEN calls, since we are creating
   these files

 - OS_WRITE returns the number of bytes written on success, not the
   number of "elements" like in stdio

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

13 years agoihandle: Ensure FDH_REALLYCLOSE really closes
Andrew Deason [Tue, 22 Mar 2011 21:36:47 +0000]
ihandle: Ensure FDH_REALLYCLOSE really closes

If FDH_REALLYCLOSE is given an FdHandle_t that has more than one user,
currently it does effectively nothing. Ensure that the file descriptor
actually gets closed on a subsequent FDH_CLOSE, but setting the new
fd_needs_rclose field.

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

13 years agomacos next support
Derrick Brashear [Wed, 23 Mar 2011 18:16:10 +0000]
macos next support

first brush at supporting next macos. totally not lion about it.

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

13 years agoosconf: reduplicate systype stuff
Derrick Brashear [Wed, 23 Mar 2011 18:11:24 +0000]
osconf: reduplicate systype stuff

in some cases there is more to do, and in some cases we probably
already didn't build anymore, but, let's simplify.

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

13 years agoDAFS: Do not VDeregisterVolOp_r while exclusive
Andrew Deason [Wed, 23 Mar 2011 16:07:03 +0000]
DAFS: Do not VDeregisterVolOp_r while exclusive

We should wait for a volume to transition out of an exclusive state
before calling VDeregisterVolOp_r on a volume, since some code may be
examining the vol op outside of VOL_LOCK in an exclusive state. We
should be doing this anyway before performing volume state checks,
since we may be trying to e.g. attach the volume at the same time.

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

13 years agorpm: Build srpms without %dist in their name
Simon Wilkinson [Wed, 23 Mar 2011 15:35:35 +0000]
rpm: Build srpms without %dist in their name

On RHEL6, %dist is set for all RPMS and SRPMS built on the system. This
leads to makesrpm.pl building SRPMS with .el6 in their release. As we
endeavour to use the same SRPM on all of our Fedora platforms, this is
less than ideal, so change makesrpm.pl to squash the setting of %dist
before building the RPM.

Change-Id: I5b5b9db7654ce21a269233e8950d4f4d1df81ad7
Reviewed-on: http://gerrit.openafs.org/4285
Reviewed-by: Alexander Ivan Redinger <aredinger@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoFix ihandle.c indents
Andrew Deason [Tue, 22 Mar 2011 21:18:17 +0000]
Fix ihandle.c indents

ihandle.c had some blocks that were not indented. Indent them.

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

13 years agovclosevnodefiles-ihandle-leak-20090216
Jeffrey Altman [Tue, 17 Feb 2009 04:37:27 +0000]
vclosevnodefiles-ihandle-leak-20090216

LICENSE IPL10
FIXES 124359

don't leak ihandles on close. this isn't a complete fix for the issue
(cherry picked from commit b9816e12f7ed8213c9c4eaea09e992e69ce4ee05)

This reverts the part of 12e85227c5dbfdb1258718ee3360bffacc4f96ac that
reverted b9816e12f7ed8213c9c4eaea09e992e69ce4ee05.

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

13 years agoDAFS: fix forceDAFS support in salvager
Derrick Brashear [Wed, 8 Dec 2010 02:26:59 +0000]
DAFS: fix forceDAFS support in salvager

we need to get the shared partition lock for the per-volume
forceDAFS case

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

13 years agoDAFS: allow salvager to detect whether FSYNC server is DAFS
Derrick Brashear [Wed, 8 Dec 2010 02:23:53 +0000]
DAFS: allow salvager to detect whether FSYNC server is DAFS

in order to enable the right commands and print the right errors,
query for DAFS-only FSYNC op.
doesn't use bozo InstanceInfo as it's possible you can run fileserver
outside of bos.

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

13 years agoUpdate NEWS for 1.6.0pre3 release
Russ Allbery [Tue, 22 Mar 2011 09:04:46 +0000]
Update NEWS for 1.6.0pre3 release

Add additional NEWS entries from the 1.6.0pre3 release notes.

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

13 years agoviced: Check vnode length on dir ops
Andrew Deason [Tue, 15 Mar 2011 19:24:01 +0000]
viced: Check vnode length on dir ops

The commit aadf69eabb1962496fa93745ab560a5b48cacd61 added checks on
vnode length whenever we read or write from a vnode. Add the same
check on directory vnodes when we modify the directory (whenever
entries are added or deleted).

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

13 years agovol: Correct VolumeNumber for large volume IDs
Andrew Deason [Fri, 11 Mar 2011 00:37:44 +0000]
vol: Correct VolumeNumber for large volume IDs

VolumeNumber was using atoi to convert a volume header name to a
volume ID. This can return just -1 for volume IDs larger than 2^31-1,
though, so use strtoul instead.

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

13 years agovol: Handle large volume IDs in VLockFile
Andrew Deason [Thu, 10 Mar 2011 23:59:39 +0000]
vol: Handle large volume IDs in VLockFile

VLockVolumeByIdNB currently cannot handle volume IDs larger than
2^31-1. Fix this by using struct flock64, F_SETLKW64, and F_SETLK64 in
the VLockFile functions where possible.

Thanks to Simon Wilkinson for pointing out F_SETLK64.

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

13 years agovol: Make VLockFile arguments consistent
Andrew Deason [Thu, 10 Mar 2011 22:41:02 +0000]
vol: Make VLockFile arguments consistent

The Windows implementation of the VLockFile functions had the handle
incorrectly declared in a few places (they accepted a struct VLockFile
instead of an FD_t). Correct them, and make all VLockFile
implementation functions declare 'FD_t's instead of 'HANDLE's or
'int's.

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

13 years agolibafs: Do not osi_FlushPages for dirs
Andrew Deason [Thu, 17 Mar 2011 21:32:00 +0000]
libafs: Do not osi_FlushPages for dirs

Directory contents are never mapped or stored in pages, so dealing
with page invalidation on directories is just overhead. So make
osi_FlushPages a no-op when we're given a directory, which can avoid a
lot of locks and other processing (particularly when we are called in
afs_getattr in BOZONLOCK_ENV).

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

13 years agoDAFS: DFlushVolume outside of vol glock
Andrew Deason [Wed, 16 Mar 2011 16:48:08 +0000]
DAFS: DFlushVolume outside of vol glock

DFlushVolume may traverse a long list of directory objects, and can
even hit the disk, so we should drop the glock for it. This should be
safe in DAFS, since we already transition the volume to an exclusive
state before doing this, and DFlushVolume only deals with structures
internal to the directory package and maintains its own locking.

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

13 years agoutil: Fix exec_alt
Simon Wilkinson [Sun, 20 Mar 2011 21:13:09 +0000]
util: Fix exec_alt

exec_alt was failing its tests on Mac OS X (but passing them on Linux).

It turns out that this is because it was failing to NULL terminate the
string that it creates in construct_alt(), which copies in the
characters from argv0, prefix and suffix, but never copies in a trailing
NULL.

Amend the code so that the trailing NULL from suffix is used to
terminate the string.

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

13 years agolwp: override dbg and optmz settings
Simon Wilkinson [Sun, 20 Mar 2011 23:23:29 +0000]
lwp: override dbg and optmz settings

we were wiping out fun things like archflags. shouldn't be needed.
let's just do this instead.

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

13 years agoosx: restore atomic stats to knet
Simon Wilkinson [Sun, 20 Mar 2011 23:15:30 +0000]
osx: restore atomic stats to knet

pulled wrong version of change into master. put back atomic
versions of stats.

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

13 years agosalvager: Fix volume parsing on 64-bit
Andrew Deason [Wed, 16 Mar 2011 19:44:56 +0000]
salvager: Fix volume parsing on 64-bit

When an unsigned long is wider than an afs_uint32, comparing the
afs_uint32 vid to ULONG_MAX is always going to be false (which the
compiler can warn us about). Fix this by storing to an unsigned long,
and converting to a volume id after ensuring that the result is not
too large.

Change-Id: Ifbd724dabd988bc4b1ba6ee8f3dc7fa1a0afb226
Reviewed-on: http://gerrit.openafs.org/4244
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoMacOS: allow cdead vcaches to be found in FindVCache if requested
Derrick Brashear [Thu, 20 Jan 2011 04:11:11 +0000]
MacOS: allow cdead vcaches to be found in FindVCache if requested

if we are trying to find a dead vcache, let it be found, don't immediately
attempt to recycle

FIXES 128511

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

13 years agoutil: Remove unnecessary uuid_mem* macros
Simon Wilkinson [Wed, 16 Mar 2011 21:23:17 +0000]
util: Remove unnecessary uuid_mem* macros

Once upon a time, in a galaxy far far away, uuid used bcmp and bcpy
operations in kernel space. However, we changed that back in 2001, and
since then the uuid_memcpy and uuid_memcmp macros have been redundant.
Tidy up the code a little by removing them.

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

13 years agodir: Make test utility build again
Simon Wilkinson [Wed, 16 Mar 2011 18:11:21 +0000]
dir: Make test utility build again

Make the 'dtest' test utility, which can be used to test the functioning
of the dir package, as well as to manipulate the directories that it
creates, build again.

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

13 years agoutil: Remove remote.h
Simon Wilkinson [Wed, 16 Mar 2011 17:42:59 +0000]
util: Remove remote.h

remote.h is no longer used anywhere within the tree, and defines an
interface that has never been provided by OpenAFS. Remove it.

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

13 years agorpms: Make makesrpm.pl cater for new rpm names
Simon Wilkinson [Thu, 17 Mar 2011 19:28:23 +0000]
rpms: Make makesrpm.pl cater for new rpm names

Starting from 1.6.0, our specfile no longer adds a stray '1.' to the
start of the release field. makesrpm.pl was failing to deal with
these new-style names and therefore not actually making an rpm.

Fix this by conditionalising on the OpenAFS version when selecting
which rpm to copy.

Change-Id: I36b32ccc20baa167f46e5095eacb38a8e7d65e27
Cc: Alexander Redinger <aredinger@sinenomine.net>
Reviewed-on: http://gerrit.openafs.org/4258
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agomacos: kernel socket upcall
Derrick Brashear [Wed, 16 Mar 2011 05:06:43 +0000]
macos: kernel socket upcall

support kernel socket upcall instead of listener env

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

13 years agoutil: Remove packages.h
Simon Wilkinson [Wed, 16 Mar 2011 17:16:31 +0000]
util: Remove packages.h

packages.h is unused within our tree, and contains nothing of any
use to out of tree callers (it attempts to define bases for error
codes, which has been superceded by our use of comerr)

So, remove it.

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

13 years agorpms: Use new CellServDB
Simon Wilkinson [Thu, 17 Mar 2011 19:14:39 +0000]
rpms: Use new CellServDB

Update the CellservDB referenced by the spec file to the latest one
from grand.central.org

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

13 years agoutil: Remove itc.h
Simon Wilkinson [Wed, 16 Mar 2011 15:37:47 +0000]
util: Remove itc.h

The itc.h header is never installed, or used in the OpenAFS tree.
Remove it.

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

13 years agoviced: Actually print client CPS
Andrew Deason [Thu, 17 Mar 2011 15:43:23 +0000]
viced: Actually print client CPS

Client CPS was not getting output on SIGXCPU like the rest of the
client information, since the conditional in the CPS loop was never
true. Fix this so we traverse the CPS entries correctly.

Change-Id: Ic3434000fbf90e96665779f21811bffcc3a19b45
Reviewed-on: http://gerrit.openafs.org/4256
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoutil: Remove isathing
Simon Wilkinson [Wed, 16 Mar 2011 15:34:54 +0000]
util: Remove isathing

isathing.c only provided one function - util_isint, whose behaviour
can be far better provided by careful application of strtol.
Simplify our world a little by removing the file.

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

13 years agokauth: Use strtol for integer argument handling
Simon Wilkinson [Wed, 16 Mar 2011 15:31:40 +0000]
kauth: Use strtol for integer argument handling

Use strtol, rather than a combination of util_isint and atoi to
handle integer arguments. This is much cleaner, far more portable,
and removes a dependency on an internal library function that this
file is the only user of.

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

13 years agoosx: decode-panic should work in add-kext only land
Derrick Brashear [Thu, 17 Mar 2011 05:25:35 +0000]
osx: decode-panic should work in add-kext only land

in 64 bit 10.6, you need add-kext (not add-symbol-file)
to decode a panic. deal accordingly

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

13 years agoosx: prefs pane should properly detect version
Derrick Brashear [Thu, 17 Mar 2011 04:11:43 +0000]
osx: prefs pane should properly detect version

we use "new" afs conf after 1.4.6 or 1.5.36. detect correctly

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

13 years agoThrow the compiler a bone ...
Simon Wilkinson [Tue, 15 Mar 2011 21:48:43 +0000]
Throw the compiler a bone ...

... failing that, a semi colon.

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

13 years agomacos: dont want bind 8 compat on leopard
Derrick Brashear [Tue, 15 Mar 2011 03:36:45 +0000]
macos: dont want bind 8 compat on leopard

we removed it for i386, kill it for ppc also.

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

13 years agoWindows: 1.6pre3 changes
Jeffrey Altman [Tue, 15 Mar 2011 02:55:26 +0000]
Windows: 1.6pre3 changes

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

13 years agoLinux: Fix return codes from setpag
Simon Wilkinson [Tue, 15 Mar 2011 00:45:45 +0000]
Linux: Fix return codes from setpag

Linux is a real stickler when it comes to error codes. Functions
which return positive error codes into the kernel tend to have
unfortunate effects. Because all AFS errors tend to be positive,
most of our kernel entry points negate errors before passing them
back to their caller.

This causes problems when internal functions themselves return
negative error codes. This was the case with the keyring functions,
which ended up returning a negative code to setpag(), this handed
that code ultimately up to the ioctl handler, which negated it (so
turning it positive) before throwing it up to the kernel.

The kernel sees this positive value as being a successful return,
and so passes it direct to userland, rather than assigning it to
errno. This led to the setpag() userspace function never being
aware of keyring errors that had occurred in the kernel.

Fix all this by making sure that all errors from the keyring code
are made positive before being passed upwards in the kernel module.

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

13 years agoRevert "Linux: normalize error return for emulated syscalls"
Simon Wilkinson [Tue, 15 Mar 2011 00:06:19 +0000]
Revert "Linux: normalize error return for emulated syscalls"

This reverts commit 0bc837f68a72ba1f75d940cc5dd057774d9f36bb.

Sadly, this change fixed setpag(), but broke all of the pioctls. The
problem is actually a little more nuanced than we at first thought.
What's happening is yet another case of Linux's special handling of
negative return values. When an ioctl handler returns a negative
return code to the kernel, it does errno = -code, and sets the
return code to -1. If you pass it a postive return code, however,
it just returns that straight to the application.

The pioctl code gets this right. However, the setpag code doesn't,
and so tries to return postive values, which is why ioctl appears
to be returning the error code in the return value, not in the
errno.

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

13 years agoauth: Use the UserListFileName function more
Simon Wilkinson [Sun, 13 Mar 2011 17:13:49 +0000]
auth: Use the UserListFileName function more

The function UserListFileName exists to abstract the process of
producing a full pathname for the userlist. Modify the rest of
userok.c so that it uses it.

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

13 years agoauth: Refactor CellServDB path creation
Simon Wilkinson [Sun, 13 Mar 2011 16:54:34 +0000]
auth: Refactor CellServDB path creation

Move all of the duplicated code that does CellServDB path creation
into a common function. Use asprintf(), rather than strcompose in
this function so we're using fewer fixed length buffers.

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

13 years agoroken: Export rk_asprintf on Windows
Simon Wilkinson [Sun, 13 Mar 2011 21:47:43 +0000]
roken: Export rk_asprintf on Windows

Add rk_asprintf to the Windows roken export lists

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

13 years agoreadme typos
Michael Meffie [Mon, 14 Mar 2011 14:15:35 +0000]
readme typos

Fix two typos in README.

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

13 years agoauth: Rework afsconf_UpToDate to use CellServDB
Simon Wilkinson [Sat, 5 Mar 2011 23:09:18 +0000]
auth: Rework afsconf_UpToDate to use CellServDB

Rework the afsconf_UpToDate check so that it uses the modifcation of
the CellServDB, and not the KeyFile to determine whether the
configuration information has been changed under us or not. afsconf
defines the CellServDB as being the single sentinel for a config
directory being changed, and our tools are careful to always touch
the CellServDB when updating anything else there.

Also, rework the _afsconf_Check() code so that it uses afsconf_UpToDate,
rather than including this logic twice.

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

13 years agotests: Fix KeyFile test so it works from harness
Simon Wilkinson [Sun, 13 Mar 2011 15:47:36 +0000]
tests: Fix KeyFile test so it works from harness

The auth/keys test tries to find a file that's distributed as part
of the test suite. However, it currently only looks in the CWD to
find it. Modify the test so that if it's run from the test harness,
it will use the harnesses SOURCE environment variable to locate the
KeyFile

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

13 years agotests: Fix the authcon test to avoid pthread errors
Simon Wilkinson [Sun, 13 Mar 2011 15:45:37 +0000]
tests: Fix the authcon test to avoid pthread errors

Fix the authcon test so that it avoids pthread errors by
initialising rx before calling into any of the rxkad routines.

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

13 years agopt_util: Initialise empty database correctly
Simon Wilkinson [Sun, 13 Mar 2011 14:45:04 +0000]
pt_util: Initialise empty database correctly

Commit dc8f18d6f5003712bc9ef989363137a84953df07 broke pt_util's
initialisation of empty databases. This is because Initdb was changed
to call Initdb_check through the ubik_CheckCache wrapper. However, that
wrapper was defined as a no-op in pt_util's ubik-shim.

Modify pt_util's ubik_CheckCache so that it always calls into the
wrapper routine - this mimics the old behaviour.

Add a trival test for pt_util - check that we can build the database,
using the example from the manpage, and then that the built database
matches what we expect.

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

13 years agoDOC: pt_util now outputs ntohl'd epoch and version
Simon Wilkinson [Sun, 13 Mar 2011 12:56:57 +0000]
DOC: pt_util now outputs ntohl'd epoch and version

Commit 87e959e87df52e026ffcb2de8ecfcbf4889f7bd8 fixed pt_util so
that the epoch and version is correctly byte-swapped on little
endian systems.

Remove the warning about this from the manpage as it is no longer
relevant.

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

13 years agocrypto: Add krb5_crypto_fx_cf2 to our prototypes
Simon Wilkinson [Mon, 7 Mar 2011 17:23:51 +0000]
crypto: Add krb5_crypto_fx_cf2 to our prototypes

Admit to having the krb5_crypto_fx_cf2 function in the kernel RFC3961
implementation - we're going to use it for for key combining

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

13 years agoubik: Allow servers to have more than 3 seclayers
Simon Wilkinson [Fri, 4 Mar 2011 22:57:15 +0000]
ubik: Allow servers to have more than 3 seclayers

ubik has traditionally used the afsconf_ServerAuth function to
fill in a single field in a pre-allocated list of security classes.
This meant that we could never have a class with an index higher
than 2 (rxkad). Setting the function to call, and the rock to that
function was also accomplished by playing with global variables.

Rework this so that a new function is used to set the security
classes, which can allocate an arbitrary sized array of classes.
Move the setting of this function, and of the authentication check
function into ubik_SetServerSecurityProcs()

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

13 years agoafsconf: Rework security flags
Simon Wilkinson [Fri, 4 Mar 2011 22:37:10 +0000]
afsconf: Rework security flags

BuildServerSecurityObjects takes a set of flags, which makes it
hard to use it as a callback function. Rework this so that the
security flags are part of the afsconf directory structure, and
so BuildServerSecurityObjects only takes a rock, and its return
parameters.

Update all of the callers for this new function, and add tests
for it to the test suite.

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

13 years agoubik: Remove dependency on auth
Simon Wilkinson [Fri, 4 Mar 2011 12:12:24 +0000]
ubik: Remove dependency on auth

When commit 8a09c220f4c5f881ea45be585b07b793038924d5 added support
for token error recovery to ubik, it introduced a dependency on
afsconf. This breaks the abstraction layer that had been in place, by
requiring that the SecurityRock be an afsconf_dir (if you use a
different rock, ubik will segfault)

This change reinstates the abstraction layer, by requiring Ubik
users who want token error checking to specify a procedure that can
be used to check whether tokens are up to date. Instead of yet
another global variable, we replace the existing CRXSecurity*
variables with a single function that can be used to set security proc,
token checking proc, and rock.

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

13 years agosolaris: fix typo in the solaris 11 startup script
Chas Williams (CONTRACTOR) [Fri, 11 Mar 2011 18:33:50 +0000]
solaris: fix typo in the solaris 11 startup script

/etc/devlink.tab not /dev/devlink.tab

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

13 years agosalvager: Do not abort on large volume IDs
Andrew Deason [Thu, 10 Mar 2011 20:55:50 +0000]
salvager: Do not abort on large volume IDs

The salvager was parsing volume IDs just using atoi() and checking if
the result was negative. Since the result is a signed int, this fails
on any volume ID larger than 2^31-1. Change the parser to use strtoul
instead of atoi, and change the check.

While we're here, make a similar change to the DAFS salvageserver,
too.

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

13 years agoDon't use KERN_OPTMZ or KERN_DBG on Linux 2.6
Simon Wilkinson [Sun, 6 Mar 2011 17:22:14 +0000]
Don't use KERN_OPTMZ or KERN_DBG on Linux 2.6

With 2.6 Linux kernels, we just use the standard Kernel build system.
As this system pays no attention to our settings of KERN_OPTMZ or
KERN_DBG, don't bother setting values for these for 2.6 kernels.

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

13 years agoRemove -D_LARGEFILE64_SOURCE on Linux
Simon Wilkinson [Sun, 6 Mar 2011 17:15:05 +0000]
Remove -D_LARGEFILE64_SOURCE on Linux

Since 129b6954a6f491c6f3c3e417055bdc68d4726408, we've defined
GNU_SOURCE on all Linux builds. This definition automatically sets
_LARGEFILE64_SOURCE for us, so we don't need to explicitly set it
in the platform specific configuration.

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

13 years agoRemove redundant entries from MT_CFLAGS
Simon Wilkinson [Thu, 10 Mar 2011 00:20:26 +0000]
Remove redundant entries from MT_CFLAGS

Don't include XCFLAGS in MT_CFLAGS, as this is now done elsewhere in
the build process. Don't multiply specify -DAFS_PTHREAD_ENV, as all
pthreaded build rules must defined this, and just doing so in one
place is much cleaner.

Change-Id: I2cc1f88119e9ad32151cb7575222c2d2c008005f
Reviewed-on: http://gerrit.openafs.org/4190
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agohcrypto: don't redefine key_type
Simon Wilkinson [Thu, 10 Mar 2011 10:41:57 +0000]
hcrypto: don't redefine key_type

Linux's keyring code uses "struct key_type", which is also used
internally by the hcrypto code. As, on some Linux variants,
afs/sysincludes.h ends up including the keyring definitions, we
need to rename our internal key_type definition to something
that doesn't clash.

Change-Id: Ibfb968db0db3e80d877881fc6da4b34428ee382f
Reviewed-on: http://gerrit.openafs.org/4192
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRevert "hcrypto: avoid key_type redefinition"
Simon Wilkinson [Thu, 10 Mar 2011 09:43:35 +0000]
Revert "hcrypto: avoid key_type redefinition"

This reverts commit 81487fcf3ae93d2efea6f0935a0493680b5d3d11.

This change didn't receive sufficient review before it was pushed.
It breaks builds on IRIX, and produces kernel modules that don't
load on a number of other Linux-based systems.

A correct fix for the underlying problem (that both Linux and
hcrypto want to use the "struct key_type" identifier) will follow
this patch.

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

13 years agolinux: defer vcache evictions when sleep would be needed
Derrick Brashear [Thu, 17 Feb 2011 05:04:06 +0000]
linux: defer vcache evictions when sleep would be needed

because we're only willing to loop 100 times worth of "sleeps",
on a machine with heavy vcache demands we can end up just growing
the list huge. in the first pass, just clean up as many entries which
do not require sleeping as needed. if we need more entries, make
a second pass.

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

13 years agoWindows: handle rx busy call channel
Jeffrey Altman [Wed, 9 Mar 2011 12:51:02 +0000]
Windows: handle rx busy call channel

Register an error code for rx busy call channel detection.
Force a retry whenever CM_RX_BUSY_CALL_CHANNEL is received
by cm_Analyze().  Log the event to both the internal trace
log and the Windows Event Log along with the server address.

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

13 years agoRX: Avoid timing out non-kernel busy channels
Andrew Deason [Mon, 7 Mar 2011 17:08:26 +0000]
RX: Avoid timing out non-kernel busy channels

When we encounter a "busy" call channel (indicated by receiving
RX_PACKET_TYPE_BUSY packets), we can error out a call with
RX_CALL_TIMEOUT to try and get the application code to retry the call.
However, many RX applications are not aware of this, and will just
fail with an error upon receiving a single busy packet.

So instead, make this behavior optional, and only do it if the
application tells us what specific error it expects to receive when a
busy call channel is detected. Enable this behavior for the Unix cache
manager, as it can cope with receiving an RX_CALL_TIMEOUT error in
this scenario.

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

13 years agoaklog: Do not include XCFLAGS twice
Andrew Deason [Wed, 16 Feb 2011 03:23:06 +0000]
aklog: Do not include XCFLAGS twice

In aklog, we set MODULE_CFLAGS to XCFLAGS and some other things.
However, when using AFS_LDRULE or AFS_CCRULE, CFLAGS will contain
MT_CFLAGS, which contains XCFLAGS. The end result is that the contents
of XCFLAGS appear twice in the compilation invocation, breaking some
platforms like HP-UX where the order of XCFLAGS relative to other
things is a bit fragile.

Fix this by removing XCFLAGS from the MODULE_CFLAGS definition.

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

13 years agovol: FILE* to FD_t except logging and special ops
Jeffrey Altman [Sat, 5 Mar 2011 19:34:05 +0000]
vol: FILE* to FD_t except logging and special ops

Replace all use of FILE* with FD_t.  Switch from afs_open to OS_OPEN.
In the process:

 afs_flush and afs_fsync -> OS_SYNC
 afs_stat which is used to obtain the file size -> OS_SIZE
 afs_close or close -> OS_CLOSE

Etc.   While cleaning up, use afs_stat_st macro when declaring
a struct stat because the structure and function are not guaranteed
to be the same name on all platforms.

These changes permit Windows to build the vol package without
the use of the C runtime library.

Change-Id: I9e0a7fdbeffa76c3c87aefce87ca1af495657a2f
Reviewed-on: http://gerrit.openafs.org/4149
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agovol: consolide afs_xxxx macros in ihandle.h
Jeffrey Altman [Sat, 5 Mar 2011 19:25:34 +0000]
vol: consolide afs_xxxx macros in ihandle.h

Various definitions of afs_open, afs_stat, etc. were
scattered across the .c sources within the vol package.
Consolidate them all in ihandle.h which is included in
all of the files and contains the OS_xxxx macros which
will substitute for many afs_xxxx calls in future patchsets.

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

13 years agoClarify the role of XCFLAGS and simplify MT_CFLAGS
Simon Wilkinson [Fri, 11 Feb 2011 11:53:26 +0000]
Clarify the role of XCFLAGS and simplify MT_CFLAGS

Tidy up the build system by making it clear that XCFLAGS is included
for every build type. Also clean up MT_CFLAGS so that it doesn't
statically include XCFLAGS, and remove the common AFS_PTHREAD_ENV
define that's needed by every architecture.

This fixes the problem that we had where directories built with the
pthread or shared build rules weren't being compiled with checking
enabled, as well as hopefully making the tangle of defines easier to
understand.

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

13 years agolibadmin: minor warning fix
Marc Dionne [Mon, 7 Mar 2011 20:31:53 +0000]
libadmin: minor warning fix

have_quota is set but never used.  Remove it.

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

13 years agohcrypto: avoid key_type redefinition
Derrick Brashear [Tue, 8 Mar 2011 02:32:53 +0000]
hcrypto: avoid key_type redefinition

struct key_type is redefined in crypto.h; originally defined in
./linux/security.h from ../afs/sysincludes.h from hcrypto/kernel/config.h

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

13 years agovol: remove warning on use of DFlushVolume
Jeffrey Altman [Sat, 5 Mar 2011 19:29:38 +0000]
vol: remove warning on use of DFlushVolume

Include the afs/dir.h header on Windows to avoid
warnings caused by the missing prototype.

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

13 years agocrypto: Avoid variadic macros
Simon Wilkinson [Sun, 6 Mar 2011 18:18:07 +0000]
crypto: Avoid variadic macros

The IRIX compiler doesn't seem to like variadic macros, so avoid
using them within the RFC3961 kernel crypto implementation

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

13 years agoubik: cleanup DB lock usage in SDISK_SendFile
Marc Dionne [Sat, 29 Jan 2011 17:48:02 +0000]
ubik: cleanup DB lock usage in SDISK_SendFile

Some failure paths can return from SDISK_SendFile with the
database lock still held.  Other failure paths will cause
setlabel to be called without holding the lock.

Rework the failure paths so we always release the DB lock before
returning, and always hold it when calling setlabel.

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

13 years agoubik: refactor pthread creation code
Marc Dionne [Sat, 5 Mar 2011 16:40:41 +0000]
ubik: refactor pthread creation code

Refactor thread creation into a new ubik_thread_create function.
Eliminates some code duplication.

No functional changes.

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

13 years agoubik: remove unused code
Marc Dionne [Sat, 5 Mar 2011 16:19:10 +0000]
ubik: remove unused code

Remove some unused code and associated comment.  rx_Init does
belong earlier in the sequence.

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

13 years agoubik: Rearrange some initialization code
Marc Dionne [Thu, 20 Jan 2011 02:57:58 +0000]
ubik: Rearrange some initialization code

Some basic initialization should precede creating the RX
services.

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

13 years agoubik: make uphys_close static
Marc Dionne [Sat, 29 Jan 2011 16:14:50 +0000]
ubik: make uphys_close static

This function is not used outside of phys.c, so make it private.

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

13 years agoubik: remove successive Quorum_EndIO, Quorum_StartIO calls
Marc Dionne [Sat, 5 Mar 2011 15:27:36 +0000]
ubik: remove successive Quorum_EndIO, Quorum_StartIO calls

Refactoring brought these 2 calls together.
They can be optimized away.

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

13 years agoFix positional I/O support for largefiles
Ryan C. Underwood [Sun, 6 Mar 2011 10:40:53 +0000]
Fix positional I/O support for largefiles

Commit 335ccb40 introduced positional I/O support for the fileserver,
but didn't handle the largefile versions of preadv and pwritev. As a
result, the fileserver cannot handle files of more than 2Gb in size.

Fix this by using preadv64 and pwritev64 where O_LARGEFILE is defined,
in the same way as for all other I/O primitives.

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

13 years agoDisable vectored positional IO if no 64bit support
Simon Wilkinson [Sun, 6 Mar 2011 16:06:36 +0000]
Disable vectored positional IO if no 64bit support

In order to support vectored positional I/O, and large files, we
need there to be an implementation of preadv64 and pwritev64. If
this isn't present, then just disable HAVE_PIOV.

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

13 years agovolser: warning removal
Jeffrey Altman [Sat, 5 Mar 2011 14:58:17 +0000]
volser: warning removal

remove assigning size_t to int warnings when size_t is larger
by declaring appropriate variables as size_t.

remove signed vs unsigned warnings

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

13 years agoubik: add lock initialization function
Marc Dionne [Thu, 20 Jan 2011 02:52:04 +0000]
ubik: add lock initialization function

Add a new lock initialization function and call it from the
initialization sequence.  Users of the locks can assume that
they are already initialized.

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

13 years agoubik: rename DInit, call from initialization sequence
Marc Dionne [Thu, 20 Jan 2011 02:39:44 +0000]
ubik: rename DInit, call from initialization sequence

Rename DInit to udisk_Init, and call it from the general
initialization sequence.  udisk_begin can now assume that this
has been done.

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

13 years agoubik: build all files for pthread version
Jeffrey Altman [Sat, 5 Mar 2011 23:34:57 +0000]
ubik: build all files for pthread version

Build all files for pthreads from the ubik directory.
No longer require src/tubik/NTMakefile.
Add missing library to tbutc linkage requirements.

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

13 years agovolser: restore diskPartition[64] lock_fd comment
Jeffrey Altman [Sat, 5 Mar 2011 15:06:50 +0000]
volser: restore diskPartition[64] lock_fd comment

The diskPartition[64] wire structures contain an int to represent
the file descriptor.  This field is too small to represent the
Windows file descriptor which is a 64-bit HANDLE.  A comment had
been added by Rod Widdowson.  Restore it.

Change-Id: Icf513060802e7f057f6ca735afb26d22edbf6446
Reviewed-on: http://gerrit.openafs.org/4138
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agovolser: cleanup volser_internal.h
Jeffrey Altman [Sat, 5 Mar 2011 14:38:08 +0000]
volser: cleanup volser_internal.h

remove yesprompt() prototype for function that no longer exists

make dump_sig_handler(), sortVolumes(), VolumeExists(),
CheckVldbRWBK(), CheckVldbRO(), and CheckVldb() static within
vsprocs.c

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