openafs.git
12 years agorx: prevent connection channel assignment race
Jeffrey Altman [Sun, 10 Jul 2011 02:43:45 +0000]
rx: prevent connection channel assignment race

When rx was converted to use pthreads, the code that allocates
a call to a connection channel in rxi_ReceivePacket() was not
made thread safe.  The code prior to this patchset permitted a race
in the server connection case.  The rx_connection channel assignment
in rxi_ReceivePacket() and the call destruction in rxi_FreeCall()
and rxi_DestroyConnectionNoLock() did not consistently protect the
rx_connection channel array using the conn_call_lock.

This race could result in rxi_ReceivePacket() operating on a
rx_call which was disconnected from the previously assigned
rx_connection.

In addition, the code in rxi_ReceivePacket() that was intended
to protect the allocation of a call using rxi_NewCall() to the
connection channel array was racy with itself.

This patchset consistently applies the conn_call_lock to protect
the allocation / deallocation of calls to the connection channel
array and in the process simplifies the logic in rxi_ReceivePacket()
as it is no longer necessary to protect against a null call pointer
since the race can no longer be lost.

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

12 years agowindows: include cmp_Cmd_Ref_3_en_US component
Jeffrey Altman [Sat, 9 Jul 2011 14:29:05 +0000]
windows: include cmp_Cmd_Ref_3_en_US component

when building installers actually include the html 3 man pages

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

12 years agoWindows: out of order lock smb v3 locking
Jeffrey Altman [Fri, 8 Jul 2011 19:27:22 +0000]
Windows: out of order lock smb v3 locking

Do not obtain the smb_rctLock after holding the cm_scache_t->rw
lock.

At most one hold is required in case of lock failure.  Obtain
it as the start of processing and drop it at the end if not required.

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

12 years agoAdd AFS::ukernel libuafs perl bindings
Andrew Deason [Fri, 14 Aug 2009 21:32:54 +0000]
Add AFS::ukernel libuafs perl bindings

Add the SWIG-generated AFS::ukernel perl module, which provides perl
bindings to libuafs calls.

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

12 years agoAdd afsload
Andrew Deason [Fri, 21 Jan 2011 23:38:24 +0000]
Add afsload

Add afsload, a set of scripts used to synchronize the activity of
numerous libuafs cache managers for testing/simulation purposes.

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

12 years agodoc: Add support for section 3 man pages
Andrew Deason [Fri, 4 Feb 2011 22:23:30 +0000]
doc: Add support for section 3 man pages

Generate and install man pages (and their HTML versions) for library
reference documentation in section 3.

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

12 years agoAdd documentation for AFS::ukernel
Andrew Deason [Tue, 22 Sep 2009 20:45:09 +0000]
Add documentation for AFS::ukernel

Add some documentation explaining some of the minor quirks in
AFS::ukernel; specifically how some functions look a bit different
than in plain libuafs.

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

12 years agoWindows: Improve logging for StoreMini and cm_BufWrite
Jeffrey Altman [Wed, 6 Jul 2011 22:37:02 +0000]
Windows: Improve logging for StoreMini and cm_BufWrite

Add trace logging to cm_StoreMini which never had it before.

Improve the logging of cm_BufWrite by adding the trucPos value
which is the new length of the file that is being reported to
the file server.

Remove cm_buf_t data references when cm_BufWrite is performing
operations using rx_Writev and iovec structures.

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

12 years agoWindows: Refactor cm_Unlock*() to avoid code duplication
Jeffrey Altman [Wed, 6 Jul 2011 22:34:05 +0000]
Windows: Refactor cm_Unlock*() to avoid code duplication

cm_Unlock() and cm_UnlockByKey() duplicate a significant amount
of code.  Refactor it into a new static function, cm_IntUnlock()
which handles the process of downgrading or releasing a file
server lock depending upon the lock state of the cm_scache_t
object.

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

12 years agoWindows: Do not probe new servers from cm_UpdateVolumeLocation
Jeffrey Altman [Wed, 6 Jul 2011 22:19:31 +0000]
Windows: Do not probe new servers from cm_UpdateVolumeLocation

cm_NewServer() can result in a call to cm_UpdateVolumeLocation()
if a server probe is performed.   In order to avoid recursive
calls to cm_UpdateVolumeLocation() do not probe new servers from
within cm_UpdateVolumeLocation().

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

12 years agoafs: Use 64-bit inode numbers
Andrew Deason [Wed, 6 Jul 2011 20:22:38 +0000]
afs: Use 64-bit inode numbers

When we have a 64-bit ino_t, use the full 64 bits, instead of always
limiting ourselves to 32 bits.

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

12 years agoafs: Consolidate afs_calc_inum
Andrew Deason [Wed, 6 Jul 2011 19:21:53 +0000]
afs: Consolidate afs_calc_inum

Instead of having two separate afs_calc_inum functions, just have one
afs_calc_inum, and split off the md5 inode code into its own function
under a LINUX20 ifdef.

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

12 years agoafs: Use afs_calc_inum everywhere
Andrew Deason [Wed, 6 Jul 2011 21:23:23 +0000]
afs: Use afs_calc_inum everywhere

The algorithm for calculating inode numbers was copied in several
places in libafs. Make them all use afs_calc_inum instead.

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

