openafs.git
12 years agoWindows: shell extension is multithreaded
Jeffrey Altman [Wed, 8 Jun 2011 06:22:41 +0000]
Windows: shell extension is multithreaded

Since the shell extension is multithreaded and it is possible
for more than one thread to be executing in the gui2fs.cpp module
at a time, it is not safe to use a single static 'space' buffer
by more than one thread at a time.   Move the buffer into the
stack of each function that uses it so that we have thread safety.

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

12 years agodoc: fixes for the xsltproc -> fop -> pdf toolchain
Chas Williams (CONTRACTOR) [Tue, 7 Jun 2011 18:26:11 +0000]
doc: fixes for the xsltproc -> fop -> pdf toolchain

"Empty" <anchor> entities seem to trigger a bug in fop.  These are
easily converted to reference on the containing block.  Additionally,
<indexterm>'s seem to need to be inside a non-structural entity (like
a <para>) in order to determine their page number/location correctly.

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

12 years agoAlso install afszcm.cat for i386_fbsd
Ben Kaduk [Tue, 7 Jun 2011 15:30:18 +0000]
Also install afszcm.cat for i386_fbsd

The change gerrit/4760 enabled the use of gencat to actually build
this file, but failed to also change installation logic, so it was
sitting unused in the build tree.  Fix this, and install the file.
This allows us to remove a shell case statement which had formerly
been needed to enforce this restriction.

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

12 years agorx: Don't maintain maxSerial
Simon Wilkinson [Fri, 5 Nov 2010 00:23:23 +0000]
rx: Don't maintain maxSerial

There were no users within the code of the rx connection maxSerial
element, and maintaining it required locking on a critical path. So,
get rid of it.

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

12 years agorx: Reorganise transmit queue walk
Simon Wilkinson [Sun, 5 Jun 2011 10:04:12 +0000]
rx: Reorganise transmit queue walk

The transmit queue is stored in the order that we transmitted the
packets (by sequence number). This means that we can do all of the
ACK processing by just doing a single walk of this queue, rather
than having to walk the queue multiple times, once for each type of
ACK.

This clarifies the queue processing, and should reduce the amount of
time that we spending iterating large transmit queues.

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

12 years agorx: Add RX_CALL_ACKALL_SENT flag and rxi_SendAck processing
Jeffrey Altman [Sun, 5 Jun 2011 22:41:24 +0000]
rx: Add RX_CALL_ACKALL_SENT flag and rxi_SendAck processing

3cd3715e608b801b4848399e42cb47464e6e3cc3 modified rxi_ReceiveDataPacket
to send an ACKALL whenever RX_CALL_RECEIVE_DONE is set on the call.
This produced the potential for a race with ACKs that set the
firstPacket value to 'rnext' when the receive queue for the call
has yet to be emptied.  From the perspective of receiver the ACK
was already processed and does not require a response since the
previously received ACKALL acknowledged the delivery of all data
packets to the application.  When sending ACKs after ACKALL it is
therefore required that firstPacket be set to the sequence number
after the last unprocessed packet in the receive queue.

Thanks to Simon Wilkinson for his extensive assistance in identifying
the problem and the development of this patchset.

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

12 years agoAdded fstrace subcommand help to binary
Jeff Blaine [Thu, 26 May 2011 18:22:52 +0000]
Added fstrace subcommand help to binary

Added subcommand help to fstrace binary.

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

12 years agorx: do not rxi_AckAll for one data packet call
Jeffrey Altman [Sun, 5 Jun 2011 20:02:46 +0000]
rx: do not rxi_AckAll for one data packet call

rxi_ReceiveDataPacket() calls rxi_AckAll() when the call reaches
the RX_CALL_RECEIVE_DONE state to permit the caller to empty the
transmit queue.  That reduces the memory consumption of the caller
and avoids unnecessary retransmits which the call is in process.

If the call data consists of a single packet it is possible that
Ping ACK packets sent as part of connection establishment could
race with the ACKALL and be delivered out of order.  If the Ping
ACK is delivered second, it will be ignored by the peer forcing
a two second delay in connection establishment.  To avoid the race
do not send an ACKALL for a single packet call.

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

12 years agoubik: Use supplied config directory in ugen
Simon Wilkinson [Mon, 30 May 2011 19:07:01 +0000]
ubik: Use supplied config directory in ugen

ugen_ClientInit permits the configuration directory to use to be
passed on the command line. However, it was then promptly overwritting
the supplied directory with the standard client (or server) directories,
depending on whether localauth was in use or not.

As a start to fixing this anti-social behaviour, modify ugen so that if
we're not doing localauth, and if the caller has passed us a config
directory, use that instead of the system default one. This allows us to
start creating test harnesses for our command line tools.

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

12 years agotests: Use a real IP address for the test cell
Simon Wilkinson [Tue, 31 May 2011 08:27:57 +0000]
tests: Use a real IP address for the test cell

When creating the test CellServDB, use the IP address of the machine
that we are running on, rather than 127.0.0.1. This makes it possible
to actually start up ubik servers using this CellServDB.

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

12 years agotests: Move code to add new DES keys to common
Simon Wilkinson [Mon, 30 May 2011 17:18:33 +0000]
tests: Move code to add new DES keys to common

