]> git.michaelhowe.org Git - packages/o/openafs.git/log
packages/o/openafs.git
14 years agoDAFS: Do not clear salv state on fssync salvage
Andrew Deason [Fri, 1 Jul 2011 19:25:05 +0000 (14:25 -0500)]
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.

Reviewed-on: http://gerrit.openafs.org/4900
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1ecac71e50e75ce5a45e297d57c480e850975af7)

Change-Id: I313f4c4093f3b4f5ee501ef7537d05b557946a70
Reviewed-on: http://gerrit.openafs.org/4948
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoSOLARIS: Granular multiPage detection
Andrew Deason [Wed, 29 Jun 2011 18:51:22 +0000 (13:51 -0500)]
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: Idd39fd4811ea03aa7eee62f85f1a0c74c9c5e402
Reviewed-on: http://gerrit.openafs.org/4896
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 31a001f60e5fe729b315f679d1d43b367bd74ea5)
Reviewed-on: http://gerrit.openafs.org/4927
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoRevert "Rx: When call receive is done, send ack all packet"
Jeffrey Altman [Thu, 30 Sep 2010 14:48:58 +0000 (10:48 -0400)]
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.

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>
(cherry picked from commit 358099b21c5c888c02bf3754702ae623378c507d)

Change-Id: I7accb0e176c6143d87bb7809ead7ced63b9d86dd
Reviewed-on: http://gerrit.openafs.org/4946
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: Do not attach a specialStatus'd vol
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.

Reviewed-on: http://gerrit.openafs.org/4874
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f5349051abebd15fc2f2d77ff5b6dc81e09bdf47)

Change-Id: I3593a50b5867c671fe462abd40b50dcbbd2c5204
Reviewed-on: http://gerrit.openafs.org/4945
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agosalvager: Clear summary in RecordHeader
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.

Reviewed-on: http://gerrit.openafs.org/4876
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 926ce3d35018050bdbe8e00011884954d6b0fd80)

Change-Id: Ia617153da8762394659b7c7816e6f3d24af6c4d2
Reviewed-on: http://gerrit.openafs.org/4944
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoBuild a separate copy of vlib for dasalvager
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.

(cherry picked from commit f2d067b4e48500004236b181dd5a25454f352daf)
Reviewed-on: http://gerrit.openafs.org/4875
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Change-Id: Id65a30ced198853bc6c376153671def71dd600d1
Reviewed-on: http://gerrit.openafs.org/4943
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: Do not overwrite specialStatus in attach2
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.

Reviewed-on: http://gerrit.openafs.org/4873
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 25688bc2e7e8da83b4bf22d7cdc3e0214eadc455)

Change-Id: I4316be912a5a30856914059984f45782bece0cdd
Reviewed-on: http://gerrit.openafs.org/4942
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Exit fast restart on non-duplicate ACK
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.

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>
(cherry picked from commit 6b833f575743d4a826750bb6913cd53232a8867f)

Change-Id: I51b4de1146df032ff6e1273d8c832bded770e177
Reviewed-on: http://gerrit.openafs.org/4941
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Don't limit the # of packets sent in recovery
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.

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>
(cherry picked from commit 91b351e88bdb56bfdfc2f5f16f64bb7522796581)

Change-Id: I673980bdee6d1316cb363f12d32c96fb2577cb27
Reviewed-on: http://gerrit.openafs.org/4940
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Don't wait for TQ busy when entering recovery
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.

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>
(cherry picked from commit 0b9c9e9973e8d32cdfe1fc884fb2c310cedc0404)

Change-Id: I47525eb4cf0bb6d049094c7f98f8cc79be9ef51e
Reviewed-on: http://gerrit.openafs.org/4939
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Enter loss recovery when we retransmit
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.

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>
(cherry picked from commit e8c4fc4f37912a5d30694caef45d27374e9201e7)

Change-Id: I5ee6aa255a0b923f445dde2f1e9f0abf98dbe623
Reviewed-on: http://gerrit.openafs.org/4938
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Add Karn-style backoffs to RX retransmits
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).

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>
(cherry picked from commit 0118fb5387e656e515d78d48497a48f1e04a1152)

Change-Id: I697eac14f9b4be5c8726f0386e516cb49995f665
Reviewed-on: http://gerrit.openafs.org/4937
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Make clock_Add correctly add to itself
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.

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>
(cherry picked from commit 784babbea1247660f39463403233589a74c6e73b)

Change-Id: I1e97e9734d04f898dabad59a88afc929d8888e90
Reviewed-on: http://gerrit.openafs.org/4936
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Remove resending logic into its own function
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.

(cherry picked from commit 280c80152522f32cf34deae96696b1db8aaaa9bb)
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>
Change-Id: Ia8b28be53d7c37fbfd877364930d7dc4a4d52e37
Reviewed-on: http://gerrit.openafs.org/4935
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Don't let timeouts force fast recovery
Simon Wilkinson [Mon, 25 Oct 2010 09:14:12 +0000 (10:14 +0100)]
rx: Don't let timeouts force fast recovery

The current RX implementation goes into fast recovery whenever a
timeout occurs. This is incredibly wasteful, particularly on fast
connections. So, remove this in favour of TCP style behaviour.

(cherry picked from commit 36e2d13b55085c996d38b30d003296c602ef8ee3)
Reviewed-on: http://gerrit.openafs.org/3138
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I5b5b154d78183621c160537172d7c0a3789114e6
Reviewed-on: http://gerrit.openafs.org/4934
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: complete fix for starting rexmit timers
Derrick Brashear [Thu, 7 Jul 2011 20:56:28 +0000 (16:56 -0400)]
rx: complete fix for starting rexmit timers

1.6-only change. the pullup of e7066a9c30047e787d72f02dd1c28e5e473e494b
(as dab406baf28c19710b4a451ae2516dfa1ebeee29)
missed this because the code in 1.6 was structured differently at the time.

Change-Id: I38e9db1dcc681ae4eecc0f3abd634052b9f93ca0
Reviewed-on: http://gerrit.openafs.org/4933
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoRX: rxi_PrepareSendPacket drops call lock; WaitforTQ required
Simon Wilkinson [Sat, 6 Nov 2010 19:18:14 +0000 (15:18 -0400)]
RX: rxi_PrepareSendPacket drops call lock; WaitforTQ required

Since rxi_PrepareSendPacket drops the call->lock during
processing the caller must perform a rxi_WaitforTQ prior
to manipulating the transmit queue.