12 years agoafs: Use cell for md5 inode numbers
Andrew Deason [Wed, 22 Jun 2011 19:39:39 +0000]
afs: Use cell for md5 inode numbers

When calculating the inode number for a file with md5 inodes, include
the cell number in the calculation, in order to reduce collisions
between cells.

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

12 years agouss: Suppress more warnings from lex.yy.c
Andrew Deason [Tue, 5 Jul 2011 22:13:57 +0000]
uss: Suppress more warnings from lex.yy.c

Specify -Wold-style-definition when compiling lex.yy.c. This allows us
to compile when --enable-checking is specified and our lex generates
code with old-style function definitions.

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

12 years agoafs: Ensure afs_calc_inum yields nonzero ino
Andrew Deason [Wed, 22 Jun 2011 18:44:38 +0000]
afs: Ensure afs_calc_inum yields nonzero ino

afs_calc_inum can currently yield an inode of 0 if MD5-based inode
numbers are turned on. Some userspace applications (and for some
platforms, maybe even the kernel) make certain assumptions about the
inode number for a file; in particular for example, 'ls' will not
display a file with inode 0 in a normal directory listing.

So, read the md5 digest until we get a non-zero result. Fall back to
the non-md5 calculation if we still somehow end up with a 0.

While this case may at first glance seem to be extremely rare, in
practice it can occur, as the current calculation for volume
538313506, vnode 26178 does actually yield a 0.

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

12 years agoTreat Linux 3 as Linux 2.6
Anders Kaseorg [Tue, 14 Jun 2011 19:24:42 +0000]
Treat Linux 3 as Linux 2.6

Linux 3.0 is just a rebranded Linux 2.6.40, so we can use the same
sysname and the same code.

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

12 years agoAdd a few missing .gitignore entries
Andrew Deason [Wed, 6 Jul 2011 17:33:53 +0000]
Add a few missing .gitignore entries

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

12 years agovol: Don't always FDH_REALLYCLOSE on linktable ops
Andrew Deason [Fri, 1 Jul 2011 21:58:06 +0000]
vol: Don't always FDH_REALLYCLOSE on linktable ops

If we dec a linktable entry or get a free tag from the link table,
there is no reason to FDH_REALLYCLOSE the linktable fd handle.
FDH_REALLYCLOSE is the same as FDH_CLOSE, except that it tells the
ihandle package that the file handle will not be used again soon. If
we dec a linktable entry or get a free tag, there is no reason to
think that, so just FDH_CLOSE the handle instead.

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

12 years agoDAFS: Do not clear salv state on fssync salvage
Andrew Deason [Fri, 1 Jul 2011 19:25:05 +0000]
DAFS: Do not clear salv state on fssync salvage

When a volume is put into an error state via the FSYNC_VOL_FORCE_ERROR
command, we clear the salvage state informaton on it, since we're
forcing it offline and thus inaccessible. However, if we are forcing
it to an error state because the volume needs salvaging, we just
salvage it. In this case, do not clear the salvage state, since we
need to know if we've already requested or scheduled a salvage so we
can correctly keep track of the number of salvages performed.

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

12 years agodoc: epub and mobi support
chas williams - CONTRACTOR [Wed, 8 Jun 2011 14:44:21 +0000]
doc: epub and mobi support

.epub is generated using dbtoepub which is still considered alpha
software apparently and installed in a non-standard place.  for now,
use the docbook stylesheet location to find it.  .mobi is generated
using kindlegen from the .epub in order to have a real toc.

there is some preprocessing with a custom stylesheet to make
things "look right".  see mobi-fixup.xsl.in

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

12 years agoSOLARIS: Granular multiPage detection
Andrew Deason [Wed, 29 Jun 2011 18:51:22 +0000]
SOLARIS: Granular multiPage detection

Currently, a struct vcache has a multiPage counter, indicating how
many afs_getpage requests are in-flight for that vcache that involve
retrieving multiple pages. Any dcache associated with such vcaches are
then avoided when choosing dcache entries to evict from the cache,
since we may deadlock when trying to evict a dcache entry from one of
the earlier afs_GetOnePage calls in a particular afs_getpage request.

This behavior can cause the client to become unusable if the cache
becomes full, and the only items in the cache are dcache entries in a
file that has an in-flight multi-page afs_getpage request. Since, in
that case, we cannot kick out any entries from the cache, and so we
wait forever to wait for the cache utilization to go down.

To prevent this from occurring, record exactly which ranges in the
file have in-flight multi-page afs_getpage requests, and just avoid
dcache entries in those ranges. This way afs_GetDownD can evict dcache
entries in the same file, but still avoid entries that would cause a
deadlock.

Also add some comments explaining this situation a bit more.

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

12 years agoRemove nonsensical bozon-lock defines
Andrew Deason [Fri, 24 Jun 2011 21:23:13 +0000]
Remove nonsensical bozon-lock defines

Currently there are two preprocessor defines related to bozon locks:
AFS_BOZONLOCK_ENV, and AFS_NOBOZO_LOCK. The former creates the pvnLock
member of a struct vcache, and controls calls to e.g. afs_BozonLock in
cross-platform code. The latter, if defined, turns calls to e.g.
afs_BozonLock into no-ops.