Make the code which adds a new (static) DES key to a cell's
configuration generally available, as this will also be useful in
constructing other tests

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

12 years agotests: Move common code to its own directory
Simon Wilkinson [Mon, 30 May 2011 16:47:35 +0000]
tests: Move common code to its own directory

Move code for faking up an OpenAFS configuration directory into its
own "common" directory, as it's going to be of use to more tests than
just those in auth.

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

12 years agovos: Add the -config option
Simon Wilkinson [Mon, 30 May 2011 19:14:45 +0000]
vos: Add the -config option

Add the -config option to all vos commands, so that the user can set
the location of the configuration directory to use. This is primarily
provided for testing purposes, and will shortly be used to hook vos
up into the TAP-style test suite.

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

12 years agocmd: Add support for disabling specific abbrevs
Simon Wilkinson [Mon, 30 May 2011 19:02:31 +0000]
cmd: Add support for disabling specific abbrevs

Sometimes, when adding a new command parameter, it's necessary to
prevent it from colliding with an existing abbreviation. This patch
adds a new command flag CMD_NOABBRV which can be set on a parameter
to indicate that it should not be considered when checking for
ambiguous abbreviations.

For example, if a command has the existing '-cell' option which is
popularly abbreviated to '-c', adding a '-config' option would
cause the existing abbreviation to stop working. However, if '-config'
is added with the NOABBRV flag set, '-c' will continue to work.

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

12 years agoWindows: refactor fs acl funcs into fs_acl.c
Jeffrey Altman [Sat, 4 Jun 2011 17:28:26 +0000]
Windows: refactor fs acl funcs into fs_acl.c

The ACL structure definitions and manipulation functions
were defined both in WINNT/afsd/fs.c and WINNT/client_exp/gui2fs.cpp.
Extract them to WINNT/afsd/fs_acl.c and refactor them so that a
single copy can be maintained for both modules.

The most significant change is to CleanAcl() which now accepts
a cellname instead of a file path.  By accepting a cellname the
ACL functionality is completely isolated from the path processing
and pioctl operations.

At the present time, fs.exe calls CleanAcl() with a cell name
and afs_shl_ext.dll does not.  All callers in fs.c have been updated
to use the new behavior.

gui2fs.cpp also comments functions that exist in the file but
have no caller.  These can be removed at a later date if they
are not required.

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

12 years agoWindows: Add GetFileInformationByHandleEx to fs_InAFS
Jeffrey Altman [Sat, 4 Jun 2011 03:39:59 +0000]
Windows: Add GetFileInformationByHandleEx to fs_InAFS

If available on the operating system, use
GetFileInformationByHandleEx to translate the path into
the file system normalized form.  This permits paths that
cross NTFS reparse points to be successfully evaluated as
being in afs.   For example:

  c:\afs -> \\afs\all

GetFileInformationByHandleEx is integrated into Vista and
Server 2008 and above.

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

12 years agoWindows: refactor fs, symlink and fs_utils
Jeffrey Altman [Fri, 3 Jun 2011 18:19:27 +0000]
Windows: refactor fs, symlink and fs_utils

over the years a large number of duplicated functionality
has been added to symlink.c and fs.c.  Refactor both so all
common functionality is implemented within fs_utils.c.

Ensure that all functionality migrated to fs_utils.c and
symlink.c uses the SafeString library functions.

Update the build rules for afs_shl_ext.dll, afscreds.exe
and afsconfig.exe to support the changes to fs_utils.c.

Remove non-windows components from symlink.c.

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

12 years agoRemove completed tasks from todo list, add info about git/gerrit preference
Jeff Blaine [Sun, 5 Jun 2011 20:38:53 +0000]
Remove completed tasks from todo list, add info about git/gerrit preference

Removed completed tasks (fstrace subcommand help in-binary and issue with
-noexecute vs. -dryrun in vos delentry) from todo list.  Added info about
git/gerrit preference for documentation help, but patches still allowed
to the openafs-doc list.

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

12 years agosrc/tests: Fix a couple of build issues
Simon Wilkinson [Mon, 30 May 2011 16:39:56 +0000]
src/tests: Fix a couple of build issues

Fix a couple of build problems with the old src/tests directory.
Firstly, now that we're using asnprintf in libauth, we need to include
libroken as a dependency here too.
Secondly, the build rule for dumptool is wrong. Fix it.

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

12 years agorx: Make private things private
Simon Wilkinson [Mon, 27 Sep 2010 10:51:20 +0000]
rx: Make private things private

Make rxi_* functions that are only used within the file that they're
defined in actually be private, rather than sharing them with the world.

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

12 years agorxperf: -S takes an argument
Simon Wilkinson [Sat, 14 May 2011 07:37:31 +0000]
rxperf: -S takes an argument

The -S option to rxperf (which permits the maximum number of server
threads to be set) takes a parameter. Update the getopt string so
that we can give it one.

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

12 years agorxperf: Build again
Simon Wilkinson [Sat, 14 May 2011 07:36:49 +0000]
rxperf: Build again

Bring the rxperf up to date with the current library requirements of
the rest of the tree.

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

12 years agovolinfo: Use new form of cmd_AddParamWithOffset
Simon Wilkinson [Sun, 5 Jun 2011 20:29:08 +0000]
volinfo: Use new form of cmd_AddParamWithOffset