Reviewed-on: http://gerrit.openafs.org/3279
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit cb7a5ce44470112d3ba5e341322bb9e7d029e101)

Change-Id: I17a863d46f65fca904a22abccb849c8a8c0997ee
Reviewed-on: http://gerrit.openafs.org/4932
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Fix resend accounting
Simon Wilkinson [Mon, 25 Oct 2010 08:16:09 +0000 (09:16 +0100)]
rx: Fix resend accounting

rxi_Start flagged itself as 'resending' whenever it flushed the
transmit queue due to a resend event. However, it would flush the
entire transmit queue at this point, rather than only transmitting
packets that require a resend. When running with large window sizes
this results an a large number of packets erroneously being marked
as resent.

Instead, let SendXmitList decide whether a packet is being
retransmitted by using the presence of a serial number. This takes
advantage of the fact that a retransmitted packet must be the only
entry in a packet list - we just flag the packet list, instead of
having to maintain counters for each individual packet.

(cherry picked from commit e84193ca2a9cef5a13403d291435eb5ad47f5b41)
Reviewed-on: http://gerrit.openafs.org/3135
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I1c8da9639b9739bf88a925b7af98c25b3eaeda8c
Reviewed-on: http://gerrit.openafs.org/4931
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Don't maintain maxSerial
Simon Wilkinson [Fri, 5 Nov 2010 00:23:23 +0000 (00: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.

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>
(cherry picked from commit 6a22a2f4b7aa0d960cea17b419003986f6184d58)

Change-Id: I465e73b7cc7c57b384cd2652bbc8825a898b8bbc
Reviewed-on: http://gerrit.openafs.org/4930
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoRx: Consolidate wait for tq busy and make its use uniform
Jeffrey Altman [Tue, 12 Oct 2010 14:53:43 +0000 (10:53 -0400)]
Rx: Consolidate wait for tq busy and make its use uniform

rxi_WaitforTQBusy() is now used wherever a wait for the transmit
queue is required.  It returns either when the transmit queue is
no longer busy or when the call enters an error state.

Having made this change it is clear that call->currentPacket is
not always validated when the call->lock is reacquired which may be
true when rxi_WaitforTQBusy() is called.

(cherry picked from commit e45abc6cc20236b9e91c23cb6f8e90f51b6a4a99)
Reviewed-on: http://gerrit.openafs.org/2966
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Change-Id: I3492d351581549872b8332a626dae344757c6a6e
Reviewed-on: http://gerrit.openafs.org/4929
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoChange wiki ref to wiki.openafs.org from stanford.edu
Jeff Blaine [Wed, 29 Jun 2011 02:58:29 +0000 (22:58 -0400)]
Change wiki ref to wiki.openafs.org from stanford.edu

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

Reviewed-on: http://gerrit.openafs.org/4897
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a4e3c3be697bb99ee4846c99550cd2b52929cdca)

Change-Id: I7d1da2d26eb8cb9f1f7c231ec70b8f9486c0d146
Reviewed-on: http://gerrit.openafs.org/4947
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Change the way that the RTT timer is applied
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.

(cherry picked from commit a80a88e8ba7ac5e2afc5188add482f4e5323128e)
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>
Change-Id: I023c9b52b104f8930f8d0dd628612cec2226fee0
Reviewed-on: http://gerrit.openafs.org/4918
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Use a structure for the xmit list
Simon Wilkinson [Mon, 25 Oct 2010 08:06:53 +0000 (09:06 +0100)]
rx: Use a structure for the xmit list

Switch to using a structure to hold the xmit list so that it's a
little bit clearer what the rxi_SendXmitList function is actually doing

(cherry picked from commit ad3b5997c6da17927312f4618d8bb4f7fc542a64)
Reviewed-on: http://gerrit.openafs.org/3134
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I6534f5c40e890af916752bf2647a14f9c386e004
Reviewed-on: http://gerrit.openafs.org/4917
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Compute smoothed RTT per call, not per peer.
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.

(cherry picked from commit 39484c6e57cf993a713b4a989d1c0c227e6f496c)
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>
Change-Id: I5b33323ceed7231bd70e43284d83dfe1db144188
Reviewed-on: http://gerrit.openafs.org/4916
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Reorganise transmit queue walk
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.

(cherry picked from commit fe7d38f3205bd879e961f5849ed64df5b495388a)
Reviewed-on: http://gerrit.openafs.org/4796
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Change-Id: I85dd1d1706227599a48c7f75ca1947af0b5184bf
Reviewed-on: http://gerrit.openafs.org/4915
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Add RX_CALL_ACKALL_SENT flag and rxi_SendAck processing
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.

Reviewed-on: http://gerrit.openafs.org/4798
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit cd326b2f54c3397468807c32ce0834f73c9d5d1b)

Change-Id: Ic4fa021eb33462ddf759ce0d7a8845edf1ecbed5
Reviewed-on: http://gerrit.openafs.org/4914
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: do not rxi_AckAll for one data packet call
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.

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>
(cherry picked from commit ff30293624a7e31d585b9e8f2e1a439cf87b6524)

Change-Id: Ic64917c40aa29f9e99c434ab2f9ba2e4abc38883
Reviewed-on: http://gerrit.openafs.org/4913
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Reverse the consumption order of idle queue
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.

Performance numbers to follow ...

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>
(cherry picked from commit 5614305853f0f87a2418a6fb7ca472a8ef966084)

Change-Id: I6b961a470adfe053ecd85af05821e42898fd7847
Reviewed-on: http://gerrit.openafs.org/4912
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Remove incorrect backoff code
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.

Reviewed-on: http://gerrit.openafs.org/4860
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit b65944973a24e9365dc1ff118ded4c3a1e25f782)

Change-Id: I4d2766d98883dad4f27ff4c52e2a03a49733f89f
Reviewed-on: http://gerrit.openafs.org/4911
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Account for delayed ACKS when computing RTO
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.

Reviewed-on: http://gerrit.openafs.org/4859
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 699330682f3cb001bf1bfbeaffd806600ccf69e8)

Change-Id: Ibe06f46c9ac846fb0381c467242e5c3b439c8907
Reviewed-on: http://gerrit.openafs.org/4910
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: Make rx_softAckDelay & rx_lastAckDelay private
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.

Reviewed-on: http://gerrit.openafs.org/4858
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit c0cfbc40c8ef3de65f144560918cbd2a5bf187ec)