It doesn't make any sense to have both of these, since if
AFS_BOZONLOCK_ENV and AFS_NOBOZO_LOCK are defined, the pvnLock member
exists but is never used, since afs_BozonLock &co are no-ops. On
Solaris, the only platform where AFS_NOBOZO_LOCK is currently defined
(DUX used to define it before DUX was dropped), this is the case.

So to make things a bit more clear, get rid of the AFS_NOBOZO_LOCK
define, and just use AFS_BOZONLOCK_ENV to dictate whether we do
anything with bozon locks (ppc_darwin_80 appears to be the only
platform at this time).

Remove AFS_BOZONLOCK_ENV from Solaris param files, since it doesn't
use bozon locks. Remove all references to pvnLock in Solaris-specific
code.

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

12 years agoRemove support for Solaris pre-8
Andrew Deason [Fri, 24 Jun 2011 20:25:46 +0000]
Remove support for Solaris pre-8

Remove support for all Solaris and SunOS platforms prior to Solaris 8,
since Solaris 7 reached end-of-life in August of 2008. Remove all
non-documentation references to sunx86_57 and earlier, sun4x_57 and
earlier, and AFS_SUN57_ENV and earlier.

References to AFS_SUN58_ENV have been changed to AFS_SUN5_ENV where
appropriate, and AFS_SUN5_ENV now implies Solaris 8.
AFS_SUN57_64BIT_ENV has been renamed to AFS_SUN5_64BIT_ENV.

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

12 years agoChange wiki ref to wiki.openafs.org from stanford.edu
Jeff Blaine [Wed, 29 Jun 2011 02:58:29 +0000]
Change wiki ref to wiki.openafs.org from stanford.edu

Change wiki ref to wiki.openafs.org from stanford.edu

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

12 years agoIntroduce TAP tests of man pages for command_subcommand
Jeff Blaine [Thu, 16 Jun 2011 23:58:49 +0000]
Introduce TAP tests of man pages for command_subcommand

Introduces the first batch of man page testing as part of
the TAP tests.  We would like to fail, for example, when
someone has added a new command to vos but not AHEM documented
it.

For now, the tests consist of checking to ensure that for
every subcommand listed in the output of "command help"
(e.g. vos help), fail the test if there is not a man page
for those (e.g. vos_delentry.1 etc).

Copy any of the -man-t tests and edit to make a new one

All tests make use of a simple new Perl library stored
in tests-lib/perl5 (a new area, not just named 'lib'
because I didn't want it to be confused with a s test
for a 'lib' in the src).

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

12 years agoStyling tweak for generated HTML man pages
Jeff Blaine [Fri, 17 Jun 2011 21:24:54 +0000]
Styling tweak for generated HTML man pages

Prefer "Georgia" as a typeface over the less readable
Times New Roman, but with Times New Roman then "serif"
as fallbacks.  Georgia is available everywhere.

Provide 10px top/bottom and 30px left/right margin on
the main body for readability.  Margins are good.

For review:

Old:
http://docs.openafs.org/Reference/8/kas_apropos.html
New:
http://kickflop.net/openafs-man-20110617/kas_apropos.html

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

12 years agorx: race in rx_multi processing
Jeffrey Altman [Tue, 28 Jun 2011 13:35:02 +0000]
rx: race in rx_multi processing

multi_Init() registers an arrival procedure which is called when
the first response packet for the call arrives.  If the call times
out the multi_Body loop will call rx_EndCall() and then set
multi_h->calls[multi_i] to NULL.  If the first data packet of the
call arrives before rx_EndCall() is executed, then the arrival
procedure, multi_Ready(), will be executed adding the call to the
firstNotReady list.  When the multi_Body loop attempts to process
the call from the firstNotReady list it attempts to dereference
the NULL multi_call.  This race was introduced by
be4abb4ec83a47477b254f2b3375742c4efbb063.

multi_h->calls[multi_i] is set to NULL as an indicator to
multi_Finalize() that rx_EndCall() has already been processed
for the call.  When rx_EndCall() is executed the arrival
procedure is cleared.

If rx_EndCall() has already been processed, the fact that
the arrival procedure has been executed must be ignored.  Add
an additional check in multi_Body for a non-NULL call pointer
to skip the startProc and rx_FlushWrite processing on the
no longer existent call.

Note that it is not safe to hold onto the call reference after
rx_EndCall() has been processed since the call slot may be
reused for a new RPC before the multi processing on all calls
is complete.

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

12 years agoChange -n to -dryrun for backup subcommands
Jeff Blaine [Thu, 9 Jun 2011 00:56:46 +0000]
Change -n to -dryrun for backup subcommands

Change -n to -dryrun for "don't do it, show it though" operation
to be in line with agreement on -dryrun in place of -noexecute
or -n.  Updated man page POD sources to reflect the changes
and updated README to remove these specific todo line items.

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

12 years agovos: refactor ListAddrs
Jeffrey Altman [Mon, 30 May 2011 04:15:43 +0000]
vos: refactor ListAddrs

