openafs.git
13 years agorx: remove spurious compare for maxDgramPackets
Chas Williams (CONTRACTOR) [Wed, 20 Oct 2010 13:06:35 +0000]
rx: remove spurious compare for maxDgramPackets

maxDgramPackets is initially assigned this value after correcting
for the wire endian.  This compare is harmless on little endian
since the network endian value will typically be huge and redundant
on big endian machines.

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

13 years agoAllow private implementations of osi_AllocSmall/LargeSpace
Chas Williams (CONTRACTOR) [Mon, 4 Oct 2010 19:08:10 +0000]
Allow private implementations of osi_AllocSmall/LargeSpace

NBSD seemed to already do this at one point but was partly disabled.
This patches generalizes this feature by adding a define to disable the
standard pool macros.  Linux's slab based allocator should out perform
this single threaded allocator/pool.

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

13 years agoatomic mutex don't recursive enter
Derrick Brashear [Tue, 19 Oct 2010 14:06:02 +0000]
atomic mutex don't recursive enter

enter pairs with exit, and not, say, enter

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

13 years agovutil use lockfile mutex macros for lockfile mutex
Derrick Brashear [Fri, 15 Oct 2010 20:27:55 +0000]
vutil use lockfile mutex macros for lockfile mutex

we have macroes; let's use them. makes later changes easier.

Change-Id: If128930f659c34592c27503a02d64b67d7f60a84
Reviewed-on: http://gerrit.openafs.org/2996
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoafs assert should use afs abort
Derrick Brashear [Sun, 17 Oct 2010 22:11:52 +0000]
afs assert should use afs abort

we already have a portability abort macro. use it.

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

13 years agorx: Simplify round trip time calculation
Simon Wilkinson [Mon, 11 Oct 2010 17:25:38 +0000]
rx: Simplify round trip time calculation

Move the logic for deciding whether to compute RTT out of PeerNetStats
and into the callers. This means that we can share decisions about
whether a packet is ACK'd or not, and avoid uneccessary multiple tests
and function calls.

This change also stops us from computing RTT times for packets outside
of the set of explicit ACKs that we have received. This means that we
no longer compute RTTs for packets that are on the transmit queue, but
not yet on the wire.

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

13 years agoRX: Add rx_InterruptCall
Andrew Deason [Fri, 8 Oct 2010 20:39:21 +0000]
RX: Add rx_InterruptCall

Add rx_InterruptCall, to cause a call to error out and wakeup anyone
waiting to write or read to that call.

Change-Id: I0747ac9107dac6b9a6d8b8c59120a756416aad58
Reviewed-on: http://gerrit.openafs.org/2982
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoRx: Do not compute RTT on non-last packets of a jumbogram
Jeffrey Altman [Sat, 16 Oct 2010 17:14:03 +0000]
Rx: Do not compute RTT on non-last packets of a jumbogram

A jumbogram is constructed as a series of rx packets that are
all sent at once and acknowledged at the same time.  Computing the
RTT for all of the packets that makes up the jumbogram provides
the jumbogram RTT more weight than for a non-jumbogram packet.
To restore fairness, only compute the RTT for the last packet of
a jumbogram.  The non-last packets with have the RX_JUMBO_PACKET flag
set in the packet header.

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

13 years agoRx: Reject out of order ACK packets
Simon Wilkinson [Mon, 11 Oct 2010 17:14:02 +0000]
Rx: Reject out of order ACK packets

Our RX implementation virtually guarantees that we will see out of
order ACK packets, even on well behaved networks, as we send acks
simultaneously from multiple threads.

Currently we only reject out-of-order ACKS which change the window
position (so a window that advances, can never go back). However,
we fail to deal with the explicit acknowledgement portion of the ACK
packet in the same way...

For example, if we have a packet A that acknowledges packets 1 and 2,
and then a packet B acknowledging 1,2,3 and 4. If B arrives before A,
then we mark 1, 2, 3, 4 as acknowledged, and then treat the arrival of
A as nAcking 3 and 4. This has the same effect as an explicitly stated
nack, triggers an early and unnecessary resend and may, in some situations,
cause the call to go into congestion avoidance.

We can solve this using the previousPacket field of the ACK. This
indicates the last packet seen by the peer. In the same way as
firstPacket, this should never go backwards, and so can be used to
detect out of order acknowledgements, and reject them.

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

13 years agoshakeloosevcaches drop xvcache during dentry ops
Derrick Brashear [Thu, 7 Oct 2010 17:41:22 +0000]
shakeloosevcaches drop xvcache during dentry ops

denote that we slept and drop xvcache while doing dentry
flushing.

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

13 years agorename afs/assert.h to afs/afs_assert.h
Derrick Brashear [Fri, 15 Oct 2010 20:09:27 +0000]
rename afs/assert.h to afs/afs_assert.h

provide a private assert header which does not
pollute the normal namespace for the assert header.

further changes will modify pthread operations to not use
generic assert as a "did it work", which breaks if NDEBUG is set

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

13 years agopts: Specifically check for group id 0
Andrew Deason [Fri, 15 Oct 2010 21:35:32 +0000]
pts: Specifically check for group id 0

For consistency with the code checking user ids in createuser, check
for a specified group id of 0 specifically and give a slightly
different error message for it.

Change-Id: I362302a1a59fbe324f7f3e926f02177c24a5577d
Reviewed-on: http://gerrit.openafs.org/2994
Reviewed-by: Phillip Moore <w.phillip.moore@gmail.com>
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>