cmd_AddParmWithOffset was recently modified to change the order of
its arguments to something clearer. Modify vol-info to use this new
argument order

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

12 years agoviced: Rationalise FS_STATS_DETAILED logging
Simon Wilkinson [Sun, 17 Apr 2011 18:14:01 +0000]
viced: Rationalise FS_STATS_DETAILED logging

Every RPC handler in the fileserver contained a copy of an identical
code block to handle starting, stopping, and recording detailed logging
statistics. Replace all of this with a structure and 4 helper functions,
which will make maintenance much easier.

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

12 years agousd: Move to using real 64bit quantities
Simon Wilkinson [Thu, 30 Sep 2010 19:24:49 +0000]
usd: Move to using real 64bit quantities

Move the usd library over to using afs_int64, rather than afs_hyper_t
now that everything in userspace is assumed to be 64bit capable.

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

12 years agoviced: Remove old /vice/file/parms config file
Simon Wilkinson [Sun, 24 Apr 2011 19:52:08 +0000]
viced: Remove old /vice/file/parms config file

This commit removes support for overriding command line options with
the contents of /vice/file/parms. This option has never been documented,
and only supports setting at most 15 command options. Replace the old
function with one which checks for the existence of this file, and
outputs a warning if it is found.

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

12 years agousd: Make test program build again
Simon Wilkinson [Thu, 30 Sep 2010 19:03:24 +0000]
usd: Make test program build again

Make the USD test program build again. Note that this isn't much use
unless you have a tape device connected to your machine.

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

12 years agokvno invocation correction, language cleanup, afs/cell principal preferred
Jeff Blaine [Fri, 27 May 2011 19:49:52 +0000]
kvno invocation correction, language cleanup, afs/cell principal preferred

Properly show kvno command syntax, add information about preferring
'afs/cell' for the principal over 'afs', and changed "noted this down"
to "made note of"

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

12 years agovos: print_addrs never receives multi-homed addrs
Simon Wilkinson [Tue, 31 May 2011 07:31:55 +0000]
vos: print_addrs never receives multi-homed addrs

The magic address that tells the vlserver that a host is multi-homed,
and to look up the multi-homed address structure is an internal
implementation feature, which shouldn't be exposed to clients.

print_addrs is only ever called with the results of VL_GetAddrsU, which
has already converted any multi-homed pointers, so it doesn't need the
logic to handle them itself.

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

12 years agodoc: let configure find the XML tools if possible
Chas Williams (CONTRACTOR) [Thu, 2 Jun 2011 23:00:47 +0000]
doc: let configure find the XML tools if possible

configure should attempt to find the XML tools we need to process
the documentation.  if it can't, it should provide a safe default.
still allow the user to override via command line.

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

12 years agoxstat: cope with different size timeval structures
Michael Meffie [Fri, 24 Sep 2010 01:18:36 +0000]
xstat: cope with different size timeval structures

In xstat_fs_test and afsmonitor, try to display the xstat data
from the fileserver even if the fileserver has differently sized
timeval structures, or different word ordering, as the xstat
client program.

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

12 years agoLinux CM: Update wait code
Simon Wilkinson [Tue, 19 Apr 2011 07:18:56 +0000]
Linux CM: Update wait code

Update the wait code to use the more modern wait_event_freezable()
macros. If those macros are not available, fall back to the older
wait_event_interruptible macro, and build our own
wait_event_freezable on top of this.

These changes should simplify our interactions with the wait queue
and refrigerator bits of the kernel, as we're now using more standard
interfaces to them.

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

12 years agoLinux CM: Use kernel allocator directly
Simon Wilkinson [Sun, 17 Apr 2011 22:43:51 +0000]
Linux CM: Use kernel allocator directly

In another few locations within the Linux portion of the cache
manager, directly use the kernel allocator. We can do so here
because we can guarantee that the amount of memory being allocated
is less than the page size, and there is a kfree() in all of the
exit paths, so we don't need the magic freeing behaviour, either.

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

12 years agoLinux CM: Use kernel allocator directly for events
Simon Wilkinson [Sun, 17 Apr 2011 22:40:55 +0000]
Linux CM: Use kernel allocator directly for events

When allocating memory for our events system, use the kernel
allocator directly, rather than going via our shim. This is much
more efficient, but has the drawback that we are now responsible
for freeing our own memory, rather than it all being magically
given back upon shutdown.

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

12 years agoLinux CM: Files don't need a page
Simon Wilkinson [Sun, 17 Apr 2011 20:41:15 +0000]
Linux CM: Files don't need a page

We were using osi_AllocLargeSpace to allocate our files. This gives
a page to every struct osi_file we create, which seems a little bit
excessive. Just use kmalloc directly instead, and let the kernel's
allocator deal with the slabbing.

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

12 years agolibafs: Tidy up iovec allocation and trimming
Simon Wilkinson [Sun, 17 Apr 2011 19:52:50 +0000]
libafs: Tidy up iovec allocation and trimming

Tidy up the way that we perform iovec allocation and trimming by
making the rest of the world look a little bit more like Darwin.

This relies upon a struct uio, followed by 16 iovecs, being able
to fit into a SmallSpace sized block. On the majority of 32 bit
systems, such a block is 256 bytes long (on AIX and HPUX it is
152 bytes). With a 32bit size_t, an iovec is 8 bytes, so 16 of
them is 128 bytes, and a struct uio is 24 bytes, giving a grand
total of 152.

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