refactor ListAddrs to be more readable.   Clarify that -uuid and
-host cannot be issued at the same time.  Rename 'nentries' to
'max_index' so it is clear that ubik_VL_GetAddrs() is issued
to set an upper-bound for the number of subsequent ubik_VL_GetAddrsU()
calls that are issued when neither -host nor -uuid are specified.

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

12 years agoWindows: MergeStatus before SyncOpDone
Jeffrey Altman [Mon, 27 Jun 2011 13:31:54 +0000]
Windows: MergeStatus before SyncOpDone

cm_SyncOp/cm_SyncOpDone is used to synchronize the RPC processing
to ensure that calls which are in conflict cannot occur at the
same time but also to ensure that the ordering of operations
is consistent.  cm_MergeStatus() was in many cases executed after
cm_SyncOpDone() removed the synchronization barrier which in turn
permitted status information to be applied out of order.  Side
effects could have included data loss due to client side file
truncation.  More commonly two StoreData RPCs would have their
status information applied out of order forcing the cache manager
to invalidate all of the cached data for the file.

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

12 years agoWindows: TRANS2_FIND_FIRST2 for _._AFS_IOCTL_._
Jeffrey Altman [Thu, 23 Jun 2011 21:51:22 +0000]
Windows: TRANS2_FIND_FIRST2 for _._AFS_IOCTL_._

smb_T2SearchDirSingle() must not fail directory search requests
for the _._AFS_IOCTL_._ file.  Although this file does not actually
exist, it is successfully processed by CreateFile operations.
Therefore, an explicit search for it should return a valid answer.

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

12 years agoWindows: Fix SMB_COM_NEGOTIATE for MS11-043
Jeffrey Altman [Fri, 24 Jun 2011 03:49:32 +0000]
Windows: Fix SMB_COM_NEGOTIATE for MS11-043

MS11-043 adds response validation for SMB_COM_NEGOTIATE messages
received by the SMB Redirector.  OpenAFS failed to properly specify
a Challenge and DomainName in the response when the security mode
is SMB_AUTH_NONE (or share with password).  This patchset corrects
smb_ReceiveNegotiate() so that it adheres to the protocol specification.

FIXES 130033

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

12 years agoRevert "Rx: When call receive is done, send ack all packet"
Jeffrey Altman [Thu, 30 Sep 2010 14:48:58 +0000]
Revert "Rx: When call receive is done, send ack all packet"

This reverts commit 3cd3715e608b801b4848399e42cb47464e6e3cc3,
which replaces an ack with an ackall; ackall processing does
not actually mark all packets acked when it is received, so
it is insufficient.

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

12 years agodoc: fix dependencies
chas williams - CONTRACTOR [Wed, 8 Jun 2011 13:42:47 +0000]
doc: fix dependencies

index.html might not be built if you are building anything other than
the html/chunk.xsl but in general this is better than before.

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

12 years agodoc: prefer fop to generate pdf from docbook
chas williams - CONTRACTOR [Wed, 8 Jun 2011 13:40:17 +0000]
doc: prefer fop to generate pdf from docbook

It would seem xsltproc -> fop -> pdf is the "modern" way to generate
pdf from docbook now.  The hard part is finding the stylesheets.
This should work for fedora, sles and debian.  Additionally, it brings
some consistency--xsltproc for all the conversions.  You can still
override via configure options if you prefer something else.

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

12 years agodoc: fix some broken link specifications
Chas Williams (CONTRACTOR) [Fri, 10 Jun 2011 01:14:05 +0000]
doc: fix some broken link specifications

"local" links to section heads inside the same pod page should be written
L</OPTIONS> instead of L<OPTIONS>.  the other broken links are assorted
typos and capitalization changes.

Change-Id: I18b57a81d984501309e96dcd4c04582e744a6db2
Reviewed-on: http://gerrit.openafs.org/4831
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Ken Dreyer <kdreyer@usgs.gov>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

12 years agoroken: add search.h to .gitignore
Jeffrey Altman [Sun, 12 Jun 2011 06:27:10 +0000]
roken: add search.h to .gitignore

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

12 years agoDAFS: Do not attach a specialStatus'd vol
Andrew Deason [Tue, 21 Jun 2011 21:25:14 +0000]
DAFS: Do not attach a specialStatus'd vol

If we encounter a preattached volume during GetVolume, we currently
ignore vp->specialStatus before trying to attach. However, we will
generally always fail to attach due to a conflicting vol op, but even
if we don't, GetVolume always returns an error later on if
vp->specialStatus is set. So, same some processing and attempted
attachments by bailing out sooner if vp->specialStatus is set.

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

12 years agosalvager: Clear summary in RecordHeader
Andrew Deason [Tue, 21 Jun 2011 23:08:21 +0000]
salvager: Clear summary in RecordHeader

Not every field in the summary header in RecordHeader is set, leaving
some used uninitialized when we copy to the given volumeSummaryp (like
'deleted'). Zero out the header before we do anything.

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

12 years agoBuild a separate copy of vlib for dasalvager
Andrew Deason [Tue, 21 Jun 2011 22:51:32 +0000]
Build a separate copy of vlib for dasalvager

Currently dasalvager links to vlib.a. But vlib.a is built without any
DAFS defines, and so the size of a struct DiskPartition64 is different
(since dasalvager is built with AFS_DEMAND_ATTACH_UTIL). Build our own
copies of the volume package files instead, with
AFS_DEMAND_ATTACH_UTIL defined.

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