13 years agopts: Prevent creating negative user ids
Andrew Deason [Fri, 15 Oct 2010 21:37:55 +0000]
pts: Prevent creating negative user ids

User ids cannot be negative (those are groups). So, error out if a
negative id is specified for createuser.

FIXES 128343

Change-Id: I6e81a419c797944bfed569aac529b9694702823d
Reviewed-on: http://gerrit.openafs.org/2993
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Phillip Moore <w.phillip.moore@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoReturn SRV record ports in network byte order
Russ Allbery [Thu, 14 Oct 2010 20:41:45 +0000]
Return SRV record ports in network byte order

Convert the port extracted from the SRV record return to network byte
order before assigning it to the port array.

The port in a SRV record is extracted by pulling out the high byte
and low byte and then mathematically combining them, which implicity
converts from network byte order to host byte order.  However, the
callers of afsconf_LookupServer expect the port array to be returned
in network byte order since ports are assigned without modification
to the .sin_port field of a struct sockaddr_in.  See also the byte
order of the default afsdbPort value.

Reported by Jan Christoph Nordholz (Debian Bug#600228).

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

13 years agoadd objc build rules to make-type makefiles
Derrick Brashear [Fri, 15 Oct 2010 15:28:34 +0000]
add objc build rules to make-type makefiles

sadly this needs to be here unless we want os-specific includes
of e.g. shared, lwp, pthreads makefiles for extra rules. as long
as no .m files are built in generic makefiles, this is a reasonable
approach.

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

13 years agoOSX prefspane use Kerberos Preferences for defaults
Derrick Brashear [Tue, 12 Oct 2010 13:05:24 +0000]
OSX prefspane use Kerberos Preferences for defaults

if we have forwardable tickets, e.g., as a pref, get those.
and so on. this way tickets AFS got are not "Weird"

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

13 years agoRx: use osi_Assert/osi_Panic instead of assert
Jeffrey Altman [Thu, 14 Oct 2010 21:24:33 +0000]
Rx: use osi_Assert/osi_Panic instead of assert

Avoid using the openafs src/util/assert.h implementation for Rx
and Rx security classes.  Use the built-in osi_Assert() and osi_Panic()
functionality instead.  This avoids all references to assert.h except
for rx_pthread.c (Unix only) which requires it for the assert()
references in the src/util/pthread_nosigs.h macros.

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

13 years agoUtil: include assert.h in pthreads_nosig.h when required
Jeffrey Altman [Thu, 14 Oct 2010 22:18:40 +0000]
Util: include assert.h in pthreads_nosig.h when required

If assert() will be used within pthreads_nosig.h, include assert.h.
Also, permit assert() to be a macro that is a no-op by always evaluating
the expression.

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

13 years agoRx: fix dpf() usage with regard to trailing \n's
Chas Williams (CONTRACTOR) [Thu, 14 Oct 2010 20:15:51 +0000]
Rx: fix dpf() usage with regard to trailing \n's

instead of checking to see if we need to add a trailing newline for the
messages, just make sure dpf() is always called with one.

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

13 years agoLINUX/osi_vnodeops.c: minor coding style fixes
Marc Dionne [Thu, 14 Oct 2010 22:45:32 +0000]
LINUX/osi_vnodeops.c: minor coding style fixes

Re-indent and correct a few coding style issues in this section
of code.  In particular, it clears up possible confusion on the
scope of the preceding if statement.

Purely cosmetic, no functional changes.

Change-Id: Id6dea6326c9878b41f821de00267f75195fea394
Reviewed-on: http://gerrit.openafs.org/2989
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoRx: function return type on separate line
Jeffrey Altman [Thu, 14 Oct 2010 04:56:39 +0000]
Rx: function return type on separate line

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

13 years agoParallel I/O extensions to namei backend
Andrew Deason [Thu, 11 Mar 2010 18:19:47 +0000]
Parallel I/O extensions to namei backend

This adds the ability for certain namei operations (currently only
ListViceInodes) to occur across multiple different threads in
parallel. Currently this is only enabled when built with the
not-yet-existant AFS_SALSRV_ENV.

Originally written by Tom Keiser.

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

13 years agoLinux: fix statfs configure test
Marc Dionne [Wed, 13 Oct 2010 23:11:25 +0000]
Linux: fix statfs configure test

The change to the statfs configure test that was made for 2.6.36
broke the test for older kernels.  The new test is based on a call,
and that will generate a warning but not an error when the arguments
don't match the prototype.

Take another tack, and revert to the old style test, but with the
simple_statfs function instead of vfs_statfs.

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

13 years agorx: fix typo in rx_atomic Solaris backend
Tom Keiser [Thu, 14 Oct 2010 05:34:40 +0000]
rx: fix typo in rx_atomic Solaris backend

Fix typo so rx builds again on Solaris.

Change-Id: I328e05937b376c659bb42ba8db51f512b14da6f3
Reviewed-on: http://gerrit.openafs.org/2980
Tested-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoLINUX: old kernel warning fixes
Andrew Deason [Wed, 13 Oct 2010 16:27:03 +0000]
LINUX: old kernel warning fixes

 - osi_vfsop.c: struct super_block, not superblock

 - osi_vnodeops.c: initialize bypasscache

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

13 years agodon't release Volume lightweight ref too early
Tom Keiser [Wed, 13 Oct 2010 05:10:09 +0000]
don't release Volume lightweight ref too early

FSYNC_com_VolOff was releasing its lightweight ref before the error handling
code for VGetVolumeByVp_r was executed; this code needs to dereference the
Volume pointer for some of its logic.  This was unsafe since
VCancelReservation_r() could have resulted in the Volume object being freed.
Move VCancelReservation_r() below the error handling block.  NB: the error
handling block now relies upon the goto done/deny to cancel its lightweight
ref.

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

13 years agowrong rule to make afsd_fuse
Hans-Werner Paulsen [Wed, 13 Oct 2010 13:13:51 +0000]
wrong rule to make afsd_fuse

in src/afsd/Makefile.in the rule to make afsd_fuse was not modified to
recognise CFLAGS_afsd_fuse.o

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

13 years agoLinux: fix aklog -setpag to work with ktc_SetTokenEx
Marc Dionne [Wed, 13 Oct 2010 01:05:45 +0000]
Linux: fix aklog -setpag to work with ktc_SetTokenEx

The bit of code that allows aklog -setpag to work with recent
linux needed to be moved along with the change from ktc_SetToken
to ktc_SetTokenEx.

While we're in this bit of code, make it depend on the definition
of the syscall in the user space headers instead of relying on a
kernel configure test.

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

13 years agorx: Don't count unknown packets as missing
Simon Wilkinson [Mon, 11 Oct 2010 18:08:00 +0000]
rx: Don't count unknown packets as missing

Just because a packet is in the transmit queue, don't assume that
the other side has instantly seen it! Currently, if we receive an
ACK packet which doesn't include the entire transmit queue, then we
will end backing off, even if we haven't sent the packets.

Restrict this behaviour to packets which are implicitly acked (or
otherwise) by the sender.

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

13 years agoRx: Consolidate wait for tq busy and make its use uniform
Jeffrey Altman [Tue, 12 Oct 2010 14:53:43 +0000]
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.

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

13 years agorx: Don't malloc the xmit list
Simon Wilkinson [Sun, 10 Oct 2010 12:04:41 +0000]
rx: Don't malloc the xmit list

Building the transmit list happens in a time critical section of
code. Using malloc to allocate the list which holds the packets to
be transmitted slows down this critical section. Instead, just
allocate the space as part of the call structure.

Locking of xmitList is somewhat tricksy, as the call->lock is
dropped over calls to sendmsg(). However, the xmitList is protected
by the TQ_BUSY call flag, which prevents multiple threads from
usign the transmit queue, and hence the xmitList, simultaneously.

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

13 years agoRX: Force sane timeout values
Andrew Deason [Fri, 8 Oct 2010 16:51:30 +0000]
RX: Force sane timeout values

Currently we do not check the specified timeout values when someone
changes a connection's dead, idle, or hard dead time. However, if the
conn's dead time is larger than the other two times, a loss of network
activity will result in one of the other timeouts getting triggered
first.

To prevent this and possibly other problems from happening, force a
connection's timeouts to always obey the relationship
secondsUntilDead <= idleDeadTime <= hardDeadTime, by checking these
values whenever they are changed.

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

13 years agoRX: Adjust all timeouts for RTT
Andrew Deason [Wed, 6 Oct 2010 22:24:02 +0000]
RX: Adjust all timeouts for RTT

Previously only the deadTime RX network timeout was getting adjusted
for the peer's rtt and rtt_dev values. Do this for the idle and hard
timeouts as well, since a higher RTT is going to make everything
potentially take longer.

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

13 years agoupdate fssync-debug to handle the VOL_LOCKED flag
Tom Keiser [Wed, 13 Oct 2010 06:15:36 +0000]
update fssync-debug to handle the VOL_LOCKED flag

Allow fssync-debug to dump the VOL_LOCKED flag, rather than the
current behavior of printing absolutely nothing when this flag
is asserted.  In addition, increase the flag buffer size since
it turns out we would truncate if all nine flags were asserted
at once.

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

13 years agotrailing commas make xlc a sad panda
Tom Keiser [Wed, 13 Oct 2010 05:27:56 +0000]
trailing commas make xlc a sad panda

IBM VAC xlc_r throws parse errors when enumeration definitions have
trailing commas; let's avoid that.

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

13 years agoUse bigger I/O sizes for the memcache
Chas Williams (CONTRACTOR) [Thu, 7 Oct 2010 15:05:50 +0000]
Use bigger I/O sizes for the memcache

There doesn't seem to be a need to limit the rx message size when
using rx_WritevAlloc.  If there arent enough rx buffers to hold
the entire message at once, it will simply return less space.

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

13 years agohcrypto: Tidy up some merge conflicts
Simon Wilkinson [Mon, 11 Oct 2010 19:18:06 +0000]
hcrypto: Tidy up some merge conflicts

There were some (harmless) merge conflicts in the hcrypto Makefile.
Get rid of them.

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

13 years agoLINUX: Build fixes for older kernels
Andrew Deason [Thu, 7 Oct 2010 16:04:04 +0000]
LINUX: Build fixes for older kernels

Error and warning fixes for older kernels in osi_compat.h:

 - In afs_posix_test_lock, remove the assignment in the conditional to
   silence a warning

 - Call getsockopt for kernel_getsockopt, instead of setsockopt

 - Missing end brace in afs_try_to_freeze

 - Prototype find_exported_dentry, since Linux doesn't give us one

Change-Id: Iae56bb0b0405bfd23dfd68a22c1d7922663b1442
Reviewed-on: http://gerrit.openafs.org/2946
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agorx: Don't call gettimeofday for every packet ack
Simon Wilkinson [Tue, 5 Oct 2010 20:21:38 +0000]
rx: Don't call gettimeofday for every packet ack

Every time we receive an ACK packet, we call gettimeofday() for
every entry in the transmit queue that's permanently ack'd by that
packet. Instead, just make a note of the time when we start
processing the packet queue, and use it for every packet in the
queue.

This shaves around 5% off rxperf's runtime with a window size of 128.

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

13 years agoWindows: Build hcrypto shared library
Jeffrey Altman [Mon, 11 Oct 2010 19:11:52 +0000]
Windows: Build hcrypto shared library

Build a single afshcrypto.dll shared library on Windows.
There are no lwp vs pthread differences on Windows due to
the use of the Windows random data sources.

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

13 years agoWindows: Cleanup build scripts; no include\afs or include\rx
Jeffrey Altman [Mon, 11 Oct 2010 19:00:08 +0000]
Windows: Cleanup build scripts; no include\afs or include\rx

As part of the build system cleanup, minimize the number of
directories in which include\afs and include\rx paths are included
by default.  To acheive this goal the windows openafs dirent.h is
moved from include\afs to include, references whenever possible to
openafs headers included in include\afs or include\rx are prefixed
with afs\ or rx\ as appropriate.

Some source files or directories have a broad range of interdependencies
that make separation quite challenging.  For those directories or files
the inclusion of the path is added at the smallest possible level.
At some point in the future the WINNT\afsd\ headers should be moved
from include\afs to include\WINNT and should be installed there first
and then referenced internally from that location instead of from the
WINNT\afsd directory.  That will permit further cleanup to be performed.

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

13 years agoFix rxperf includes
Simon Wilkinson [Mon, 11 Oct 2010 19:15:04 +0000]
Fix rxperf includes

Don't use raw includes for "rx.h" and friends - instead include them
from the appropriate place in our include tree.

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

13 years agorx: Indent dpf definition
Simon Wilkinson [Mon, 11 Oct 2010 17:40:41 +0000]
rx: Indent dpf definition

Indent the CPP macros that define dpf() so that it's a little bit
clearer what's going on.

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

13 years agoImport of code from heimdal
Heimdal Developers [Mon, 11 Oct 2010 18:43:48 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
bf1f62b0a8cf72d32875656a7365f1e14d535dc5
which is described as switch-from-svn-to-git-1605-gbf1f62b

This is locally modified to include the earlier local fix
to sha512.c

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

13 years agoHeimdal: Import rand-w32.c for hcrypto on Windows
Simon Wilkinson [Mon, 11 Oct 2010 18:42:03 +0000]
Heimdal: Import rand-w32.c for hcrypto on Windows

Windows has its own PRNG for hcrypto, so add the necessary file to
our import list.

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

13 years agoWindows: Do not issue RXAFS change RPCs on known RO volumes
Jeffrey Altman [Sat, 9 Oct 2010 07:06:07 +0000]
Windows: Do not issue RXAFS change RPCs on known RO volumes

If the cm_scache_t is known to be on a RO volume, do not permit
RXAFS_xxx RPCs that would attempt to make a change to the volume
to be issued to the file server.  Instead, return CM_ERROR_READONLY
immediately.   This avoids triggering the abort threshold for
the current connection on the file server.

LICENSE MIT

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

13 years agoUnix: Rework build system
Simon Wilkinson [Mon, 4 Oct 2010 12:49:16 +0000]
Unix: Rework build system

Rework the unix build system so that we support taking CFLAGS and
LDFLAGS from the command line, and don't replace them with our own
settings. Also, take the opportunity to bring some sanity and
consistency into our Makefiles.

The standard Makefile.config  now defines rules for LWP, pthreaded
and shared library builds. The CFLAGS settings for these are
called LWP_CFLAGS, PTH_CFLAGS and SHD_CFLAGS, respectively.
Similarly named variables are provided for LDFLAGS.

A module may select to use a particular build type for its suffix
rule by including either Makefile.lwp, Makefile.pthread or
Makefile.shared from src/config. This creates an appropriate .c.o
suffix rule, defines AFS_CFLAGS and AFS_LDFLAGS as appropriate, and
creates two rules AFS_CCRULE and AFS_LDRULE, which can be used to
build, and link objects. For example:

foo.o: foo.c
$(AFS_CCRULE) foo.c

foo: foo.o
$(AFS_LDRULE) foo.o

If a you wish to override the CFLAGS or LDFLAGS for an object build
using these rules (or through the .c.o suffix rule) you can do so,
by defining CFLAGS_<object> or LDFLAGS_<object>. For example:

CFLAGS_foo.o= -DDEBUG
LDFLAGS_foo = -ldebugging

A module may also alter the behaviour of the compile and link steps
module wide by defining MODULE_CFLAGS or MODULE_LDFLAGS.

This functionality is now used throughout the tree:
    *) Suffix rules are used wherever possible, removing a number of
       unecessary build rules.
    *) All link steps are replaced with AFS_LDRULE
    *) All standard compile steps are replaced with AFS_CCRULE
    *) Unusal compile steps are defined, as far as possible, int
       terms of the LWP_ PTH_ and SHD_ variables.
    *) The use of $? has been removed entirely, as it makes it
       impossible to provide build rules with dependency information

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