12 years agoTidy up uio_t meaning
Simon Wilkinson [Sun, 17 Apr 2011 20:30:39 +0000]
Tidy up uio_t meaning

On IRIX, uio_t is typedef'd to "struct uio".
On Darwin, uio_t is typedef'd to "struct uio *".

Reduce the confusion by just not using "uio_t" in places where it
isn't being defined for us, and avoiding it completely in cross-platform
code.

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

12 years agolinux: rpm: Fix SELinux attributes on /afs when installing openafs-client package
Jonathan Billings [Wed, 1 Jun 2011 15:05:11 +0000]
linux: rpm: Fix SELinux attributes on /afs when installing openafs-client package

Since the directory /afs isn't included in the package manifest, but
rather created in a script in the openafs-client package, it never
gets the appropriate SELinux attributes that are required to mount a
volume (mnt_t).

This change fixes the problem by running '/sbin/restorecon' (if it is
an executable that exists) on the /afs directory after the
openafs-client package is installed, right after the directory is
created.

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

12 years agovolinfo: accept -sizeonly for -sizeOnly
Michael Meffie [Fri, 27 May 2011 22:17:44 +0000]
volinfo: accept -sizeonly for -sizeOnly

For consistency, allow -sizeonly (all lowercase letters) to
request the size summary. The old option name, -sizeOnly is
available as an alias.

Define the command line option parameter positions and use
those to set and look up the options.

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

12 years agovolinfo: accept vice partition id for -part option
Michael Meffie [Fri, 27 May 2011 16:22:34 +0000]
volinfo: accept vice partition id for -part option

Accept a partition id for the -part option. For example, -part a
is the same as -part /vicepa.

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

12 years agovolinfo: comments
Michael Meffie [Fri, 27 May 2011 15:29:33 +0000]
volinfo: comments

Add doxygen style comment headers.

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

12 years agovolinfo: fix file size data type
Michael Meffie [Fri, 27 May 2011 14:27:03 +0000]
volinfo: fix file size data type

Use afs_sfsize_t for file size instead of int.

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

12 years agovolinfo: avoid exit on errors
Michael Meffie [Fri, 27 May 2011 01:58:11 +0000]
volinfo: avoid exit on errors

Instead of exiting on errors, try to carry on.

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

12 years agovolinfo: refactor mode variables
Michael Meffie [Tue, 24 May 2011 14:28:37 +0000]
volinfo: refactor mode variables

Untangle the various global mode variables, which became muddled when dsizeOnly
and saveinodes were introduced. DumpInfo now indicates the default mode and
DumpVnodes means print the vnode entries, not scan but sometimes print.  Remove
unused globals.

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

12 years agovolinfo: refactor volume and vnode handling code
Michael Meffie [Mon, 23 May 2011 02:53:46 +0000]
volinfo: refactor volume and vnode handling code

Refactor volume and vnode handling code for better
maintainability.  Move the code invoked by -saveinodes to a new
function. Remove an unneeded else clause in HandleVolumes.

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

12 years agovolinfo: refactor size counters
Michael Meffie [Thu, 26 May 2011 01:54:06 +0000]
volinfo: refactor size counters

Put the volume, partition, and server size counters into structures.

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

12 years agovolinfo: refactor -sizeOnly printing
Michael Meffie [Wed, 25 May 2011 22:19:22 +0000]
volinfo: refactor -sizeOnly printing

Refactor the -sizeOnly output processing to reduce code
duplication and coupling with -saveinodes.

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

12 years agoEnable gencat for i386_fbsd_*
Ben Kaduk [Tue, 31 May 2011 19:25:35 +0000]
Enable gencat for i386_fbsd_*

The machines certainly have a /usr/bin/gencat, and I see nothing
in history to indicate a reason for this prevention.
Allow the 32-bit machines to build afszcm.cat and make packaging
more uniform between architectures.

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

12 years agovlserver: Add flags to extent address entries
Simon Wilkinson [Mon, 23 May 2011 05:24:09 +0000]
vlserver: Add flags to extent address entries

Add a "flags" field to the extent address entry so that we can store
per server bit flag information. Rename the header flags feel (and
corresponding macro) so that it's explicitly a header flag. Take
this opportunity to also fix this comment to clarify that the header
flags are not a copy of anything from the vlentry, but that they
must be at the same structure offset as the vlentry flags field (so
that something accessing an extent block as if it was a vlentry can
see what it is from the flags)

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

12 years agovlserver: Make space in extent block explicit
Simon Wilkinson [Mon, 23 May 2011 05:20:35 +0000]
vlserver: Make space in extent block explicit

The address entry side of the union within the extent addr block
actually has a significant amount of free space. It looks as though
the original author assumed that a UUID required 16 32-bit words,
rather than 16 octets, and sized the structure to match.

Make the free space within the structure explicit, so that it can
be used for future expansion

Verified with
  gdb vlserver
    (gdb) print sizeof(struct extentaddr)
    $1 = 128

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

12 years agovlserver: Rationalise multi homed host processing
Simon Wilkinson [Thu, 19 May 2011 18:15:44 +0000]
vlserver: Rationalise multi homed host processing