12 years agodir: Remove extraneous printf from Create
Andrew Deason [Tue, 21 Jun 2011 23:34:46 +0000]
dir: Remove extraneous printf from Create

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

12 years agodir: Fix DRead
Andrew Deason [Tue, 21 Jun 2011 23:33:16 +0000]
dir: Fix DRead

DRead was missing a return statement in one of the cases where we
found the buffer we were looking for, so we locked the buffer but kept
looking. Return it instead.

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

12 years agovol: Do not overwrite specialStatus in attach2
Andrew Deason [Tue, 21 Jun 2011 19:58:42 +0000]
vol: Do not overwrite specialStatus in attach2

attach2 wants to set specialStatus to VBUSY in certain conditions
(such as, it discovers a conflicting vol op where VVolOpSetVBusy_r is
true). However, specialStatus may already be set to something else,
like VMOVED if the volume is being moved off of the server. This can
happen if the volserver has checked out and FSYNC_VOL_MOVE'd a
preattached volume but hasn't deleted or checked the volume back in
yet.

So, if specialStatus is already set, don't touch it, so we don't start
reporting VBUSY errors to clients when we should be reporting VMOVED,
or some other error code previously set.

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

12 years agorx: Exit fast restart on non-duplicate ACK
Simon Wilkinson [Sat, 18 Jun 2011 14:50:08 +0000]
rx: Exit fast restart on non-duplicate ACK

The current code only exits fast restart when we receive an ACK
packet that contains no missing chunks at all. On a network that is
dropping a reasonable chunk of its packets, this means that we spend
most of the call in fast recovery. (I originally found this by running
with the intentionally drop packets feature set to 10%)

TCP's fast retransmit behaviour is that we stay in fast recovery until
we receive our first non-duplicate acknowledgement. In TCP that means an
acknowledgement that moves the window. In RX, it is an acknowledgment
that ACKs a new packet.

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

12 years agorx: Don't limit the # of packets sent in recovery
Simon Wilkinson [Sat, 18 Jun 2011 12:17:07 +0000]
rx: Don't limit the # of packets sent in recovery

The RX transmit engine limits the number of packets sent whilst in
loss recovery to one per invocation of the transmit engine. As the
engine cannot be called by the application thread whilst in recovery,
this means that we end up being limited to one packet per ACK received,
which means that despite a growing congestion window we'll only send
one packet per RTT (in effect, a congenstion window of 1).

This will remain the case until we exit recovery, and all of a sudden
can send a large number of packets. If this is larger than the current
capacity of the network, we'll probably end straight back in recovery
again.

Let the congestion window do its job, by removing this arbitrary limit.

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

12 years agorx: Don't wait for TQ busy when entering recovery
Simon Wilkinson [Sat, 18 Jun 2011 12:01:35 +0000]
rx: Don't wait for TQ busy when entering recovery

Two different threads can cause a call to enter recovery. The event
thread will move a call into recovery as a result of a timeout, or
the listener thread will move it there following a fast retransmit.

In both of these cases, recovery looks different. In the case of
a timeout, we enter slow start, starting as if we were begininning
transmission for the first time. Following fast retransmit, we enter
fast recovery, with different starting parameters than those coming
from slow start.

As a reslt, the current behaviour, where either call sitting in
FAST_RECOVERY_WAIT causes the other to simply return is inappropriate.

Further investigation indiciates that FAST_RECOVER_WAIT is actually
uncessary. There is no harm caused to a thread which is currently
blocked on the network in the middle of a transmit, in adjusting the
window size underneath it. As both of these states collapse the window,
that thread will simply cease sending earlier.

So, simplify the code, and remove the potential race between event and
listener by removing the FAST_RECOVER_WAIT state.

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

12 years agorx: Enter loss recovery when we retransmit
Simon Wilkinson [Sat, 18 Jun 2011 11:43:44 +0000]
rx: Enter loss recovery when we retransmit

Since I mistakenly wrote commit 36e2d13b, RX hasn't entered congestion
avoidance when a loss event occurs. This is bad, because on todays
networks the majority of packet losses are due to some form of
congestion.

Now that the timeout code has been restructured, the chances of entering
the retransmit routine in error are much much smaller, so this code
needs to be restored.

This change reverts 36e2d13b55085c996d38b30d003296c602ef8ee3. However,
the original RX code has the problem that it assumes that all forms of
fast recovery are the same - in particular, that the call settings that
result from entering fast recovery due to a fast retransmit are
identical to those resulting from a timeout. This is not the case, and
this will be fixed in a later change.

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

12 years agorx: Add Karn-style backoffs to RX retransmits
Simon Wilkinson [Sat, 18 Jun 2011 10:58:57 +0000]
rx: Add Karn-style backoffs to RX retransmits

When we retransmit a packet, we may be doing so because the RTT of the
connection has grown dramatically larger than earlier within the call.
However, RX doesn't permit all ACKs to retransmitted packets to be
counted within the RTT calculation.