13 years agofssync-debug: exec DAFS version if DAFS detected
Andrew Deason [Thu, 29 Jul 2010 16:06:28 +0000]
fssync-debug: exec DAFS version if DAFS detected

If the user requests something that differs depending on whether the
server is DAFS or not, try to exec the DAFS-enabled fssync-debug
(dafssync-debug) for them.

Based on a conversation with Tom Keiser.

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

13 years agoExtract the .version file when building the srpm file
Phillip Moore [Thu, 7 Oct 2010 23:25:09 +0000]
Extract the .version file when building the srpm file

If you are building the source and binary rpms from a released
tarball, instead of a real git repo, the .version file is required by
build-tools/git-version.  With out this, the version defaults to
UNKNOWN, and although the source rpm will build, it won't compile.

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

13 years agoRevert "FBSD: in lookup, when ISDOTDOT, unlock dvp"
Ben Kaduk [Fri, 8 Oct 2010 04:20:57 +0000]
Revert "FBSD: in lookup, when ISDOTDOT, unlock dvp"

This reverts commit 96e433aebdd5699f02c205df2cce38927cd19a88.

It was not properly tested, fails to compile on some systems,
and destabilizes the client.

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

13 years agoAdded missing CLI argument dropped during last commit.
Phillip Moore [Tue, 5 Oct 2010 20:10:19 +0000]
Added missing CLI argument dropped during last commit.