Change-Id: I7976d8d11007c0f597ede707db7cbb617956bd29
Reviewed-on: http://gerrit.openafs.org/4909
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoDocumented vos restore -creation and -lastupdate
Jeff Blaine [Sat, 18 Jun 2011 00:35:17 +0000 (20:35 -0400)]
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.

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>
(cherry picked from commit 800a5642a0b9ff514519b4af30b4d0dadd471480)

Change-Id: Ib0d71a34242cdc42753518a454479bccaac0094a
Reviewed-on: http://gerrit.openafs.org/4908
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoTreat Linux 3 as Linux 2.6
Anders Kaseorg [Tue, 14 Jun 2011 19:24:42 +0000 (15:24 -0400)]
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.

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>
(cherry picked from commit 34bdd979fc487843c26f15655b94eac7c8f98fee)

Change-Id: Ibbedc447ea4b2dfa61f06a4b0b87a5bc884f711a
Reviewed-on: http://gerrit.openafs.org/4907
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoWindows: MergeStatus before SyncOpDone
Jeffrey Altman [Mon, 27 Jun 2011 13:31:54 +0000 (09:31 -0400)]
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.

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>
(cherry-picked from 51fa590e704c77c0e9ba873ecb854448885030a5)

Change-Id: Ic50241081e52b70bf7b6bd7d92df205f7184f7c8
Reviewed-on: http://gerrit.openafs.org/4895
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>
14 years agoWindows: TRANS2_FIND_FIRST2 for _._AFS_IOCTL_._
Jeffrey Altman [Thu, 23 Jun 2011 21:51:22 +0000 (17:51 -0400)]
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.

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>
(cherry-picked from 9f77a2d6b3d571a928261563763913c8c6ee2938)

Change-Id: Iab58557350fa099c903b0c2b555e5cc2027daafc
Reviewed-on: http://gerrit.openafs.org/4894
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>
14 years agoWindows: Fix SMB_COM_NEGOTIATE for MS11-043
Jeffrey Altman [Fri, 24 Jun 2011 03:49:32 +0000 (23:49 -0400)]
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

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>
(cherry-picked from 7532b05221caf2c382d9e8c9ca5af4a284566920)

Change-Id: I67eb2b293228cacb4df20ac072beaf03f2111c55
Reviewed-on: http://gerrit.openafs.org/4893
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>
14 years agoWindows: shell extension is multithreaded
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.

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>
(cherry-picked from 418a70feedb5574d28c3fbe513333b0fb102a3ca)

Change-Id: I467c2b8cd00b6b248b3c50270da470cebd4b6a5f
Reviewed-on: http://gerrit.openafs.org/4892
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>
14 years agoFBSD: do not install kdump
Ben Kaduk [Fri, 17 Jun 2011 06:44:46 +0000 (02:44 -0400)]
FBSD: do not install kdump

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

Reviewed-on: http://gerrit.openafs.org/4849
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 327f516477b3dbf6ed6302c706bbb2bf41ae7907)

Change-Id: I904095a9143c0aedc0e96d64793200eca7649934
Reviewed-on: http://gerrit.openafs.org/4853
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoUnbreak make dest for FBSD
Ben Kaduk [Wed, 30 Mar 2011 02:26:50 +0000 (22:26 -0400)]
Unbreak make dest for FBSD

It turns out that we do need an afs.rc.fbsd that is set up for
transarc paths in this directory.  To get it to work properly
will require the user to symlink to it from a dir that gets
checked by rcorder, but them's the breaks.

Reviewed-on: http://gerrit.openafs.org/4378
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 0b69fd6d5631482a786c2223a7dec0b2c9a07f92)

Change-Id: Ifd921019898954414a6d107702786c546d661bd4
Reviewed-on: http://gerrit.openafs.org/4855
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoEnable -afsdb in the Red Hat packages.
Ken Dreyer [Wed, 15 Jun 2011 18:21:27 +0000 (14:21 -0400)]
Enable -afsdb in the Red Hat packages.

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>
(cherry picked from commit 0a318b5bb9d0f5940eeffa092f6adae025d560de)

Change-Id: I08e117bf25137099b7d550f4ec397ee987ef4ab0
Reviewed-on: http://gerrit.openafs.org/4856
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: do not FlushAllVCaches
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.

Reviewed-on: http://gerrit.openafs.org/4847
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 03a54723eaf23b2aad0d026ba5f1a8e7343b3763)

Change-Id: I866fb196f8368362bcd673ffb4908ab21a46c544
Reviewed-on: http://gerrit.openafs.org/4854
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoAlso install afszcm.cat for i386_fbsd
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.

Reviewed-on: http://gerrit.openafs.org/4815
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 445a8b5461c66160552136214a1d8d97de15967e)

Change-Id: Ic39fecb824be58a8890c665dedcd1eff2b4f9bdc
Reviewed-on: http://gerrit.openafs.org/4848
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agodoc: let configure find the XML tools if possible
Chas Williams (CONTRACTOR) [Thu, 2 Jun 2011 23:00:47 +0000 (19:00 -0400)]
doc: let configure find the XML tools if possible

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

Reviewed-on: http://gerrit.openafs.org/4766
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit cc2bc3e17ff5f7a10c515e309f8fec47a6fa14b6)

Change-Id: I4773affa193b5210da6416dd8b4321bd3f471429
Reviewed-on: http://gerrit.openafs.org/4794
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agokvno invocation correction, language cleanup, afs/cell principal preferred
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"

Reviewed-on: http://gerrit.openafs.org/4740
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 07f461e8e35147af605ebc86c139b31d2db0bb28)

Change-Id: If37ab2164a13c6f4b745aaf221337ba56eede043
Reviewed-on: http://gerrit.openafs.org/4793
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovos: print_addrs never receives multi-homed addrs
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.

Reviewed-on: http://gerrit.openafs.org/4757
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 23e433f10414d771937cbea5510b6006b6a7b063)

Change-Id: I24df764211d99d84b116d1031b05de61b38c3397
Reviewed-on: http://gerrit.openafs.org/4792
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoxstat: cope with different size timeval structures
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.

Reviewed-on: http://gerrit.openafs.org/2986
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c0a55111d726b26d07661957a65e4d59f155d5e6)

Change-Id: I3bef968538c90d6e261142c60a817b4b9e2ad228
Reviewed-on: http://gerrit.openafs.org/4791
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agolinux: rpm: Fix SELinux attributes on /afs when installing openafs-client package
Jonathan Billings [Wed, 1 Jun 2011 15:05:11 +0000 (11:05 -0400)]
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.