The same code for getting extent structures for multi homed hosts
was scattered throughout vlprocs.c, sometimes with error handling,
and sometimes without. Rationalise all of this into a pair of
static inline functions, which do all of the hard work.

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

12 years agovlserver: Use correct memsets in vlentry convertor
Simon Wilkinson [Thu, 19 May 2011 17:56:27 +0000]
vlserver: Use correct memsets in vlentry convertor

The various vlentry_to_<blah> conversion functions have obviously
been copy and pasted from each other. However, the size of the
structure which is being zeroed has not been updated when we are
zeroing different structures. Fix this, so that we always clear all
of the structure that we are filling.

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

12 years agovlserver: Clean up abort logic
Simon Wilkinson [Thu, 19 May 2011 17:53:27 +0000]
vlserver: Clean up abort logic

Clean up the failure logic in the server RPC handlers so that there
is always a single exit point upon aborts. This should make it much
easier to fix the various problems with cleaning up memory when
RPCs fail.

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

12 years agovlserver: Use correct base value when replacing
Simon Wilkinson [Thu, 19 May 2011 17:19:29 +0000]
vlserver: Use correct base value when replacing

When we're removing existing address entries the code calculates
a base and index value for each entry that we're removing an address
from. However, it then _uses_ a previously calculated base value,
with the new index. This works fine if the old base and the new base
match, but if they don't, chaos will ensue.

Fix to always use matched base and index pairs.

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

12 years agovlserver: Rename errorcode to code
Simon Wilkinson [Thu, 19 May 2011 16:57:30 +0000]
vlserver: Rename errorcode to code

The convention in the OpenAFS code is to use 'code' or 'ret' for
return values from functions. Rename 'errorcode' in vlprocs.c to
be in keeping with this convention.

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

12 years agovlserver: Tidy up request counting
Simon Wilkinson [Thu, 19 May 2011 14:06:15 +0000]
vlserver: Tidy up request counting

Tidy up the counting of requests and aborts in the vlserver. Don't
hide a variable allocation within a macro, convert macros to inline
functions, and make it possible to not count particular operations
by passing in an opcode of 0.

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

12 years agoBuild system: Move install definitions to include
Simon Wilkinson [Sun, 14 Nov 2010 21:43:11 +0000]
Build system: Move install definitions to include

Move the definitions of the INSTALL_* variables out to
Makefile.config rather than replicating them in each file.

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

12 years agoaklog: Remove Windows specific code from header
Simon Wilkinson [Sat, 4 Jun 2011 17:04:48 +0000]
aklog: Remove Windows specific code from header

When commit 3f54c934b9c933d5f34644a096c821375db17d97 removed all of
the Windows code from aklog, it missed the stuff in aklog.h. Get
rid of this too, for clarity.

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

12 years agoubik: Initialise global version lock before use
Simon Wilkinson [Sat, 4 Jun 2011 15:41:41 +0000]
ubik: Initialise global version lock before use

Commit e4ac552ab79be21d90397079eaf6be7050497752 introduced a global
version lock to ubik, but doesn't initialise this lock before make use
of it. On platforms which require that pthread mutexes are initialsed,
this causes an assertion failure.

Initialise this lock at the same time as we MUTEX_INIT all of our other
locks.

Change-Id: Ib5ef75d443101a823738fba55c0760cb1848dbcf
Reviewed-on: http://gerrit.openafs.org/4780
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

12 years agocmd: Reorder cmd_AddParmAtOffset arguments
Michael Meffie [Mon, 30 May 2011 18:23:49 +0000]
cmd: Reorder cmd_AddParmAtOffset arguments

Reorder the arguments of this recently introduced function to
make client code more readable.

Change-Id: I37f662f849bd96176230f75783e2a1c62d94b8c9
Reviewed-on: http://gerrit.openafs.org/4755
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

12 years agoxstat: print collection values in debug mode
Michael Meffie [Mon, 13 Dec 2010 19:53:50 +0000]
xstat: print collection values in debug mode

Print the values of the integers returned in the collection data
when the -debug option is given to xstat_fs_test and xstat_cm_test
test programs. This allows us to at least see what the unformatted
values are when there is a mismatch in timeval sizes between the
host and client (aka the 32/64 bit xstat bug). This change could
break scripts which call the xstat test programs with the debug
option. New debug output are prepended with 'debug:' to be
easily ignored.

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

12 years agofs: add support for relative ACL changes
Rainer Strunz [Sun, 17 Apr 2011 23:09:33 +0000]
fs: add support for relative ACL changes

This change permits "fs setacl" to change ACLs in a relative
manner, rather than just setting rights absolutely as it is
done now.

If a single plus (+) or minus (-) character is appended to
the rights' letters argument, the new rights are computed
relatively to the existing ones.

A few examples should make clear that behaviour:

old rights: rights set: new rights:
-----------------------------------------------
rl a+ rla
rlid idwa- rl
rla write- a
rl write- [none] (ie. entry deleted)
[any] read= rl

As shown in the last example, a '=' character got implemented
also (and for free) as an alternative writing of the current
and default behaviour of just setting an ACL.

FIXES 123962

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

12 years agodir: Prototype and function name cleanup
Simon Wilkinson [Fri, 6 May 2011 09:40:38 +0000]
dir: Prototype and function name cleanup