Oops -- when removing the -cell arguments to the bos commands, the
"admin" username argument to "bos adduser" was mistakenly removed as
well.

Change-Id: If5136869c7d2bff3340018a3110fd5408750e5a6
Reviewed-on: http://gerrit.openafs.org/2940
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoFBSD: in lookup, when ISDOTDOT, unlock dvp
Ben Kaduk [Wed, 6 Oct 2010 03:30:35 +0000]
FBSD: in lookup, when ISDOTDOT, unlock dvp

Keeping dvp locked when vp is its parent can lead to deadlock.
Always unlock dvp, not just for 6 and earlier.

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

13 years agoWindows: do not leak cm_volume_t objects from LRU queue
Jeffrey Altman [Tue, 5 Oct 2010 15:32:05 +0000]
Windows: do not leak cm_volume_t objects from LRU queue

The LRU queue is where volume objects are recycled from.
Therefore if they are removed then they must be put back.

Remove extraneous operations from cm_AdjustVolumeLRU().

LICENSE MIT

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

13 years agoQuick Start Guide updated for RHEL rpms, and CLI syntax
Phillip Moore [Tue, 5 Oct 2010 16:46:35 +0000]
Quick Start Guide updated for RHEL rpms, and CLI syntax

The names of the RHEL rpms have been updated to reflect what is
actually published on openafs.org, and the CLI syntax of the commands
run using -noauth have had the unnecessary -cell options removed.