Reviewed-on: http://gerrit.openafs.org/4763
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b3232b2cb44a3df02a37efd852ecfef2f3a9e5cc)

Change-Id: I5944c16f558f2651250d122f547fbfd71519c1d1
Reviewed-on: http://gerrit.openafs.org/4786
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoEnable gencat for i386_fbsd_*
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.

Reviewed-on: http://gerrit.openafs.org/4760
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 55a41d00057106913ce2aba50772a56bc994a9a4)

Change-Id: Icd3b85c99e8a41407355f94e561042c13ca15293
Reviewed-on: http://gerrit.openafs.org/4785
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agolibafs: Do not osi_FlushPages for dirs
Andrew Deason [Thu, 17 Mar 2011 21:32:00 +0000 (16:32 -0500)]
libafs: Do not osi_FlushPages for dirs

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

Reviewed-on: http://gerrit.openafs.org/4259
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a6f18413edceed1b0d532005eb62cb1886e7a6f3)

Change-Id: I48dafa5fb442cfc92fb673f2b26e1034fc44c0c7
Reviewed-on: http://gerrit.openafs.org/4730
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolinux: add read_descriptor_t configure test and ifdef
Christof Hanke [Thu, 26 May 2011 05:46:32 +0000 (07:46 +0200)]
linux: add read_descriptor_t configure test and ifdef

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

Reviewed-on: http://gerrit.openafs.org/4719
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7133266bafbf238ef921690c40846f3ea2d2fc8b)

Change-Id: Ifdc7c1d3c4162452c1576942b7bfe37ea5014a77
Reviewed-on: http://gerrit.openafs.org/4726
Reviewed-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoautoconf: add test for typedef'd structs
Christof Hanke [Wed, 25 May 2011 20:16:59 +0000 (22:16 +0200)]
autoconf: add test for typedef'd structs

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

Reviewed-on: http://gerrit.openafs.org/4718
Reviewed-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit baf7656f666e0d47047c545561345e7803b8a141)

Change-Id: I7feca884d7796ccd3a490d6b81e745c644d9c8f1
Reviewed-on: http://gerrit.openafs.org/4725
Reviewed-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: VIMAGE support
Ben Kaduk [Thu, 26 May 2011 05:11:14 +0000 (01:11 -0400)]
FBSD: VIMAGE support

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

Submitted-by: Hiroki Sato of freebsd.org
Reviewed-on: http://gerrit.openafs.org/4721
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 9703b023cc0f5088eab5135acf7417e90ebbb2cd)

Change-Id: I058ed4fd637f205701e5aab4d88d65386097f9c0
Reviewed-on: http://gerrit.openafs.org/4724
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: note parms file deprecation
Derrick Brashear [Wed, 25 May 2011 21:05:53 +0000 (17:05 -0400)]
viced: note parms file deprecation

/vice/file/parms is unsupported and will be removed later. 1.6 only change.
master version will remove it.

Change-Id: Id41ca57c1331fb59b87f7f6a06281b640a8c9879
Reviewed-on: http://gerrit.openafs.org/4720
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agomacos: disable bulkstat
Derrick Brashear [Wed, 25 May 2011 19:31:40 +0000 (15:31 -0400)]
macos: disable bulkstat

1.6 only change. there's still an issue where potentially
multiple contexts reference a vnode which needs to be finalized; the fixup
is successful but there's no hint to other threads to reref before proceeding
(no actual troublesome access while waiting for the fixup as the vnode
will not have actually been CStatd yet)

Change-Id: Ib72f69b74c94b7cac74a9a01a54a8872e32f9717
Reviewed-on: http://gerrit.openafs.org/4717
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agodes: generated files should not require objects needed in libdes
Derrick Brashear [Tue, 24 May 2011 18:36:04 +0000 (14:36 -0400)]
des: generated files should not require objects needed in libdes

1.6 only change, since DES is dead. don't require the same misc.o
in both libdes and when generating generated files to making, as
make dependencies then throw away valid input.

Change-Id: Icf6a211e66d7390ac73fa1effb89a0c4a131666f
Reviewed-on: http://gerrit.openafs.org/4713
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: ChangeLog for 1.5.9906 (1.6.0pre6)
Jeffrey Altman [Mon, 23 May 2011 17:26:20 +0000 (13:26 -0400)]
Windows: ChangeLog for 1.5.9906 (1.6.0pre6)

Reviewed-on: http://gerrit.openafs.org/4706
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from ba76149a57f0cfd92672580b7047a557f159ee52)

Change-Id: Id400d48bf5e8699558133b4b7812a2703a4508e5
Reviewed-on: http://gerrit.openafs.org/4707
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoReplace uintptr_t type cast with uintptrsz in afs_vcache.c
Antoine Verheijen [Tue, 17 May 2011 15:40:15 +0000 (09:40 -0600)]
Replace uintptr_t type cast with uintptrsz in afs_vcache.c

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

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

Reviewed-on: http://gerrit.openafs.org/4671
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b3004fbd5007d400a4cd3fb2a5b1c52d98618aab)

Change-Id: I3c7452d1f09dc7fdbcffe9b047e4ec682ac6ea03
Reviewed-on: http://gerrit.openafs.org/4705
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agomake 1.6.0pre6
Derrick Brashear [Sun, 22 May 2011 15:40:46 +0000 (11:40 -0400)]
make 1.6.0pre6

update for 1.6.0pre6 the various build strings

Change-Id: Ic5deaa84f28cc39e955a0fcb1472a849d9feb4a3
Reviewed-on: http://gerrit.openafs.org/4703
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Flush vcaches in afs_shutdown
Andrew Deason [Tue, 10 May 2011 19:16:06 +0000 (14:16 -0500)]
libafs: Flush vcaches in afs_shutdown

Currently, a few platforms (linux, linux24, solaris, irix) flush all
vcaches during shutdown. However, they do this before calling
afs_shutdown(), resulting in afs_FlushVCache queueing VCBs and
possibly trying to give the callbacks back to the server.

Instead of this, perform the flushes in afs_shutdown itself, so we do
this after we try to give up all callbacks to all servers, and we do
this while afs_shuttingdown is set, so we don't try to queue VCBs.
This also consolidates some of the duplicated code to flush all
vcaches, and now does this for all platforms.

Reviewed-on: http://gerrit.openafs.org/4641
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 80fe111f0044aa7a67215ad92210dc72cb7eb2c0)