Tidy up typing in the dir package, so that we have a specific type
for a directory file handle.

Also rename all of the functions to afs_dir_* globablly, rather than
just renaming for kernel code.

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

12 years agodir: Explicitly state buffer locations for data
Simon Wilkinson [Wed, 27 Apr 2011 18:24:56 +0000]
dir: Explicitly state buffer locations for data

DNew and DRead always returned directory page aligned pointers,
however the directory code further manipulates those pointers,
requiring the DRelease be able to fill a page when passed a pointer
to any address within that page. This is relatively straightforward
in the userspace implementation, but much more complex in the kernel,
where all of the directory pages are not necessarily contiguous.

Resolve this issue by making DNew, DRead and DRelease all return a
new structure, struct DirBuffer. This structure contains both a
pointer to the data, and an implementation specific private
pointer to data describing the page containing the address. The
directory code is free to play with the data pointer as it wishes,
as long as the private pointer to the page is passed through intact.

DRelease (and DVOffset) can then simply use the private pointer for
their operations, without having to walk page lists.

This new behaviour also requires changes to the directory functions
GetBlob, FindItem and FindFid which all return pointers to directory
data.

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

12 years agodoc: bos != vos
Simon Wilkinson [Mon, 30 May 2011 19:11:49 +0000]
doc: bos != vos

As it says on the tin

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

12 years agovos: Don't leak/overflow bulkaddrs
Simon Wilkinson [Tue, 31 May 2011 07:28:51 +0000]
vos: Don't leak/overflow bulkaddrs

The vos listaddrs command repeatedly reuses a bulkaddrs array. It
zeros it once (without freeing the allocated memory), and then
repeatedly uses it without zeroing in a loop. This means that the XDR
library assumes that a sufficiently large block is already allocated,
doesn't reallocate for the incoming data, or check limits.

This means that if the first call to VL_GetAddrsU returns a set of
addresses smaller than subsequent calls, we'll write past the end
of the array, causing memory corruption.

Fix this by freeing the arrays correctly with each pass of the call.

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

12 years agolibafscp: fix install/dest in sep. Objectdir
Christof Hanke [Wed, 1 Jun 2011 09:48:46 +0000]
libafscp: fix install/dest in sep. Objectdir

When compiling libafscp in separate objdir,
make dest and make install fail, because of wrong
pathes. Fix it.

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

12 years agoPort cache manager to NetBSD-5 and NetBSD-current
Jonathan A. Kollasch [Mon, 16 May 2011 14:30:24 +0000]
Port cache manager to NetBSD-5 and NetBSD-current

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

12 years agomacos: bulkstat sysctl
Derrick Brashear [Thu, 26 May 2011 06:04:08 +0000]
macos: bulkstat sysctl

make bulkstat enable/disableable via sysctl

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

12 years agomake bozo honor -rxbind correctly
Adam Megacz [Fri, 23 Mar 2007 19:14:41 +0000]
make bozo honor -rxbind correctly

Bozo needs to call rxInitHost() rather than rxInit() when -rxbind is
present. This patch causes it to read NetInfo/NetRestrict earlier in
the startup process so it can make that decision.

FIXES 57286

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

12 years agomacos: bulkstat caller reference handling
Derrick Brashear [Thu, 26 May 2011 05:39:18 +0000]
macos: bulkstat caller reference handling

if bulkstat is called and fakes up vnodes for non-dir cases, it can
guess wrong, and we end up needing to fix up the type by swapping
in a new vnode under the vcache. however, references are tracked on
the vnode, and more importantly, callers can know about the vnode;
unlinking a vcache from a vnode leaves null pointers to blow up on.

thing is, we shouldn't end up with a un-fixed-up vcache in use:
any caller of ProcessFS will notice if the vnode is the wrong type,
and fix it. so in order to reach CStatd, we have to fix it.
the only places where we can get a vcache in use not CStatd are:
FindVCache, LookupVCache, GetVCache where InReadDir. The last happens
only on Linux. LookupVCache doesn't happen anywhere that matters
(CForeign, or we immediately dispose...). FindVCache is only called
somewhere which won't lead to us fixing up during create, but that
vnode isn't returned to callers; we finalize in the result of create
and return the vnode that's linked to the vcache, which will be correct.

so, the only other place we can have a reference which won't immediately
get fixed up is in lookup, across the bulkstat call. if that's true,
and we return from bulkstat a non-CStatd vcache, lookup will fill in the
entry manually. so, if there are references remaining after we do a fixup,
unmark CStatd so the caller (presumably lookup, given the above) will give
back the vcache and retry, getting a corrected vnode as a result, with
the reference on the vnode we want it on.

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

12 years agolinux: add read_descriptor_t configure test and ifdef
Christof Hanke [Thu, 26 May 2011 05:46:32 +0000]
linux: add read_descriptor_t configure test and ifdef

With linux 2.6.8 the struct read_descriptor_t changed.
Add a configure-test and respective ifdef to deal with that.

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

12 years agoautoconf: add test for typedef'd structs
Christof Hanke [Wed, 25 May 2011 20:16:59 +0000]
autoconf: add test for typedef'd structs

AC_CHECK_LINUX_STRUCT does not work for structs which are typedef'd.
The gcc will complain with "error: storage size of ‘_test’ isn’t known"
and fail the test.
Thus the new test-macro AC_CHECK_LINUX_TYPED_STRUCT.