Change-Id: I5c03d371c822d1d064660a3b00fb3d1e64bff141
Reviewed-on: http://gerrit.openafs.org/2914
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agovolserver: Do not return ENOMEM on AIX from XVolListPartitions
Christof Hanke [Tue, 5 Oct 2010 15:01:41 +0000]
volserver: Do not return ENOMEM on AIX from XVolListPartitions

When calling "vos partinfo" or "vos listpart" towards a server
 running AIX with no partitions attached, it would return a
ENOMEM, because unlike on linux, malloc(0) returns NULL on AIX.
Thus, just don't do any malloc, when we have no partitions anyway.

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

13 years agorx: Reduce dependence on call->lock
Simon Wilkinson [Sat, 2 Oct 2010 03:17:56 +0000]
rx: Reduce dependence on call->lock

This patch reduces our dependence on call->lock, by allowing more
of the reader thread to run lock free.  Doing so requires that
call->mode only be set by the reader thread.  As a result, call->mode
can only be set to RX_CALL_ERROR by rxi_CallError().  The mode is
set to RX_CALL_ERROR by the reader thread immediately after regaining
the call->lock when it has been dropped.

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

13 years agohcrypto: Fix builds on Irix
Simon Wilkinson [Tue, 5 Oct 2010 00:20:32 +0000]
hcrypto: Fix builds on Irix

The recent hcrypto pullup added a depedence on the errx() function,
which isn't present on Irix. Solve this by pulling in a load more
of libroken, in order to provide this function.

In the long term, libroken should get split out into its own
directory, and the ability to use a previously installed
libroken should be added. For now, this will hopefully get Irix on
its feet again.

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

13 years agoIrix: Make compiler less chatty
Simon Wilkinson [Tue, 5 Oct 2010 08:01:00 +0000]
Irix: Make compiler less chatty

Supress a few of our errors from the Irix compiler and linker, so its
output is a little less verbose.

This change suppresses the function declared but not used and
multiple declaration errors that we get due to our static_inline fudge
and the paramater declared but not used errors.

Other error suppression is possible - you just need the number
immediately after the 'cc-' in the build logs to say which number to
add to the -woff line.

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