Change-Id: I90afacbdd7ef0f52de4589001ec9bb8ffd292782
Reviewed-on: http://gerrit.openafs.org/4702
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoxdr symbol fallout
Derrick Brashear [Wed, 30 Mar 2011 13:46:43 +0000 (09:46 -0400)]
xdr symbol fallout

changes to xdr make xdr_vector and xdr_reference missing from libuafs.
fix it.

(cherry picked from commit 6bdba897f49b8358d3592588a78d9b59757a9c13)
Change-Id: I6ed0e035ff928f3cf93fdc42c7ee0f31096de978
Reviewed-on: http://gerrit.openafs.org/4379
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/4704

14 years agodoc: -afsdb uses SRV records
Ken Dreyer [Mon, 16 May 2011 23:53:43 +0000 (19:53 -0400)]
doc: -afsdb uses SRV records

afsd's -afsdb option now uses DNS SRV records (RFC 5864). Update the manpages
to reflect this.

Reviewed-on: http://gerrit.openafs.org/4670
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 884d0b058cea4ad6c9338fc7842ea0c619cb263d)

Change-Id: Ibcdb7c0564d9ac56fa9e50123950e7f758761111
Reviewed-on: http://gerrit.openafs.org/4701
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agomacos: bulkstat redux
Derrick Brashear [Fri, 20 May 2011 18:13:01 +0000 (14:13 -0400)]
macos: bulkstat redux

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

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

Reviewed-on: http://gerrit.openafs.org/4677
Tested-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 04087af8494b90f664ac5f274d5db4c12063f238)

Change-Id: I7a9c3e4f94496aa1a553ad54f6d43a0d0e6ccd5a
Reviewed-on: http://gerrit.openafs.org/4699
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agodynroot: mark vnode types on dynroot vnodes
Derrick Brashear [Fri, 20 May 2011 18:10:49 +0000 (14:10 -0400)]
dynroot: mark vnode types on dynroot vnodes

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

Reviewed-on: http://gerrit.openafs.org/4686
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0cf06f620213fa62abc16bf717779a1333ce12a0)

Change-Id: Ic0392216ca5da072022baa1388380f658d324df2
Reviewed-on: http://gerrit.openafs.org/4698
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovolinfo: fix -filenames option check
Michael Meffie [Wed, 18 May 2011 17:42:27 +0000 (13:42 -0400)]
volinfo: fix -filenames option check

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

Reviewed-on: http://gerrit.openafs.org/4689
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 33cb8a53fdc8907dafed2e77cc1da539d17397c5)

Change-Id: Ic538976a697317fd3458c8a619f14dd100c4cdab
Reviewed-on: http://gerrit.openafs.org/4697
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoSOLARIS: Reset syscalls on mod_install failure
Andrew Deason [Thu, 19 May 2011 22:02:35 +0000 (17:02 -0500)]
SOLARIS: Reset syscalls on mod_install failure

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

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

Reviewed-on: http://gerrit.openafs.org/4685
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ca425b7d49a2bf4c079aa38c0abf68596eca0b30)

Change-Id: Ifb2cd9848b5468c950b600052308370b7c8c2af9
Reviewed-on: http://gerrit.openafs.org/4687
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorx: always use/protect the xdr routines in the kernel
Chas Williams (CONTRACTOR) [Wed, 16 Mar 2011 14:32:48 +0000 (10:32 -0400)]
rx: always use/protect the xdr routines in the kernel

This clears up some warnings about duplicate symbols with Solaris 11
since the Solaris kernel already has these routines.  Since we never
use stock kernel version of the xdr routines perhaps we should always
use/protect our version of the symbols.

Reviewed-on: http://gerrit.openafs.org/4252
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 8336d31ac5092a16cfb206707e69c19f07f99241)

Change-Id: Iebf4470f5ddfc591f52f51d1d080bd58d11683a8
Reviewed-on: http://gerrit.openafs.org/4682
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoauth: failback to afs3-vlserver for afs3-prserver
Jeffrey Altman [Wed, 18 May 2011 17:51:53 +0000 (13:51 -0400)]
auth: failback to afs3-vlserver for afs3-prserver

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

FIXES 129887

Reviewed-on: http://gerrit.openafs.org/4676
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 19f4fa2b4870828269e0751a4874d9ce67a1bb3a)

Change-Id: I9d0e2f0ca9d4ddc5ebf9defb44c62f6bf00955d6
Reviewed-on: http://gerrit.openafs.org/4681
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: lock protected fields must be 32-bit
Jeffrey Altman [Mon, 16 May 2011 01:56:17 +0000 (21:56 -0400)]
Windows: lock protected fields must be 32-bit

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

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

Change-Id: If363654c4d0dd8efd225c9ff19b99bb4f4b7b70e
Reviewed-on: http://gerrit.openafs.org/4675
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoWindows: add lock assertions to cm_buf.c
Jeffrey Altman [Mon, 16 May 2011 01:53:56 +0000 (21:53 -0400)]
Windows: add lock assertions to cm_buf.c

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

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

14 years agoWindows: test return from krb5_cc_start_seq_get
Jeffrey Altman [Mon, 16 May 2011 01:51:14 +0000 (21:51 -0400)]
Windows: test return from krb5_cc_start_seq_get

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

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

14 years agorpm: Really undefine %dist
Andy Cobaugh [Wed, 11 May 2011 21:02:40 +0000 (17:02 -0400)]
rpm: Really undefine %dist

rpmbuild --eval '%undefine dist' wasn't sticking on redhat 5.x. I think
the correct way to undefine this is to --define 'dist %undefined'

Some redhat 5.x installs have %dist defined depending on what else has been
installed.

Reviewed-on: http://gerrit.openafs.org/4643
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0b983054f88d69ca4c0cda07e94103f216bd881d)

Change-Id: I41828880a10097059ae0297ae191fa2a96e804d2
Reviewed-on: http://gerrit.openafs.org/4665
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: fix reading files larger than the chunk size
Marc Dionne [Sun, 15 May 2011 00:57:12 +0000 (20:57 -0400)]
Linux: fix reading files larger than the chunk size

Commit 2571b6285d5da8ef62ab38c3a938258ddd7bac4e fixed an issue with
the use of tmpfs as a disk cache and ftruncate() on files in AFS.
But it introduced a problem reading larger files as reported in
RT ticket 129880.

What should be compared against the current cache file size is the
offset into the current chunk, not the overall offset for the whole
file.

FIXES: 129880

Reviewed-on: http://gerrit.openafs.org/4656
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8ee33373c1ef24572476d8189a3f6f7505bfc83a)