So, adopt the same approach as Karn developed for TCP, and as described
in detail in RFC2988. When a retransmit event occurs, backoff the
connection RTT by doubling its value, and hold at this doubled value
until either another retransmit occurs (in which case we back off again,
up to a predetermined ceiling), or we receive an ACK packet which we
can use within the RTT calculation, in which case we drop back down to
the newly measured value.

This change replaces the per-packet backoff strategy originally
implemented in RX (which, whilst allowing resent packets more chance of
arriving, doesn't help with computing a correct RTT).

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

12 years agorx: Make clock_Add correctly add to itself
Simon Wilkinson [Sat, 18 Jun 2011 10:48:45 +0000]
rx: Make clock_Add correctly add to itself

With the existing clock_Add code, the following:
    struct clock a = {2, 800000};
    clock_Add(&a, &a);
gives a clock value of {6, 600000}, rather than the expected {5, 60000}.

This is because the ordering of instructions leads it to double count
the carry on the seconds field. Reorder the instructions so that the
carry is correctly applied.

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

12 years agorx: Remove resending logic into its own function
Simon Wilkinson [Sat, 18 Jun 2011 10:35:30 +0000]
rx: Remove resending logic into its own function

Create a new function, rxi_Resend, which is the entry point to running
the transmit queue as a result of a resend event. This concentrates all
of the resend logic into one place, removes the need for
rxi_StartUnlocked, and means that rxi_Start's arguments don't need to
match those of an event handler.

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

12 years agorx: Change the way that the RTT timer is applied
Simon Wilkinson [Sat, 18 Jun 2011 09:46:53 +0000]
rx: Change the way that the RTT timer is applied

RX maintains a retryTime for every packet that it has transmitted,
which is held as the time that that packet was sent, plus the smoothed
RTT of the connection. If a packet is in the queue with a retryTime
older than the current time, then it is resent at the first opportunity.
In some circumstances, this first opportunity will be as a result of
the resend event timer expiring, in others it will happen as part of
a normal queue run.

There are a number of problems with this approach on congested networks.

Firstly, on a network with a large window size, which is in "normal"
flow, it means that we will never actually perform fast retransmit as
the timeout for this packet will have expired before we have received
any further ACKs. This is because, on a network with a relatively stable
RTT the ACK for packet n+1, n+2, or n+3 cannot arrive before the
expected time of arrival of the ACK for packet n. As we retry
immediately this expected time of arrival has passed, we never have the
opportunity of using these later ACKs to learn that packet n is lost.

Secondly, the fact that we may resend packets from a "normal" queue run,
rather than as a result of a resend event, means that there is no clear
entry point for resends. As resends should be assumed to be a result of
network congestion, and result in both the call throttling back, and the
RTT being increased, this lack of a clean entry point makes things
tricky.

As a solution, this patch changes the way in which retransmit times are
applied to use the algorithm described in RFC2988.

*) Whenever we send a new packet, we start a timer for the current call
   rto value if one isn't already running.
*) Whenever we receive an ACK that acknowledges new data, and we have
   packets that are sent but not yet acknowledged, we restart the
   retransmit timer using the current rto value.

This alogrithm solves the first problem, as it means that if the
connection is still flowing, we will continue to receive ACKs, and we
can enter fast retransmit.

In implementation terms, we longer track a retryTime per packet, and
instead simply record if a packet has been sent or not. Packets which
have been sent may only be resent as a result of a resend timer
expiring, or of entering fast retransmit, so solving the second issue.

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

12 years agorx: Compute smoothed RTT per call, not per peer.
Simon Wilkinson [Fri, 17 Jun 2011 21:06:54 +0000]
rx: Compute smoothed RTT per call, not per peer.

RX uses the TCP RTT smoothing algorithm as described in RFC2988.
However, the TCP algorithm is designed to accept samples from a
single connection, accepting a new sample once per RTT.
RFC2988 suggests that "when multiple samples are taken
per RTT the [ alogrithm ] may keep an inadequate RTT history."

In RX's implementation, we use a single instance of this alogrithm
per peer, and input all of the samples from all of the active calls
and connections into this same instance. This leads to us taking
a significantly (potentially many magnitudes) larger number of samples
per RTT, and rapidly losing the RTT history. With RX's implementation,
short lived network events may easily bias the RTT, and cause large
numbers of packets to time out.

This change fixes this by moving the RTT calculation onto a per call
basis. We still update the peer with our caclulated value, so that new
calls may be created with an RTT corresponding to the current value for
the connection, rather than having to start high and converge downwards.

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

12 years agorx: Make testclient build on Unix
Simon Wilkinson [Tue, 21 Jun 2011 08:34:50 +0000]
rx: Make testclient build on Unix

The "testclient" utility is built as part of the build on Windows.
Fix it so that it actually builds on Unix, so we can test changes to
testclient there.

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

12 years agorx: Reverse the consumption order of idle queue
Simon Wilkinson [Sat, 14 May 2011 07:55:50 +0000]
rx: Reverse the consumption order of idle queue

Currently, the rx server thread idle queue is used in an LRU manner.
This means that we round robin requests between all of the threads
configured on a given system, which means that we end up thrashing
CPU caches on machines whose workload doesn't require that all of
the configured threads be used.

Change this so that we always use the most recently idle thread. This
isn't as "fair" to all of our waiting threads, but should mean that we
scale better on SMP machines, as a thread that is recently idle is
likely to have been recently scheduled.