Change-Id: Ib3e933c4e09a3e950ca8d8e7a66909d86f10cfdf
Reviewed-on: http://gerrit.openafs.org/4718
Reviewed-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoFBSD: VIMAGE support
Ben Kaduk [Thu, 26 May 2011 05:11:14 +0000]
FBSD: VIMAGE support

Starting in FreeBSD 8.0, there is support for multiple virtual
network stacks (generally to be exposed to separate jail(8) environments).
It is enabled as a kernel configuration option, so our builds against
GENERIC have not failed, but we fail to build when options VIMAGE
is present.  Fix our variable references accordingly.

Change-Id: I679361b8ea62b0eae90c0aa61287dfc2dd189481
Submitted-by: Hiroki Sato of freebsd.org
Reviewed-on: http://gerrit.openafs.org/4721
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agotests: Make -flag the first parm in command-t
Andrew Deason [Mon, 23 May 2011 22:04:20 +0000]
tests: Make -flag the first parm in command-t

Move the -flag parameter to be the first parameter, to test more of
the positional argument handling.

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

12 years agotests: Use symbolic constants in command-t
Andrew Deason [Mon, 23 May 2011 21:51:59 +0000]
tests: Use symbolic constants in command-t

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

12 years agotests: Correctly pass string args in superuser-t
Andrew Deason [Mon, 23 May 2011 20:42:10 +0000]
tests: Correctly pass string args in superuser-t

We need to give a NULL pointer for string OUT arguments, so XDR knows
to allocate a new string. Also free the string each time so it gets
set back to NULL.

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

12 years agocmd: Add cmd_OptionAsUint
Simon Wilkinson [Mon, 25 Apr 2011 13:35:56 +0000]
cmd: Add cmd_OptionAsUint

Add an accessor function which can return a unsigned int for an
option value.

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

12 years agocmd: Fix parsing positional args
Andrew Deason [Mon, 23 May 2011 22:11:28 +0000]
cmd: Fix parsing positional args