Change-Id: I0349d744a9e16b6448a621fe6f4078b1eb1fa9d2
Reviewed-on: http://gerrit.openafs.org/4664
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Do not write-lock afs_xserver on ICBS
Andrew Deason [Tue, 10 May 2011 17:54:53 +0000 (12:54 -0500)]
libafs: Do not write-lock afs_xserver on ICBS

Our RXAFSCB_InitCallBackState* handler currently write-locks
afs_xserver when it clears the SCAPS_KNOWN flag for the relevant
server. However, the afs_xserver lock is for protecting the global
list and hash table of server structures, and is not necessary to
acquire in order to modify the flags of an individual server struct.
For instance, CkSrv_GetCaps does not acquire any locks to modify the
server flags.

Taking this lock conflicts with a read lock on afs_xserver acquired by
afs_FlushVCBs when it traverses the list of server structures.
afs_FlushVCBs may contact a server that then calls InitCallBackState
on us, causing a deadlock if ICBS waits for the afs_xserver lock.

So, avoid locking afs_xserver in this case, to avoid that deadlock.

Reviewed-on: http://gerrit.openafs.org/4639
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ae638fa383b8270fe2461a2ad91b9101c74f3593)

Change-Id: I095c74f51f1ddb74ebaecda221ca45a4f6ad09c8
Reviewed-on: http://gerrit.openafs.org/4663
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agodasalvager: unlink fsstate.dat when standalone
Andrew Deason [Fri, 6 May 2011 18:12:17 +0000 (13:12 -0500)]
dasalvager: unlink fsstate.dat when standalone

If the DAFS salvager is running in a standalone mode, unlink the
fileserver's fsstate.dat file if any volumes change. Otherwise, volume
data could have changed and the fileserver will retain callback
promises for the data in those volumes until it tries to attach the
volume. This way, callbacks are broken via callback state
reinitialization.

A better solution is to record which volumes have changed, and the
fileserver can break callbacks for them on startup. But this at least
eliminates a regression from non-DAFS behavior.

Reviewed-on: http://gerrit.openafs.org/4638
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 38efda16a2c5c9e74b5a23b5bdd2818a3353eec2)

Change-Id: Ic931ce8118e8d76d799ce7e731451a6a4bf3c241
Reviewed-on: http://gerrit.openafs.org/4662
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Put back GetCapabilities user reference
Andrew Deason [Thu, 5 May 2011 22:13:21 +0000 (17:13 -0500)]
libafs: Put back GetCapabilities user reference

afs_GetCapabilities gets a user reference for the conn for the
GetCapabilities call. Put the ref back so we don't leak refs.

Reviewed-on: http://gerrit.openafs.org/4626
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 010fc998a51a0aae2499b128ee8c671885a84e13)

Change-Id: Ia505de8e5ec7ded14f2e2e40ac8bd3ef0b91c2fc
Reviewed-on: http://gerrit.openafs.org/4637
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: fix permission op test for certain compilers
Marc Dionne [Sat, 14 May 2011 17:19:52 +0000 (13:19 -0400)]
Linux: fix permission op test for certain compilers

Some compilers complain that _inode is used uninitialised here.
Since this test requires -Werror, it causes the test to fail
and our permission op to be used in RCU mode, leading to lockups.

Initialise it to make the compilers happy.

Fixes a lockup seen on kernels 2.6.38+ on Gentoo and Debian.

Reviewed-on: http://gerrit.openafs.org/4654
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 050945e949135c1b98ed353fc05fcf9b8c1587bd)

Change-Id: Icc4e65946c8d04bd519c95b969dec1d2359dce51
Reviewed-on: http://gerrit.openafs.org/4655
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: always try afs/cell@USER-REALM first
Jeffrey Altman [Mon, 9 May 2011 14:46:46 +0000 (10:46 -0400)]
Windows: always try afs/cell@USER-REALM first

In the KFW_AFS library, always try afs/cell@USER-REALM
first, even when KFW_AFS_klog() is called with an explicit
realm mapping for the cell.  An afs service principal from
the user's realm is always preferred.  No cross realm and
if the realm is AD, the ability to avoid the inclusion of
a PAC.

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

14 years agoWindows: support dotted names in aklog
Jeffrey Altman [Mon, 9 May 2011 14:45:33 +0000 (10:45 -0400)]
Windows: support dotted names in aklog

Do not reject dotted principal names if the registry
configuration states that they should be accepted.

Change-Id: I68a3054e77236ff307cc45b6563f34ec6605113a
Reviewed-on: http://gerrit.openafs.org/4632
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4634
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: replace CYGWIN envvar with CYGWINDIR
Jeffrey Altman [Fri, 6 May 2011 13:49:52 +0000 (09:49 -0400)]
Windows: replace CYGWIN envvar with CYGWINDIR

The environment variable CYGWIN (starting with cygwin 1.7.1) is
now used by CYGWIN to set configuration parameters for the cygwin
runtime library.  OpenAFS used it to indicate the location of the
Cygwin install directory.  Since there is a conflict, rename CYGWIN
to CYGWINDIR.

Change-Id: I32cd79eba33fc80e15308010fafdaecb527d23f0
Reviewed-on: http://gerrit.openafs.org/4629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4630
Tested-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoWindows: change log for 1.5.9905
Jeffrey Altman [Fri, 6 May 2011 00:36:38 +0000 (20:36 -0400)]
Windows: change log for 1.5.9905

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

14 years agomake 1.6.0pre5
Derrick Brashear [Tue, 3 May 2011 12:47:31 +0000 (08:47 -0400)]
make 1.6.0pre5

update bits needed for pre5

Change-Id: Iec57e2a69ea02c25b1c71b3d7ac4beb6eafc69c1
Reviewed-on: http://gerrit.openafs.org/4618
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoNetBSD: DEBUG can not typically be defined
Jonathan A. Kollasch [Mon, 2 May 2011 21:06:34 +0000 (21:06 +0000)]
NetBSD: DEBUG can not typically be defined

Like IRIX 6.5, some NetBSD kernel structures change size in the presence
of the DEBUG preprocessor symbol.

Reviewed-on: http://gerrit.openafs.org/4605
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 48633351c597278d4c8efd5a80163f0637c85aaf)

Change-Id: I15771316dc657474d8b906df26f927fdbefe384c
Reviewed-on: http://gerrit.openafs.org/4617
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoNetBSD: translate timeval structure format in clock_GetTime()
Jonathan A. Kollasch [Mon, 2 May 2011 20:03:50 +0000 (20:03 +0000)]
NetBSD: translate timeval structure format in clock_GetTime()

