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.
"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.
Andrew Deason [Tue, 21 Jun 2011 21:25:14 +0000 (16:25 -0500)]
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.
Andrew Deason [Tue, 21 Jun 2011 23:08:21 +0000 (18:08 -0500)]
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.
Andrew Deason [Tue, 21 Jun 2011 22:51:32 +0000 (17:51 -0500)]
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.
Andrew Deason [Tue, 21 Jun 2011 23:33:16 +0000 (18:33 -0500)]
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.
Andrew Deason [Tue, 21 Jun 2011 19:58:42 +0000 (14:58 -0500)]
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.
Simon Wilkinson [Sat, 18 Jun 2011 14:50:08 +0000 (15:50 +0100)]
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.
Simon Wilkinson [Sat, 18 Jun 2011 12:17:07 +0000 (13:17 +0100)]
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.
Simon Wilkinson [Sat, 18 Jun 2011 12:01:35 +0000 (13:01 +0100)]
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.
Simon Wilkinson [Sat, 18 Jun 2011 11:43:44 +0000 (12:43 +0100)]
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.
Simon Wilkinson [Sat, 18 Jun 2011 10:58:57 +0000 (11:58 +0100)]
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).
Simon Wilkinson [Sat, 18 Jun 2011 10:48:45 +0000 (11:48 +0100)]
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.
Simon Wilkinson [Sat, 18 Jun 2011 10:35:30 +0000 (11:35 +0100)]
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.
Simon Wilkinson [Sat, 18 Jun 2011 09:46:53 +0000 (10:46 +0100)]
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.
Simon Wilkinson [Fri, 17 Jun 2011 21:06:54 +0000 (22:06 +0100)]
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.
Simon Wilkinson [Tue, 21 Jun 2011 08:34:50 +0000 (09:34 +0100)]
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.
Simon Wilkinson [Sat, 14 May 2011 07:55:50 +0000 (08:55 +0100)]
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.
Simon Wilkinson [Fri, 17 Jun 2011 19:35:59 +0000 (20:35 +0100)]
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.
Simon Wilkinson [Fri, 17 Jun 2011 18:38:29 +0000 (19:38 +0100)]
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.
Simon Wilkinson [Fri, 17 Jun 2011 18:12:09 +0000 (19:12 +0100)]
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.
Ben Kaduk [Fri, 17 Jun 2011 06:22:34 +0000 (02:22 -0400)]
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.
Marc Dionne [Sat, 11 Jun 2011 01:49:58 +0000 (21:49 -0400)]
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
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.
Andrew Deason [Wed, 8 Jun 2011 18:19:59 +0000 (13:19 -0500)]
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.
Andrew Deason [Thu, 9 Jun 2011 03:50:27 +0000 (22:50 -0500)]
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: 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>
Jeff Blaine [Wed, 8 Jun 2011 18:56:58 +0000 (14:56 -0400)]
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)
Jeffrey Altman [Wed, 8 Jun 2011 06:22:41 +0000 (02:22 -0400)]
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.
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.
Ben Kaduk [Tue, 7 Jun 2011 15:30:18 +0000 (11:30 -0400)]
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.
Simon Wilkinson [Sun, 5 Jun 2011 10:04:12 +0000 (11:04 +0100)]
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.
Jeffrey Altman [Sun, 5 Jun 2011 22:41:24 +0000 (18:41 -0400)]
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.
Jeffrey Altman [Sun, 5 Jun 2011 20:02:46 +0000 (16:02 -0400)]
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.
Simon Wilkinson [Mon, 30 May 2011 19:07:01 +0000 (20:07 +0100)]
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.
Simon Wilkinson [Tue, 31 May 2011 08:27:57 +0000 (09:27 +0100)]
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.
Simon Wilkinson [Mon, 30 May 2011 16:47:35 +0000 (17:47 +0100)]
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.
Simon Wilkinson [Mon, 30 May 2011 19:14:45 +0000 (20:14 +0100)]
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.
Simon Wilkinson [Mon, 30 May 2011 19:02:31 +0000 (20:02 +0100)]
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.
Jeffrey Altman [Sat, 4 Jun 2011 17:28:26 +0000 (13:28 -0400)]
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.
Jeffrey Altman [Sat, 4 Jun 2011 03:39:59 +0000 (23:39 -0400)]
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.
Jeffrey Altman [Fri, 3 Jun 2011 18:19:27 +0000 (14:19 -0400)]
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.
Jeff Blaine [Sun, 5 Jun 2011 20:38:53 +0000 (16:38 -0400)]
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.
Simon Wilkinson [Mon, 30 May 2011 16:39:56 +0000 (17:39 +0100)]
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.
Simon Wilkinson [Sat, 14 May 2011 07:37:31 +0000 (08:37 +0100)]
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.
Simon Wilkinson [Sun, 17 Apr 2011 18:14:01 +0000 (19:14 +0100)]
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.
Simon Wilkinson [Sun, 24 Apr 2011 19:52:08 +0000 (15:52 -0400)]
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.
Jeff Blaine [Fri, 27 May 2011 19:49:52 +0000 (15:49 -0400)]
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"
Simon Wilkinson [Tue, 31 May 2011 07:31:55 +0000 (08:31 +0100)]
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.
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.
Michael Meffie [Fri, 24 Sep 2010 01:18:36 +0000 (21:18 -0400)]
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.
Simon Wilkinson [Tue, 19 Apr 2011 07:18:56 +0000 (08:18 +0100)]
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.
Simon Wilkinson [Sun, 17 Apr 2011 22:43:51 +0000 (23:43 +0100)]
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.
Simon Wilkinson [Sun, 17 Apr 2011 22:40:55 +0000 (23:40 +0100)]
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.
Simon Wilkinson [Sun, 17 Apr 2011 20:41:15 +0000 (21:41 +0100)]
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.
Simon Wilkinson [Sun, 17 Apr 2011 19:52:50 +0000 (20:52 +0100)]
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.
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.
Michael Meffie [Tue, 24 May 2011 14:28:37 +0000 (10:28 -0400)]
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.
Michael Meffie [Mon, 23 May 2011 02:53:46 +0000 (22:53 -0400)]
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.
Ben Kaduk [Tue, 31 May 2011 19:25:35 +0000 (15:25 -0400)]
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.
Simon Wilkinson [Mon, 23 May 2011 05:24:09 +0000 (06:24 +0100)]
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)
Simon Wilkinson [Mon, 23 May 2011 05:20:35 +0000 (06:20 +0100)]
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
Simon Wilkinson [Thu, 19 May 2011 18:15:44 +0000 (19:15 +0100)]
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.
Simon Wilkinson [Thu, 19 May 2011 17:56:27 +0000 (18:56 +0100)]
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.
Simon Wilkinson [Thu, 19 May 2011 17:53:27 +0000 (18:53 +0100)]
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.
Simon Wilkinson [Thu, 19 May 2011 17:19:29 +0000 (18:19 +0100)]
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.
Simon Wilkinson [Thu, 19 May 2011 16:57:30 +0000 (17:57 +0100)]
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.
Simon Wilkinson [Thu, 19 May 2011 14:06:15 +0000 (15:06 +0100)]
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.
Simon Wilkinson [Sat, 4 Jun 2011 17:04:48 +0000 (18:04 +0100)]
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.
Simon Wilkinson [Sat, 4 Jun 2011 15:41:41 +0000 (16:41 +0100)]
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.