Performance numbers to follow ...

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

12 years agomacos: package shared libraries
Derrick Brashear [Mon, 20 Jun 2011 16:31:51 +0000]
macos: package shared libraries

include our shared libraries in the package when we have them

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

12 years agorx: Remove incorrect backoff code
Simon Wilkinson [Fri, 17 Jun 2011 19:35:59 +0000]
rx: Remove incorrect backoff code

The ACK packet handling routine contains code which causes the
RTT to backoff if the selective ACK response indicates that there is
a missing packet. The comment justifies this code as being in line
with Phil Karn's work on TCP.

However, the TCP behaviour is that we backoff when we enter resend. Both
TCP and RX have difficulty computing RTTs for resent packets due to the
ambiguous ACK problem. Whilst RX is slightly better than TCP in this
regard, we can't always tell whether an ACK refers to the original, or
resent packet, so resent packets are unable to contribute to the RTT.
This means that if the RTT ends up too low for the connection, and we
start resending every packet, the RTT will never grow to account for
this, as we never feed it any packet samples.

Karn's solution to this was to backoff (double) the RTT value when we
resend a packet, and then to not drop it back down until we receive an
ACK that we can count. This means that we will always get a new sample
for the connection, and the RTT will grow again.

The original author confirms that the current behaviour in RX is
incorrect, so simply remove it with this patchset.

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

12 years agorx: Account for delayed ACKS when computing RTO
Simon Wilkinson [Fri, 17 Jun 2011 18:38:29 +0000]
rx: Account for delayed ACKS when computing RTO

RX currently only soft ACKs every second packet, therefore a soft ACK
may be delayed by a period of time (currently 100ms, although RX did
expose this as a public variable in earlier versions).

RTT values are computed using only non-delayed ACKs, so the timeout
is a smoothed average of the exact time taken to send and directly
ACK a packet. Therefore, if the peer ends up using a delayed ACK for
the packet, using just the RTT will cause that packet to be timed out.

A while ago, this was dealt with by padding the calculated RTT with an
additional 350ms. This was then removed, and changed to a 350ms minimum
value. When this caused large numbers of spurious resends, the padding
was restored, but with a 20ms default value. As noted above, 20ms is
too low, as we may wait for up to 100ms before sending an ACK.

This patch changes minPeerTimeout so that it does what it says on
the tin - sets a minimum value below which the peer timout may not
fall. It then adds to either this value, or the calculated one, 200ms
of padding. This makes our padding identical to TCPs, and allows some
future leway as to the softAckDelay value.

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

12 years agorx: Make rx_softAckDelay & rx_lastAckDelay private
Simon Wilkinson [Fri, 17 Jun 2011 18:12:09 +0000]
rx: Make rx_softAckDelay & rx_lastAckDelay private

The values of these two parameters directly affect the modifiers
that are needed in the peer's RTT calculations, and so can not
arbitrarily be changed by applications.

lastAckDelay has been 400ms since the first OpenAFS release, and
that value is used as a modifier when computing the timeout of the
last packet. It is likely that any change which made this value
longer than 400ms would have detrimental effects on deployed clients

softAckDelay has been 100ms for a similar time period. We have
chopped and changed the value of minPeerTimeout, so it is unclear
what the maximal value for this parameter is. For much of OpenAFS's
life, minPeerTimeout was a 350ms padding value, which suggests that
copying TCP, and setting the maximal value at 200ms would be a safe
option. For now, however, leave it at 100ms to avoid unexpected
side effects.

hardAckDelay is not addressed by this patch set, as all ACK packets
sent from the application thread are marked as delayed, and so
currently have no part in computing RTT times. It is likely, however,
that any changes to the hard ACK timeout should be very carefully
considered.

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

12 years agoDocumented vos restore -creation and -lastupdate
Jeff Blaine [Sat, 18 Jun 2011 00:35:17 +0000]
Documented vos restore -creation and -lastupdate

Culled info from commit 21592fe6 by Kris Hees.  These allow
one to specify how to set the creation date and last update
date at volume restore.

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

12 years agoEnable -afsdb in the Red Hat packages.
Ken Dreyer [Wed, 15 Jun 2011 18:21:27 +0000]
Enable -afsdb in the Red Hat packages.

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

12 years agoFBSD: do not FlushAllVCaches
Ben Kaduk [Fri, 17 Jun 2011 06:22:34 +0000]
FBSD: do not FlushAllVCaches

In normal operation, any AFS vcache with associated data will have
an associated vnode, which will be on the list of vnodes associated
with the /afs mountpoint.  We already call FreeBSD's vflush() in
our afs_unmount, which walks the list of vnodes associated with the
mountpoint and calls vgonel() on them, which calls VOP_CLOSE and
VOP_RECLAIM on the vnode.  Our implementation of VOP_RECLAIM already
calls FlushVCache, so in normal operation, FlushAllVCaches() will
be a no-op.
However, in the presence of bugs, it is actively harmful, causing
panics.  For example, if a vnode has been reclaimed but FlushVCache
failed (which we cannot report back since the VFS will panic in this
case), and we attempt to flush it again, the associated vnode has
already been cleaned up and we will panic.  Likewise if our list of
vcaches becomes corrupt and has a vcache with bad or missing vnode
for some other reason, we will panic.