Reviewed-on: http://gerrit.openafs.org/4604
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 350786b3e092150a91bb4542263f648d683e3b7c)

Change-Id: I819abb0b3207517f4a560e10896db211006f1980
Reviewed-on: http://gerrit.openafs.org/4616
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoavoid downward vcache pressure when entries are free
Derrick Brashear [Fri, 29 Apr 2011 07:59:19 +0000 (03:59 -0400)]
avoid downward vcache pressure when entries are free

we try to keep VCACHE_FREE entries free. if there's already that many free,
do nothing.

Reviewed-on: http://gerrit.openafs.org/4595
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit fd545c51fe34b1452f09d4fbf6458f5b1557e895)

Change-Id: Ia19b748596eadc75c6487d5fe854d2c7c4a4595a
Reviewed-on: http://gerrit.openafs.org/4615
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFix com_err renaming
Simon Wilkinson [Tue, 3 May 2011 09:03:22 +0000 (10:03 +0100)]
Fix com_err renaming

The pull up of 352c3e366c2e0a8de4550547192276e62afd2cc1 to the 1.6
branch missed replacing occurences of com_err with afscom_err in
the sgistuff and pam directories. Fix this so that Irix builds
again.

Change-Id: I38ab02859a7cb2ebd60e455e6db4dc2c47710766
Reviewed-on: http://gerrit.openafs.org/4614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Drop xvcache for AllocCBR
Andrew Deason [Tue, 15 Feb 2011 18:04:32 +0000 (12:04 -0600)]
libafs: Drop xvcache for AllocCBR

Normally when we AllocCBR, we are holding xvcache write-locked, since
it is called from FlushVCache. Before
a309e274632993c5aeec04c6e090f5ac95837a40, when AllocCBR needs to flush
CBRs due to a lack of space, we hit the net, giving up callbacks on
fileservers.

This can cause a problem if one of those fileservers needs to contact
us in order to complete that request, since the callback service
thread may be waiting for xvcache, causing a deadlock (that is
eventually broken by network timeouts).

To avoid this, drop xvcache if AllocCBR looks like it does not have
sufficient space. Fix all callers of afs_FlushVCache to handle the
case where we sleep, since with this change, afs_FlushVCache can sleep
on all platforms.

This partially reverts a309e274632993c5aeec04c6e090f5ac95837a40, as it
contains an alternative method of avoiding the xvcache lock in this
situation. This commit restores much of the code path to be much more
similar to how it used to be, except that it allows for dropping
xvcache for AllocCBR. This should make any change to our prior
behavior smaller/simpler, and thus safer and more consistent with
existing clients. This reintroduces the hard limit to how much space
we allocate for CBRs, although the part of
a309e274632993c5aeec04c6e090f5ac95837a40 that raised this limit is
retained.

Reviewed-on: http://gerrit.openafs.org/3958
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 76158df491f47de56d1febe1d1d2d17d316c9a74)

Change-Id: I6d2d7512682b93e6524f8f60bb8e15818d888e00
Reviewed-on: http://gerrit.openafs.org/4603
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Use vcount, not maxvcount to trim vcaches
Andrew Deason [Thu, 28 Apr 2011 16:48:18 +0000 (11:48 -0500)]
libafs: Use vcount, not maxvcount to trim vcaches

Every five minutes we afs_ShakeLooseVCaches to try and return the
number of vcaches in use down to the originally configured -stat level
(when we are using dynamic vcaches). We should calculate how many
vcaches to flush based on the number of currently active vcaches
(afs_vcount), not the peak number (afs_maxvcount). Otherwise, once we
exceed the configured -stat level, we will always keep trying to flush
numerous vcaches, even if we barely have any vcaches in use.

Reviewed-on: http://gerrit.openafs.org/4584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2a2206bfe16815a6625fee4d37520e9676d88ab4)

Change-Id: I80cfbf31ba81d7cf23013c0efcea0b8ac8c341db
Reviewed-on: http://gerrit.openafs.org/4602
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: Don't read pages beyond the cache eof
Simon Wilkinson [Mon, 25 Apr 2011 18:18:39 +0000 (14:18 -0400)]
Linux: Don't read pages beyond the cache eof

If we attempt to read past the end of the current cache file (for
example, when we're extending the file with ftruncate), don't force
the backend filesystem to populate that page with non-existent data.

This will hopefully fix a bus error when using tmpfs as a backing
cache.

FIXES 128452

Reviewed-on: http://gerrit.openafs.org/4562
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 79d5b5cce65b10134004c4cb2b7b34ac509cba6a)

Change-Id: Id9956be824a4c4d8db7deb65403f4d9740758e42
Reviewed-on: http://gerrit.openafs.org/4600
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Improve deleted client log messages
Andrew Deason [Wed, 27 Apr 2011 21:24:46 +0000 (16:24 -0500)]
viced: Improve deleted client log messages

Change the information logged related to deleted clients to be a
little more useful. In particular this includes adding the client and
host refcounts, to help see if the cause is a reference count leak.

Reviewed-on: http://gerrit.openafs.org/4583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 047cc473037efa62fa7698878e055ca4665e85ef)

Change-Id: I3bfcf49587f826129979b81de95b92cb2b332790
Reviewed-on: http://gerrit.openafs.org/4593
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Avoid ref leak on origin callback break
Andrew Deason [Wed, 27 Apr 2011 19:23:43 +0000 (14:23 -0500)]
viced: Avoid ref leak on origin callback break

When breaking a callback, sometimes we send a callback to the host
that performed the callback-inducing operation. When we do this,
currently BreakCallBack gives the origin host structure to
MultiBreakCallBack_r, which avoids releasing that host after the
callback is broken.

However, BreakCallBack obtains a reference to every host to which it
delivers a callback, even if it is the origin host, so a reference is
leaked. Fix this by not ever passing a host to MultiBreakCallBack_r,
and just have MultiBreakCallBack_r release a reference for every host
to which it delivers a callback break.

FIXES 129376

Reviewed-on: http://gerrit.openafs.org/4581
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit af175ce2c7a4785ef1992d096adfdb27daa86ee4)

Change-Id: Ifd59c8ce93939f7b23e9f64bd7c0e527d3a2fa52
Reviewed-on: http://gerrit.openafs.org/4592
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Transfer host ref in h_FindClient_r
Andrew Deason [Wed, 27 Apr 2011 18:51:23 +0000 (13:51 -0500)]
viced: Transfer host ref in h_FindClient_r