13 years agoImport of code from heimdal
Heimdal Developers [Tue, 5 Oct 2010 07:20:03 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
48ad3e1e6597f03cce5439831ef94b5ec11894e9
which is described as switch-from-svn-to-git-1593-g48ad3e1

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

13 years agoYet more imports from libroken
Simon Wilkinson [Tue, 5 Oct 2010 07:19:11 +0000]
Yet more imports from libroken

Even more symbols to keep Irix content

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

13 years agoWindows: Kill AFS_LARGEFILES preprocessor symbol
Jeffrey Altman [Tue, 5 Oct 2010 12:31:22 +0000]
Windows: Kill AFS_LARGEFILES preprocessor symbol

All builds define AFS_LARGEFILES so kill the symbol and
discard the !AFS_LARGEFILES source code.

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

13 years agoKill AFS_64BIT_ENV
Simon Wilkinson [Thu, 30 Sep 2010 12:58:26 +0000]
Kill AFS_64BIT_ENV

The AFS_64BIT_ENV was being pretty much universally defined. So,
remove the definition, and the conditional code that it controlled.
From this point on, all platforms are assumed to be capable of
handling 64bit values.

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

13 years agoRevert "util: Add base64 from Heimdal's roken"
Simon Wilkinson [Tue, 5 Oct 2010 12:15:49 +0000]
Revert "util: Add base64 from Heimdal's roken"

This reverts commit d552426b14d5f5befe74958a21bc9375d5312287.

util already has a base64.c, the Windows bits of this are half-baked,
and we need to find a config.h from somewhere so that this builds
cleanly.

Just back it out, until I can do it properly.

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

13 years agoImport of code from heimdal
Heimdal Developers [Tue, 5 Oct 2010 00:01:34 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
48ad3e1e6597f03cce5439831ef94b5ec11894e9
which is described as switch-from-svn-to-git-1593-g48ad3e1

This import was manually modified to preserve our current local
fix for sha512.c

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

13 years agoImport yet more files from Heimdal
Simon Wilkinson [Mon, 4 Oct 2010 23:59:43 +0000]
Import yet more files from Heimdal

Import still more files from Heimdal, so that we can try to make
Irix happy once more. Mutter, mutter, mutter.

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

13 years agoHeimdal: Fix 32bit build problems
Simon Wilkinson [Mon, 4 Oct 2010 19:22:50 +0000]
Heimdal: Fix 32bit build problems

The earlier inclusion of sha512 from Heimdal broke the build on
32bit platforms, because this file doesn't flag 64bit constants as
being such.

The correct place for this fix is in Heimdal, and it will be replaced
with a fix from Heimdal as soon as one is available. For now though,
this gets our build going again.

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

13 years agovol: Log ignored dirs that look like partitions
Andrew Deason [Sun, 3 Oct 2010 23:27:19 +0000]
vol: Log ignored dirs that look like partitions

If we see a /vicep*-like directory when we VAttachPartitions, and we
ignore it because it lacks an AlwaysAttach, log that we ignored it.
This may make things less confusing to admins that just try to create
a /vicep* directory and don't know why it doesn't work.

Feature suggested by Jason Edgecombe.

FIXES 128221

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

13 years agoutil: Add base64 from Heimdal's roken
Simon Wilkinson [Mon, 4 Oct 2010 14:24:15 +0000]
util: Add base64 from Heimdal's roken

Add the base64 code from libroken into libutil, using the src/external
framework.

Create a new, non-installed directory, to hold util headers, rather than
continuing to stuff everything into afs/

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

13 years agohcrypto: Build fixes
Simon Wilkinson [Mon, 4 Oct 2010 15:01:55 +0000]
hcrypto: Build fixes

Fix the hcrypto build to deal with the changes introduced by the
latest import from Heimdal

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

13 years agoImport of code from heimdal
Heimdal Developers [Mon, 4 Oct 2010 13:25:11 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
48ad3e1e6597f03cce5439831ef94b5ec11894e9
which is described as switch-from-svn-to-git-1593-g48ad3e1

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

13 years agoAdd more files from Heimdal
Simon Wilkinson [Mon, 4 Oct 2010 14:18:02 +0000]
Add more files from Heimdal

Add the base64 implementation from libroken, and the n-fold.c file
from libkrb5 to the list of source files that we import from Heimdal.

It also pulls in the new sha512.c and validate.c files which are now
necessary to complete a userspace hcrypto build.

This patch will fail to build until the build fixes from the subsequent
change are applied.

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

13 years agoconfigure: Restore saved CFLAGS
Simon Wilkinson [Mon, 4 Oct 2010 11:33:24 +0000]
configure: Restore saved CFLAGS

When we test for whether the C compiler can take the
-fno-strength-reduce flag, we add the flag to CFLAGS to do so.
However, we were not restoring the old value of this flag when we
completed the test, and so we were always setting -fno-strength-reduce
in the userspace compile.

Previously, this was harmless, as we always overwrote CFLAGS, but if
we're moving to a world where we honour the user's setting of CFLAGS,
we need to not leak changes in this way.

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

13 years agoconfigure: Don't let autoconf pick our CFLAGS
Simon Wilkinson [Mon, 4 Oct 2010 12:45:53 +0000]
configure: Don't let autoconf pick our CFLAGS

If the user hasn't specified CFLAGS on the command line to
./configure, then autoconf will set them to -g -O2 if the compiler
supports those options.

For compatibility with what OpenAFS has always done, and to let us
manually set optimisation and debugging flags later, disable this
behaviour.

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

13 years agovos release: Force full dump on RO_DONTUSE sites
Andrew Deason [Fri, 10 Sep 2010 20:52:34 +0000]
vos release: Force full dump on RO_DONTUSE sites

When releasing a volume, currently we perform an incremental dump on
RO_DONTUSE sites if the volume exists on the remote site. Since
RO_DONTUSE implies that we do not expect a site to exist there, delete
the extant volume if we find one and force a full dump.

If we perform an incremental dump, we run the risk of incrementally
dumping to a temporary volume that the administrator is not aware of,
and doesn't have any actual data but has a last update time late
enough that it may be missing some data after the incremental dump. So
to avoid that, force a full dump every time.

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

13 years agosin_family is not network order
Chas Williams (CONTRACTOR) [Sun, 3 Oct 2010 18:35:46 +0000]
sin_family is not network order

sin_family isnt sent over the network and therefore doesnt need
htons().  sin_family is essential the same as domain, and no one
does socket(htons(AF_INET), ...)

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

13 years agoRemove duplicate rx_stats targets in libuafs Makefile
Marc Dionne [Sun, 3 Oct 2010 18:35:20 +0000]
Remove duplicate rx_stats targets in libuafs Makefile

The libuafs part of commit 4346144b was not needed, rx_stats was
already in the Makefile.  Harmless, but generates warnings.

Revert the libuafs portion of that commit.

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

13 years agorx stats atomic inclusion needs kmutexes for emulation
Derrick Brashear [Sun, 3 Oct 2010 06:02:22 +0000]
rx stats atomic inclusion needs kmutexes for emulation

for platforms with no native atomics we use a mutex. well,
fine, but without defining kernel mutexes, that doesn't work so
well.

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

13 years agoWindows: Ensure that cm_NameI errors are acted upon promptly
Jeffrey Altman [Wed, 15 Sep 2010 23:06:22 +0000]
Windows: Ensure that cm_NameI errors are acted upon promptly

There are many cases in the SMB server where an error from cm_NameI()
was either ignored or not acted upon until several other operations
are performed that could result in the same error being repeated.
This is a mistake which did not have negative side effects until
additional checks for callback status were added recently.

At present, if a CM_ERROR_ACCESS error is returned and ignored,
subsequent attempts to operate on the same cm_scache_t will result
in additional queries to the file server that will also end in an
abort response.  This can trigger the file server to delay responses
to the client.

This patchset ensures that all cm_NameI() errors are acted upon
promptly.

LICENSE MIT

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

13 years agoWindows: Fix Parent(path) computation to permit mp and symlink creation
Jeffrey Altman [Wed, 15 Sep 2010 23:01:06 +0000]
Windows: Fix Parent(path) computation to permit mp and symlink creation

The parent path computation was leaving trailing slashes on the
path names which prevented the creation of mount points and symlinks
when UNC paths were used that contained mount points.

LICENSE MIT

Change-Id: I50cba9cb8a2b0ad45f84995d05f368052be683cc
Reviewed-on: http://gerrit.openafs.org/2886
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

13 years agoConditionalize include of string.h in rx_stats.c
Marc Dionne [Sun, 3 Oct 2010 00:32:05 +0000]
Conditionalize include of string.h in rx_stats.c

Linux doesn't have <string.h>, it's in the linux subdirectory.  But
it is already included by sysincludes.h, so it should not be needed
here.

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

13 years agoLinux: correct use of atomic_add and atomic_sub functions
Marc Dionne [Sun, 3 Oct 2010 01:02:23 +0000]
Linux: correct use of atomic_add and atomic_sub functions

The rx_atomic_add and rx_atomic_sub functions have arguments
reversed compared to the linux atomic_add and atomic_sub.

Adjust the macros to flip the arguments when calling them

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

13 years agoRx: Fix RXDEBUG_PACKET builds
Jeffrey Altman [Sat, 2 Oct 2010 15:43:03 +0000]
Rx: Fix RXDEBUG_PACKET builds

Commit 37946ee1739aa22cb2f7330a37504d33a7733c9a unintentionally
broke RXDEBUG_PACKET builds.  Fix it.

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

13 years agoRx: raise rx_minPeerTimeout to 20ms
Jeffrey Altman [Sat, 2 Oct 2010 03:47:11 +0000]
Rx: raise rx_minPeerTimeout to 20ms

At 2ms it is possible for the packet we are sending to be resent
just about immediately as the retryTime computation occurs before
the send takes place and not afterwards.  If the network send blocks,
the retryTime may have already expired.

We do not want rx_minPeerTimeout to be too large though because the
value will end up being used as the backoff time period when the
actual RTT for the connection is less than the rx_minPeerTimeout
value.  Extensive testing shows 20ms to be an adequate compromise
that avoids the vast majority of unnecessary resends without
unnecessarily slowing down the connection if a packet is in fact
lost.

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

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

When all of the packets for a call have been received,
immediately send an ack all packet to the peer.  This permits
the peer to free the contents of the transmit queue and cancel
all pending resend events.

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

13 years agoRx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex
Jeffrey Altman [Wed, 22 Sep 2010 23:36:03 +0000]
Rx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex

Add a new global mutex rx_refcnt_mutex to protect the conn->refCount
and call->refCount in place of relying upon the conn->conn_data_lock
and the call->lock.

This will relieve some lock contention with rx_ReceivePacket().

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

13 years agodarwin kernel atomics
Derrick Brashear [Sat, 2 Oct 2010 16:43:36 +0000]
darwin kernel atomics

actually enable atomics for the darwin kernel, whose API is
just slightly different

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

13 years agoadd rxstats to kernel
Derrick Brashear [Sat, 2 Oct 2010 16:59:46 +0000]
add rxstats to kernel

add split out rxstats module to kernel

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

13 years agoadd option to rxperf to use rx_Readv() instead of rx_Read()
Chas Williams (CONTRACTOR) [Fri, 1 Oct 2010 13:40:16 +0000]
add option to rxperf to use rx_Readv() instead of rx_Read()

rx_Readv() is a bit "faster" than rx_Read() and typically used by most
afs transaction.

server% rxperf server
client% rxperf client -c send -s server
SEND: threads   1, times        100, bytes      1048576:            2073 msec

server% rxperf server -v
client% rxperf client -c send -s server
SEND: threads   1, times        100, bytes      1048576:             983 msec

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

13 years agoWindows: Pass Volume Root Fid to cm_Analyze after RXAFS_GetVolumeStatus
Jeffrey Altman [Sat, 2 Oct 2010 04:49:38 +0000]
Windows: Pass Volume Root Fid to cm_Analyze after RXAFS_GetVolumeStatus

RXAFS_GetVolumeStatus can return VNOVOL, VMOVED, etc.  In order to
process them and update volume state a fid must be passed to cm_Analyze().
Use the volume root fid.

LICENSE MIT

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

13 years agoProvide an abstract thread pool object
Andrew Deason [Thu, 11 Mar 2010 16:43:54 +0000]
Provide an abstract thread pool object

Add some routines to maintain a pool of threads, for working through a
Vwork_queue.

This adds the afs_tp* series of functions. Originally written by
Tom Keiser.

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

13 years agoProvide an abstract work queue object
Andrew Deason [Thu, 11 Mar 2010 16:39:56 +0000]
Provide an abstract work queue object

Add some routines for specifying chunks of work to be done. The idea
is to be able to pass these to different threads, and specify
dependencies between them, wait on them completing, etc.

This adds the afs_wq* family of functions. Originally written by Tom
Keiser.

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

13 years agoexempt instant timeouts from mtu discovery
Derrick Brashear [Fri, 1 Oct 2010 03:57:11 +0000]
exempt instant timeouts from mtu discovery

if we set lastReceiveTime to 0 to hint that no net, honor that here as
"just time out"

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

13 years agoDAFS: Raise LogLevel for per-chain vol stats
Andrew Deason [Tue, 14 Sep 2010 14:45:10 +0000]
DAFS: Raise LogLevel for per-chain vol stats

Only report detailed per-chain volume statistics on shutdown/SIGXCPU
if LogLevel is 125 (or 25 for smaller per-chain stats). If a
fileserver is configured with a large -vhashsize, printing out stats
for each chain can take awhile and use up a nontrivial amount of disk
space for logging, so only print out these stats if we're asked for
them.

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

13 years agorename some variables in rxperf
Chas Williams (CONTRACTOR) [Fri, 1 Oct 2010 13:58:52 +0000]
rename some variables in rxperf

sendtimes and recvtimes are actually the data byte counts to be
exchanged during an rpc test not an iteration count as implied
by their names

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

13 years agoconfigure: --with-linux-kernel-packaging should default to disabled
Chas Williams (CONTRACTOR) [Wed, 29 Sep 2010 22:21:25 +0000]
configure: --with-linux-kernel-packaging should default to disabled

the test for this build feature is reversed.  by default, the value for
with_linux_kernel_packaging will not be defined which makes the existing
test pick MPS='SP' instead of LINUX_WHICH_MODULES.  based on the configure
help messages, this would appear to be an opt-in not an opt-out.

...
Optional Packages:
...
  --with-linux-kernel-packaging
                          use standard naming conventions to aid Linux kernel
                          build packaging (disables MPS, sets the kernel
                          module name to openafs.ko, and installs kernel
                          modules into the standard Linux location)
...

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

13 years agoafsd's -mem_alloc_sleep is obselete -- update documentation
Chas Williams (CONTRACTOR) [Thu, 30 Sep 2010 18:27:35 +0000]
afsd's -mem_alloc_sleep is obselete -- update documentation
to reflect this.

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

13 years agoDAFS: document the limits of -vhashsize
Andrew Deason [Thu, 2 Sep 2010 18:11:32 +0000]
DAFS: document the limits of -vhashsize

You can only specify a -vhashsize between 6 and 28 (inclusive).
Document that in the dafileserver man page.

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

13 years agolinux define ucontext properly
Derrick Brashear [Wed, 29 Sep 2010 18:15:24 +0000]
linux define ucontext properly

ucontext requires glibc version info to engage.
glibc info comes from features.h, which if we include afs_sysnames.h,
we get... so, let's swap these.

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

13 years agorx: Don't have different args for rxi_FreeCall
Simon Wilkinson [Tue, 28 Sep 2010 23:21:43 +0000]
rx: Don't have different args for rxi_FreeCall

rxi_FreeCall changes its number of arguments depending on whether
locks are enabled or not. That's a little bit nasty to read, so just
change it so that it always takes two arguments, and ignores the
second when it doesn't need it.

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

13 years agorx: Make statistics interface use Atomics
Simon Wilkinson [Tue, 28 Sep 2010 23:11:53 +0000]
rx: Make statistics interface use Atomics

Make the rx_statistics statistics gathering infrastructure use
atomics for all of its counters. This significantly reduces
lock contention. However, it also (potentially) changes the format
of the rx_stats variable which has been used by callers in the past.

To simplify this process, and to aid with future changes, we remove
direct access to rx_stats. Instead, two additional API functions
rx_GetStatistics and rx_FreeStatistics are provided. These give the
caller access to an 'normal' rx_statistics structure.

Tom Keiser has suggested that we should explore using thread-local
statistics structures, and just aggregating them when we are asked
to report. This is a fine idea, and is equally possible with the
new interface that this patch introduces.

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