Since there is no gain in normal operation and abnormal operation
is more likely to panic than save data, skip the extra flush.

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

12 years agoFBSD: do not install kdump
Ben Kaduk [Fri, 17 Jun 2011 06:44:46 +0000]
FBSD: do not install kdump

Since it's just an empty file, installing it is rather silly.

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

12 years agoLinux: remove typedef from configure test comment
Marc Dionne [Sat, 11 Jun 2011 01:49:58 +0000]
Linux: remove typedef from configure test comment

Remove the "typedef" from the structure element configure test
comment.  The typedef version of the macro is used by the more
general element test, so the comment should be more general.
This affects comments in src/config/afsconfig.h

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

12 years agovolinfo: fix false good magic line
Michael Meffie [Tue, 7 Jun 2011 16:37:40 +0000]
volinfo: fix false good magic line

Fix false report of good magic/version numbers in volume
header file.

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

12 years agogenerated: take into account the things needed in master
Derrick Brashear [Fri, 10 Jun 2011 22:40:33 +0000]
generated: take into account the things needed in master

we need roken and hcrypto to build the bits we need to build the
compiler tools on master. do so.

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

12 years agorxkad ticket5 function rewriting
Derrick Brashear [Fri, 10 Jun 2011 22:33:30 +0000]
rxkad ticket5 function rewriting

avoid conflicting with heimdal in environments where we might
need bits of their asn1 library also

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

12 years agomore death to des
Derrick Brashear [Fri, 10 Jun 2011 07:02:38 +0000]
more death to des

des is in the generated targets. kill it.

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

12 years agodarwin armv6 and armv7 support
Derrick Brashear [Fri, 10 Jun 2011 06:11:26 +0000]
darwin armv6 and armv7 support

simply compile lwp process assembler for both arm arches.

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

12 years agoLinux: rpm: Update openafs.spec.in to include changes to installed files
Jonathan Billings [Mon, 6 Jun 2011 20:29:28 +0000]
Linux: rpm: Update openafs.spec.in to include changes to installed files

* Remove several files from the packaging manifest that are no longer
generated or included in the distribution, such as the DES header
files.
* Exclude the aklog_dynamic_auth man page, since it is AIX-only
* Add new files that have appeared in the distribution, such as the
'afsio' binary.
* Add librokenafs.so.1 and libafshcrypto.so.1 to the base package,
because many of the binaries in the base package are linked against
librokenafs and the 'butc' binary is linked against libafshcrypto.
* Move the librokenafs.{so,a} and libafshcrypto.{so,a} to the -devel
package instead of the authlibs-devel package, now that the .so.1
library is part of the base package.
* Set the executable bits on the libraries installed in libdir.  This
change is important because it causes 'rpmbuild' to generate Provide
tag metadata for the libraries in the package, which is necessary now
that some binaries in other packages have generated Requires tags for
libraries packaged in the base package.  'rpmbuild' will not generate
the Provides tag if the libraries lack executable permission.

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

12 years agoafsd: Fail gracefully on mtab open failure
Andrew Deason [Wed, 8 Jun 2011 18:19:59 +0000]
afsd: Fail gracefully on mtab open failure

On Linux and IRIX, fail gracefully when we fail to open /etc/mtab,
instead of segfaulting. Move strdup'ing cacheMountDir until after
opening /etc/mtab, to simplify the error handling.

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

12 years agovolinfo: PrintFileNames is namei-only
Andrew Deason [Thu, 9 Jun 2011 04:06:58 +0000]
volinfo: PrintFileNames is namei-only

PrintFileNames only exists on namei, so make sure it's inside a namei
ifdef.

Change-Id: I65867b54e3747b6f3a26cdfd70ab84ed7fe4e44d
Reviewed-on: http://gerrit.openafs.org/4830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agolibafs: memset dirHeader->hashTable
Andrew Deason [Thu, 9 Jun 2011 03:50:27 +0000]
libafs: memset dirHeader->hashTable

Clear dirHeader->hashTable via memset instead of via a loop. This is
more efficient, and avoids the loop getting optimized into an unusable
_memset call on recent versions of Solaris Studio when building for
the kernel.

Thanks to Jeff Blaine for reporting the issue with Solaris Studio.

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

12 years agoRemove NetBSD-specific debugging statement
Jonathan A. Kollasch [Thu, 9 Jun 2011 01:31:49 +0000]
Remove NetBSD-specific debugging statement

Change-Id: I458a6b50fee4ed41dd512e23de6b4e516e0ddc93
Reviewed-on: http://gerrit.openafs.org/4828
Reviewed-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Tested-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agoRemoved detail of prev. completed work found listed todo list
Jeff Blaine [Wed, 8 Jun 2011 18:56:58 +0000]
Removed detail of prev. completed work found listed todo list

A todo item was in the "Known Problems" list, but the work was
already completed.  Cleared this item from the list (klog man
page info about krb5, klog.krb5, fakeka)

Change-Id: I9dbff50afd7bbaa6f5d20f7d4acfc796731b9c2d
Reviewed-on: http://gerrit.openafs.org/4826
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

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>