If the first parameter of a libcmd syntax is a flag, cmd_Parse was
skipping over positional arguments, since j will be 0 at this point
(the j variable is only used if we're processing an explicit switch).
Effectively revert this area to what it was before
a2f1ca5fd52ac2fb7e68b101bbe3da9878c10474 so such positional parameters
work again.

Also move the j variable to inside the only block in which it is used,
to try and avoid such mistakes in the future.

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

12 years agoWindows: ChangeLog for 1.5.9906 (1.6.0pre6)
Jeffrey Altman [Mon, 23 May 2011 17:26:20 +0000]
Windows: ChangeLog for 1.5.9906 (1.6.0pre6)

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

12 years agoReplace uintptr_t type cast with uintptrsz in afs_vcache.c
Antoine Verheijen [Tue, 17 May 2011 15:40:15 +0000]
Replace uintptr_t type cast with uintptrsz in afs_vcache.c

A recent change (commit 80fe111f0044aa7a67215ad92210dc72cb7eb2c0)
to afs_vcache.c contains a call to afs_warn() whose second parameter
contains a "(uintptr_t)" type cast as part of a double type cast.
This presents an issue on some systems, such as OpenBSD, where this
object type is defined in a header that is not presently included.
This change modifies that type cast to instead use the AFS-internal
"(uintptrsz)" type which should provide the same effect.

Note that an earlier version of this patch ateempted to remove the
"offending" type cast as redundant but it was pointed out that some
systems require this kind of cascading type cast when casting pointers
to integers to deal with possible size issues.

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

12 years agocmd: Include aliases in help output
Simon Wilkinson [Sun, 24 Apr 2011 19:28:02 +0000]
cmd: Include aliases in help output

Include any command aliases in the output from the -help option

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

12 years agovolinfo: print namei filenames of index files
Michael Meffie [Sun, 22 May 2011 00:56:23 +0000]
volinfo: print namei filenames of index files

On namei fileservers, also print the namei filenames of the volume special
files when the -header flag is given.

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

12 years agovolinfo: remove code duplication in HandleVolumes
Michael Meffie [Sat, 21 May 2011 16:06:43 +0000]
volinfo: remove code duplication in HandleVolumes

Reduce duplicate code for processing volume header files when printing header
details (-header) and calculating the volume size (-sizeOnly).

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

12 years agovolinfo: fix volume aux totals output
Michael Meffie [Sat, 21 May 2011 16:38:03 +0000]
volinfo: fix volume aux totals output

Do not print the volumes aux totals prematurely when running
volinfo with the -headers flag on an namei fileserver. Instead
print the aux totals only once after the link table size is found.

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

12 years agovolinfo: print errors to stderr
Michael Meffie [Sat, 21 May 2011 11:28:41 +0000]
volinfo: print errors to stderr

Print volinfo errors messages to stderr instead of a mix of stdout
and stderr. Print a consistent program name.

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

12 years agovolinfo: fix size totals when saving inodes
Michael Meffie [Fri, 20 May 2011 18:44:39 +0000]
volinfo: fix size totals when saving inodes

Fix the volume size calculation when volinfo is invoked with
both -sizeOnly and -saveinodes at the same time.

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

12 years agodoc: document volinfo -filenames option
Michael Meffie [Fri, 20 May 2011 17:53:48 +0000]
doc: document volinfo -filenames option

Add the namei -filenames option to the volinfo man page.

Note this option as implemented implies the -vnode flag, but for
consistency with the other fields that modify the default mode
output, it is documented to be accompany the -vnode flag.

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

12 years agoAdded -dryrun
Jeff Blaine [Thu, 19 May 2011 03:49:52 +0000]
Added -dryrun

Added missing information about -dryrun option

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

12 years agovolinfo: fix -filenames option check
Michael Meffie [Wed, 18 May 2011 17:42:27 +0000]
volinfo: fix -filenames option check

Fix the logic for checking the presense of the volinfo -filenames
option.  The original patch inadvertently added the -filenames
check as an if-else cause to the -orphaned flag check, which
prevents filenames from being printed when listing orphaned
vnodes.

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

12 years agomacos: bulkstat redux
Derrick Brashear [Fri, 20 May 2011 18:13:01 +0000]
macos: bulkstat redux

simplify the logic which can require sleeps in various vcache
resolution paths. instead of the two-pass system we had before,
just guess using the even/odd hack what type a vnode will be.
if a vnode turns out to be a link and thus we are wrong, we
do a fixup later. other callers who "race" with bulkstat
(which is a supported feature, otherwise you'd have to block
callbacks) will also call through a fixup to get the correct
backing vnode type. this is necessary as the KPI doesn't
let us change the type of a vnode after it's been created.

side effect: eliminate many of the ugly cases where we had been
sleeping waiting for a vnode to be finalized even before bulkstat.

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

12 years agodynroot: mark vnode types on dynroot vnodes
Derrick Brashear [Fri, 20 May 2011 18:10:49 +0000]
dynroot: mark vnode types on dynroot vnodes

when we create a vnode using a dynroot fid, we weren't bothering
to update the type from the default (typically VREG); most
dynroot vnodes are actually VDIR...

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

12 years agoSOLARIS: Reset syscalls on mod_install failure
Andrew Deason [Thu, 19 May 2011 22:02:35 +0000]
SOLARIS: Reset syscalls on mod_install failure

If our call to mod_install fails for any reason (for example, if the
afs entry is missing from /etc/name_to_sysnum), we may still have set
the sysent structures for setgroups and ioctl to point at libafs code.
So calls to those syscalls will cause a panic, since the code they
point to is no longer loaded.

To avoid this, just reset the sysent entries back to what they were if
we fail to load, just like we do when unloading the module.

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

12 years agolibafs: Implement unixuser RW locks
Andrew Deason [Thu, 5 May 2011 20:10:54 +0000]
libafs: Implement unixuser RW locks

Currently code dealing with changing unixuser structs does not obtain
any locks protecting the contents of the unixuser struct, though some
functions like afs_GetUser have a parameter indicating what type of
lock should be obtained. This can result in the token data for a user
being changed at the same time another thread tries to use the token
data.

To ensure mutual exclusion of such operations, add a lock field to the
unixuser struct, and actually lock it according to the intentions of
the relevant code.

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

12 years agolibafs: Always use anonymous VL connections
Andrew Deason [Mon, 16 May 2011 18:45:49 +0000]
libafs: Always use anonymous VL connections

afs_NewVolumeByName was using the areq given by the caller for
afs_SetupVolume, which may represent authenticated credentials. Give
afs_SetupVolume &treq instead, which will be anonymous, so we don't
have to deal with rxkad for VL lookups.

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

12 years agoHide -noexecute in favor of -dryrun
Jeff Blaine [Thu, 19 May 2011 01:46:52 +0000]
Hide -noexecute in favor of -dryrun

Makes all previous -noexecute arguments hidden (still callable)
and replaces them with -dryrun whose help text has been made
common where appropriate instead of the 3 previous ways the
argument was explained.

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

12 years agoauth: failback to afs3-vlserver for afs3-prserver
Jeffrey Altman [Wed, 18 May 2011 17:51:53 +0000]
auth: failback to afs3-vlserver for afs3-prserver

If the DNS SRV lookup is for afs3-prserver or afs3-kaserver,
fallback to a lookup for afs3-vlserver since those services
are traditionally hosted on the same machine as the vlserver.

FIXES 129887

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

12 years agoWindows: lock protected fields must be 32-bit
Jeffrey Altman [Mon, 16 May 2011 01:56:17 +0000]
Windows: lock protected fields must be 32-bit

It is not safe to protect two 16-bit fields in a structure
with different locks.  Switch to using 32-bit fields.

Increment the cm-memmap version number since the data structure
sizes changed and the cache file must be invalidated.

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

12 years agoWindows: add lock assertions to cm_buf.c
Jeffrey Altman [Mon, 16 May 2011 01:53:56 +0000]
Windows: add lock assertions to cm_buf.c

add lock assertions to cm_buf.c in hopes of detecting why
periodic buf_scacheHashTable corruption is being detected.

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

12 years agoWindows: test return from krb5_cc_start_seq_get
Jeffrey Altman [Mon, 16 May 2011 01:51:14 +0000]
Windows: test return from krb5_cc_start_seq_get

If krb5_cc_start_get fails when using Heimdal, the cursor
is invalid and it is not safe to pass it into subsequent
functions.

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