In h_FindClient_r, we can change which client structure we're dealing
with if we find a different client struct in the Rx conn-specific
data. We adjust the refcounts for the client structures themselves,
but not the associated hosts. While the host structures should be the
same most of the time, we are not guaranteed that, so adjust their
refcounts as well.

Reviewed-on: http://gerrit.openafs.org/4580
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9a4e3ade396583d412a85c4e03238d18d5c533ee)

Change-Id: I9ec5ed707ef6b726c358fcaa46d81b9ea1a17ce7
Reviewed-on: http://gerrit.openafs.org/4591
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Release all hosts in h_Enumerate*
Andrew Deason [Sat, 23 Apr 2011 21:52:30 +0000 (16:52 -0500)]
viced: Release all hosts in h_Enumerate*

h_Enumerate and h_Enumerate_r were not releasing all of the holds they
obtained when the callback function caused the enumeration to bail
early. Correct them so all host holds are released.

Reviewed-on: http://gerrit.openafs.org/4530
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 211e906c86be9ad9cba324e776d56093579b6653)

Change-Id: Iceb1e2961e9bbb11640c6fccdeb8713a9657df99
Reviewed-on: http://gerrit.openafs.org/4534
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Print a warning when using a deleted client
Andrew Deason [Sat, 23 Apr 2011 21:44:41 +0000 (16:44 -0500)]
viced: Print a warning when using a deleted client

We should never get a deleted client back from GetClient. Log a
message if we do, to explain why access may suddenly appear to fail,
and assist in determining why.

Note that we still try to service the request, since the accessing
user may still have enough access to do whatever was requested.

Reviewed-on: http://gerrit.openafs.org/4529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8b07814e037d19dc9868dd202e82d69b96fbdcae)

Change-Id: I0b1d9fe46e5b83b93b59ff6facc2421db9136c12
Reviewed-on: http://gerrit.openafs.org/4533
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Force valid host enumeration flags
Andrew Deason [Sat, 23 Apr 2011 21:32:10 +0000 (16:32 -0500)]
viced: Force valid host enumeration flags

Make sure that the callback functions for h_Enumerate and
h_Enumerate_r give us back valid flags values by aborting if they
return an invalid value.

Reviewed-on: http://gerrit.openafs.org/4528
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 484b5b4cf4f88a9ddd04cdbe870d9c2959ef266c)

Change-Id: Ia1b7537d7988203bd8c0bbc619c04f5b3f9387a1
Reviewed-on: http://gerrit.openafs.org/4532
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agodoc: Fix 'vos endtrans' copyright
Andrew Deason [Thu, 28 Apr 2011 18:55:09 +0000 (13:55 -0500)]
doc: Fix 'vos endtrans' copyright

SNA owns this, not me.

Reviewed-on: http://gerrit.openafs.org/4586
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c7212aaaf155f60e28bf592a13e5a50c960e5017)

Change-Id: Ib260b89ced9616d31242237048a900616ca9820b
Reviewed-on: http://gerrit.openafs.org/4601
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: Fix caching of non-existing vols
Jeffrey Altman [Sun, 1 May 2011 04:11:13 +0000 (00:11 -0400)]
Windows: Fix caching of non-existing vols

In cm_UpdateVolumeLocation() the conditional that would
trigger the immediate return of CM_ERROR_NOSUCHVOLUME
was backwards which prevented the caching from working.

cm_CheckOfflineVolumes() is called by the daemon thread
to reset the status of offline volumes.  Non-existing
volumes are by definition offline and cannot be brought
online.  Therefore, the cm_CheckOfflineVolumes() function
should skip volumes with the CM_VOLUMEFLAG_NOEXIST flag
set.

Change-Id: I65534b78842b4887d2fde67162a9d854437001ed
Reviewed-on: http://gerrit.openafs.org/4597
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4598
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRename libcom_err to libafscom_err
Ben Kaduk [Sun, 19 Dec 2010 04:52:43 +0000 (23:52 -0500)]
Rename libcom_err to libafscom_err

We no longer provide a compatible libcom_err, and in fact
we renamed the symbols in our libcom_err several years ago
to reflect this fact.
When we build on a system where KRB5_LIBS includes
-lkrb5 -lcom_err , the new Unix build system will pick up
our libcom_err (as $(AFS_LDFLAGS) is the first argument in
AFS_LDRULE and pulls in a linker search path for our libcom_err)
which does not provide all the needed symbols for libkrb5.

Fully rename our libcom_err away to avoid these conflicts.

FIXES 128640

Reviewed-on: http://gerrit.openafs.org/3547
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 352c3e366c2e0a8de4550547192276e62afd2cc1)

Change-Id: I3aa116d280fe1b0efdfda79787f53fbee336a4e3
Reviewed-on: http://gerrit.openafs.org/4572
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agomacos: further next version support
Derrick Brashear [Tue, 26 Apr 2011 14:46:41 +0000 (10:46 -0400)]
macos: further next version support

try to optimize out things which will be missing

Reviewed-on: http://gerrit.openafs.org/4569
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a33f77b6e11214326f5e752de171602c0e9efe86)

Change-Id: Ie20120aad8cb477d532594b9462aca3cf993aabb
Reviewed-on: http://gerrit.openafs.org/4571
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoIRIX: set vfs pointer when creating new vcaches
Derrick Brashear [Tue, 26 Apr 2011 02:23:40 +0000 (22:23 -0400)]
IRIX: set vfs pointer when creating new vcaches

add missing call to set our vfsp on irix.

Reviewed-on: http://gerrit.openafs.org/4561
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7d72a8c5c4b9df417c9337c01e8a7f26d8f6280b)

Change-Id: If0cccaa47f1110eca347734bfbaedc0456e53b21
Reviewed-on: http://gerrit.openafs.org/4579
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoLinux: Fix fallout from path_lookup commit
Marc Dionne [Wed, 30 Mar 2011 22:32:04 +0000 (18:32 -0400)]
Linux: Fix fallout from path_lookup commit

Fix a few issues with the recent commit to deal withg the removal
of path_lookup, spotted on RHEL 5:
- the configure tests needs fs.h to be included before namei.h, to
get the definition of struct inode
- we need to avoid the use of struct path unless its needed; on
older kernels the structure doesn't exist

(cherry-picked from commit f2e91cc3fe61956e7661eae9da82ddf746e63824)

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