openafs.git
10 years agoAdd NEWS entries for OpenAFS 1.5.77 and 1.5.76
Russ Allbery [Mon, 20 Sep 2010 21:19:11 +0000]
Add NEWS entries for OpenAFS 1.5.77 and 1.5.76

Based on the public announcement for 1.5.77.

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

10 years agoWindows: Negative Caching for Volume Lookups
Jeffrey Altman [Thu, 16 Sep 2010 12:23:41 +0000]
Windows: Negative Caching for Volume Lookups

If a volume lookup returns VL_NOENT or VL_BADNAME, cache the negative
response for five minutes.  This prevents volume lookup storms caused
by the same volume lookup being performed repeated during a short
time period.  This can happen if mount points to volumes that do not
exist are present in a directory that is being evaluated by Windows
Explorer or Common Control File Dialogs.

This functionality is implemented by storing the most recent update
time for the volume group as part of the cm_volume_t.  A non-existing
volume group is identified with a new CM_VOLUMEFLAG_NOEXIST flag.
The presence of the lastUpdateTime value also permits volume location
information to expire at lastUpdateTime + lifetime instead of expiring
all volume information simultaneously each lifetime period.

LICENSE MIT

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

10 years agoMention KRB5CCNAME in the aklog man page
Russ Allbery [Tue, 14 Sep 2010 17:12:43 +0000]
Mention KRB5CCNAME in the aklog man page

AFS users not otherwise familiar with Kerberos may not realize that
one sets KRB5CCNAME to use an alternative ticket cache.  Mention the
variable in the aklog man page, although defer to the Kerberos
documentation for most details.

Change-Id: I13133285f153f86e0aa1e95b24715e01d576075d
Reviewed-on: http://gerrit.openafs.org/2761
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

10 years agoRx: Permit ADAPT_WINDOW code to build
Jeffrey Altman [Sun, 19 Sep 2010 17:46:34 +0000]
Rx: Permit ADAPT_WINDOW code to build

Add missing fields to rx data structures.

Update variable references.

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

10 years agoWindows: Export additional RX debugging variables from afsrpc.dll
Jeffrey Altman [Sun, 19 Sep 2010 16:17:08 +0000]
Windows: Export additional RX debugging variables from afsrpc.dll

Export

   rxi_nRecvFrags                          @2008 DATA
   rxi_nSendFrags                          @2009 DATA
   rx_initReceiveWindow                    @2010 DATA
   rx_initSendWindow                       @2011 DATA
   rx_intentionallyDroppedPacketsPer100    @2012 DATA
   rx_intentionallyDroppedOnReadPer100     @2013 DATA

so they can be referenced from pthreaded builds of src/rx/test tools.
Exported variables must be present in both FREE and CHECKED builds.

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

10 years agoRx: PrintTheseStats should not be dependent on RXDEBUG
Jeffrey Altman [Sun, 19 Sep 2010 16:14:06 +0000]
Rx: PrintTheseStats should not be dependent on RXDEBUG

When RXDEBUG is not defined, PrintTheseStats generates an error
even though the statistics are in fact available.  The global
variable rx_packetTypes was not being defined without RXDEBUG.

Make rx_packetTypes defined always and permit statistics to
always be printed.

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

10 years agoRx: move TSFPQ prototypes from rx_globals.h to rx_protoypes.h
Jeffrey Altman [Sun, 19 Sep 2010 16:08:42 +0000]
Rx: move TSFPQ prototypes from rx_globals.h to rx_protoypes.h

Function prototypes belong in rx_prototypes.h not in rx_globals.h.

Remove EXT macro from function prototypes as functions do not
require special treatment in order to be exported by a DLL on Windows.

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

10 years agoRx: properly compute dataPacketsReSent statistic
Jeffrey Altman [Sun, 19 Sep 2010 16:03:39 +0000]
Rx: properly compute dataPacketsReSent statistic

The global dataPacketsReSent statistic should be the sum of all
peer->reSends and dataPacketsSent should not include the count of
resent packets.  Prior to this patchset, dataPacketsSent included
the resent packets and dataPacketsReSent was computed as the number
of requests for Ack instead of the number of packets resent.

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

10 years agoRx: always use tservice variable in rxi_ServerProc
Jeffrey Altman [Sun, 19 Sep 2010 16:00:57 +0000]
Rx: always use tservice variable in rxi_ServerProc

Since tservice has been assigned to call->conn->service,
use it instead of call->conn->service when calling
executeRequestProc(call)

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

10 years agoWindows: Release builds of Rx should be lean and mean
Jeffrey Altman [Sun, 19 Sep 2010 15:57:02 +0000]
Windows: Release builds of Rx should be lean and mean

Only build checked builds of Rx with
-DRXDEBUG -DRXDEBUG_PACKET -DRX_TRACK_PACKETS -DRX_REFCOUNT_CHECK

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

10 years agoRx: Only backoff the peer timeout once
Jeffrey Altman [Mon, 20 Sep 2010 02:48:57 +0000]
Rx: Only backoff the peer timeout once

If a packet is missing, the peer timeout is backed off to provide
a new starting point for timeout computation.  The backoff state
must be stored in the peer object to ensure that multiple failures
do not result in more than one backoff before a successfully received
packet is available for recomputation.

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

10 years agoRx: only compute peer bytes sent and received if rx_stats_active
Jeffrey Altman [Sun, 19 Sep 2010 16:47:37 +0000]
Rx: only compute peer bytes sent and received if rx_stats_active

Computing the bytes sent and received is an expensive operation.
If rx statistics collection has been disabled we should not collect
the peer data.  The most expensive operation is the rx_FindPeer()
call that is performed during rxi_ReadPacket().  rxi_ReadPacket()
is processed by the rx listener thread which must be as fast as
possible.

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

10 years agoRx: avoid lock churn in rxi_ReceiveAckPacket
Jeffrey Altman [Sun, 19 Sep 2010 16:35:03 +0000]
Rx: avoid lock churn in rxi_ReceiveAckPacket

rxi_ReceiveAckPacket can acquire and drop the conn_data_lock several
times and acquires and drops the peer_lock unnecessarily.  This patchset
adds a variable to track whether the conn_data_lock is held in order
to avoid the need to drop it and reacquire it based upon conditional
operations.  It also relocates the peer->maxPacketSize computations
in order to consolidate the work performed under the peer_lock.

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

10 years agoRx: Build rxperf test application on Windows
Jeffrey Altman [Sun, 19 Sep 2010 15:28:21 +0000]
Rx: Build rxperf test application on Windows

rxperf made assumptions that it was built against LWP, used buffer
sizes for read/write that were too small, made use of non-portable
types, and set signal handlers that are unsupported.

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

10 years agoviced: Don't fall back to tokens
Simon Wilkinson [Sat, 11 Sep 2010 22:17:24 +0000]
viced: Don't fall back to tokens

I can't think of any circumstances in which it is appropriate for
the fileserver to fallback to using tokens from the kernel, rather than
those generated from keys on disk. So, remove that fallback.

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

10 years agoubik: Remove unused error codes
Simon Wilkinson [Sat, 11 Sep 2010 07:21:10 +0000]
ubik: Remove unused error codes

The error codes in ubik.p.h have been replaced by ones defined by
com_err. Remove the redundant, #if 0, definitions of these, as they're
just confusing when grepping the code.

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

10 years agorxgen, kauth: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 17:19:47 +0000]
rxgen, kauth: Set but not used variables

Remove a few variables that are not actually used, and the
associated code.

foundcurrentkey is only used in the AUTH_DBM_LOG case, so
scope the declaration and assignment accordingly.

Spotted by gcc 4.6

Change-Id: I281ca37488e69bfe46a8e63bdc5990f5f3cff940
Reviewed-on: http://gerrit.openafs.org/2734
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoptserver: Merge WhoIsThis and WhoIsThisWithName
Simon Wilkinson [Sat, 11 Sep 2010 19:49:55 +0000]
ptserver: Merge WhoIsThis and WhoIsThisWithName

The functions WhoIsThis and WhoIsThisWithName are pretty much identical,
with WhoIsThisWithName just having additional logic for foreign user
registration. Merge them together, so that there's only one copy of
the code for determining who a user is.

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

10 years agoAdd additional dependencies for shlibafsrpc
Simon Wilkinson [Sun, 12 Sep 2010 17:41:21 +0000]
Add additional dependencies for shlibafsrpc

fsint and rxstat need to be build before shlibafsrpc, so add them
to the dependencies list.

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

10 years agouserok: Don't double check for expiry
Simon Wilkinson [Mon, 13 Sep 2010 07:54:55 +0000]
userok: Don't double check for expiry

rxkad_GetServerInfo returns an error if you attempt to get server
information using a connection whose tokens have already expired.

The additional check for expiry in the userOK routines is therefore
not required - they'll never be reached, because GetServerInfo will
already have errored out.

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

10 years agoauth: Restructure userok
Simon Wilkinson [Sat, 11 Sep 2010 15:39:23 +0000]
auth: Restructure userok

Restructure the userok logic in auth to split it into smaller functions,
and abstract out common code. This will make it easier to add support
for other security layers in future commits.

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

10 years agorx: Call rxgen_consts.h by its proper name
Simon Wilkinson [Sat, 11 Sep 2010 11:51:52 +0000]
rx: Call rxgen_consts.h by its proper name

rxgen_consts.h is actually in the afs/ directory. Include it from
their, rather than requiring that every user have $(TOP_INCDIR)/afs
in their search path.

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

10 years agotokens: Use the new tokens interface
Simon Wilkinson [Sat, 11 Sep 2010 09:17:12 +0000]
tokens: Use the new tokens interface

Change tokens so that it will use the new tokens interface.

Note that this changes the output from the tokens command.

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

10 years agoauth: Add the ktc_ListTokensEx function
Simon Wilkinson [Sat, 11 Sep 2010 09:11:57 +0000]
auth: Add the ktc_ListTokensEx function

Add a ktc_ListTokensEx function which uses the new GetToken pioctl
to implement the same functionality as the old ktc_ListTokens call.

As with ktc_ListTokens this is hugely inefficient, as it gets a
compelete token structure from the kernel, then throws it away to
return just the cell which the token is for.

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

10 years agoRx: Move rxperf test application to src/rx/tests
Jeffrey Altman [Sun, 19 Sep 2010 15:03:50 +0000]
Rx: Move rxperf test application to src/rx/tests

rxperf is a test application.  Move it to the tests directory

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

10 years agoRx: cleanup testclient and testserver test applications
Jeffrey Altman [Sun, 19 Sep 2010 16:20:01 +0000]
Rx: cleanup testclient and testserver test applications

Permit testclient and testserver to be built on Windows as
pthreaded applications.

Remove warnings.  Fix prototypes.  Remove variable declarations
for rx library variables defined in rx_globals.h.

Increase the buffer sizes.  Disable use of packet dropping when
the library is built without RXDEBUG.

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

10 years agoauthcon: Use ktc_GetTokenEx in ClientAuthToken
Simon Wilkinson [Wed, 8 Sep 2010 07:12:41 +0000]
authcon: Use ktc_GetTokenEx in ClientAuthToken

Use ktc_GetTokenEx, and the related token utilities to check for a
users tokens, rather than using the legacy ktc_GetToken

Export the necessary symbols from libafsauthent on Windows to be able
to do this.

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

10 years agoWindows: Add new token interface with stub for ktc_GetTokenEx
Jeffrey Altman [Thu, 16 Sep 2010 00:48:30 +0000]
Windows: Add new token interface with stub for ktc_GetTokenEx

The Windows build was broken by the addition of dependencies on
token_FreeSet, ktc_GetTokenEx, etc.   Permit the build to continue.
The ktc_GetTokenEx implementation will depend on the creation of
a new Windows pioctl for the call.

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

10 years agoRename kauth/token.c as kauth/katoken.c
Simon Wilkinson [Thu, 16 Sep 2010 06:09:20 +0000]
Rename kauth/token.c as kauth/katoken.c

The kauth 'token.c' collides with the same file in auth when doing
Windows builds. As kauth is the legacy package, rename its source
file, and update the build system to take account of this.

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

10 years agoRX: Make rxi_Alloc return (void *)
Simon Wilkinson [Sat, 4 Sep 2010 14:29:03 +0000]
RX: Make rxi_Alloc return (void *)

rxi_Alloc returns a pointer to an anonymous data block. Make its
return value (void *) rather than (char *), so that it can be
called in the same way as malloc(), and not require casting.

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

10 years agoLinux: print after BUG() is pretty useless
Simon Wilkinson [Sun, 12 Sep 2010 11:07:59 +0000]
Linux: print after BUG() is pretty useless

Calling BUG() panics the machine, so having a print statement with
further debugging information after it doesn't help much.

Swap the ordering, so we at least see the message.

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

10 years agovolser: Delete timed-out temporary volumes
Andrew Deason [Tue, 14 Sep 2010 16:15:22 +0000]
volser: Delete timed-out temporary volumes

When a transaction times out on a volume, delete the volume if it is a
temporary volume (destroyMe is set). This prevents half-created
volumes from accumulating, which can take up space and screw up
certain vol ops in some versions.

Change-Id: I94e9adc767b84a2a32d980f508af33b823560950
Reviewed-on: http://gerrit.openafs.org/2760
Tested-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>

10 years agolibafs: Fix pioctl get/putInt alignment issues
Andrew Deason [Wed, 15 Sep 2010 16:19:33 +0000]
libafs: Fix pioctl get/putInt alignment issues

We don't know if the buffer for pioctl data is aligned to anything, so
we can't just dereference the given pointer as an int or anything
else. So, just memcpy the data in for ints and such; conveniently,
afs_pd_getBytes and afs_pd_putBytes can do this for us, so just use
that.

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

10 years agovlserver: Set but not used variables
Marc Dionne [Fri, 10 Sep 2010 23:55:39 +0000]
vlserver: Set but not used variables

Remove some variables that are set but never used in the vlserver
directory:
- n1,n2,n3 and n4 in vlclient.c appear to have never been used even
in the original IBM code
- some variables in vldb_check.c that are no longer used after some
recent changes

Spotted by gcc 4.6

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

10 years agobutc: Set but unused variables
Marc Dionne [Sat, 11 Sep 2010 17:23:11 +0000]
butc: Set but unused variables

Remove unused variable taskId

writeData() systematically returns 0, so make it void and adapt
call sites that assigned the return value but never used it.
Also move the function up in the file to avoid the need for a
forward declaration, and make it static since it's only used here.

Spotted by gcc 4.6

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

10 years agolibafs: Fix compile errors in afs_nfsclnt.c
Andrew Deason [Wed, 15 Sep 2010 18:40:19 +0000]
libafs: Fix compile errors in afs_nfsclnt.c

 - tokenUnion is a union, not a struct

 - 'struct rxkadToken' typo

 - 'tokenPtr' not 'tokenptr'

Change-Id: I7e0fa4f2d34ba4bd68345e9625f40d1d7301411e
Reviewed-on: http://gerrit.openafs.org/2764
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

10 years agovol: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 16:14:09 +0000]
vol: Set but not used variables

Fix some set but unused variable warnings in the vol directory.

In VDetachVolume_r, much of the code and variables are only
useful in the FSSYNC_BUILD_CLIENT case.  Scope the code
accordingly.

forcefree is only used in the AFS_DEMAND_ATTACH_FS case, so
scope code that sets it accordingly.

Spotted by gcc 4.6

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

10 years agoLinux: normalize error return for emulated syscalls
Marc Dionne [Thu, 1 Jul 2010 15:38:20 +0000]
Linux: normalize error return for emulated syscalls

pagsh and other code expect setpag() and pioctl() to behave like
a regular syscall or pioctl, that is to return -1 on error, with
errno set to the specific error code.
On Linux, the underlying emulation does a straight return of any
error code it gets from the ioctl, and errors are not properly
caught by the callers.

As an example, pagsh won't detect an error from setpag such as
exceeding a keyring quota limit.  With this patch, the user
will see this:

$ pagsh
setpag: Disk quota exceeded
sh-4.1$

The code in proc_afs_syscall is modified to set errno to the error
code and to set errorcode to -1 in case of error.

proc_afs_sycall is reindented while we're changing code there.

FIXES 126230

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

10 years agodisable Rx packet tracking
Derrick Brashear [Wed, 15 Sep 2010 08:26:13 +0000]
disable Rx packet tracking

minimize the impact of Rx packet tracking. in particular, do no
extra queue scans, which means the rest of the state which tracks
where a packet is now isn't of use. make it possible to re-enable.

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

10 years agoAutomatically find all pod.in files and generate .pods files
Steve Simmons [Sat, 4 Sep 2010 16:14:17 +0000]
Automatically find all pod.in files and generate .pods files

Change-Id: I9334ed4fde8df63f278b6ef07bc0eddebfc71bf0
Reviewed-on: http://gerrit.openafs.org/2720
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoDAFS: raise vhashsize limit
Andrew Deason [Wed, 8 Sep 2010 19:32:35 +0000]
DAFS: raise vhashsize limit

Raise the maximum specifiable vhashsize to 28 (from 14). Specifying a
vhashsize over 14 can be reasonable if you expect to have a few
million volumes on a fileserver.

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

10 years agoDAFS: Do not ignore out-of-range -vhashsize
Andrew Deason [Thu, 2 Sep 2010 17:56:28 +0000]
DAFS: Do not ignore out-of-range -vhashsize

If the specified -vhashsize is out of the 6-14 range, do not just
ignore it. Instead, note the error and quit.

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

10 years agoAlways check return code from iod_Write
Marc Dionne [Sat, 11 Sep 2010 14:46:50 +0000]
Always check return code from iod_Write

The return code from iod_Write is checked at every call site
in the file, except this one.  Check it, and return VOLSERDUMPERROR
if appropriate.

Spotted by a set but unused warning from gcc 4.6

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

10 years agorx: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 18:57:17 +0000]
rx: Set but not used variables

Remove some unused variables in the rx code.
These generate warnings with gcc 4.6.

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

10 years agoauth: Make token_FreeSet work on an empty set
Simon Wilkinson [Sat, 11 Sep 2010 22:14:42 +0000]
auth: Make token_FreeSet work on an empty set

If the set passed to token_FreeSet is already freed, just
make the funciton a no-op, rather than segfaulting.

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

10 years agoLinux: Move keyring includes where they're needed
Simon Wilkinson [Sat, 11 Sep 2010 11:43:35 +0000]
Linux: Move keyring includes where they're needed

We don't need the keyring headers in every file, so reduce
namespace pollution by just including them in osi_groups.c, which is
the only place that uses them.

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

10 years agoshlibafsrpc: Export additional symbols
Simon Wilkinson [Thu, 9 Sep 2010 08:14:30 +0000]
shlibafsrpc: Export additional symbols

Export additional symbols from shlibafsrpc. These symbols are required
in order to be able to produce dynamically linked security modules that
interface with libafsrpc.

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

10 years agoIgnore *.dSYM files in working directory
Simon Wilkinson [Wed, 8 Sep 2010 07:24:55 +0000]
Ignore *.dSYM files in working directory

Failed Mac OS X debugging builds leave *.dSYM directories lying
around the tree, which just litter the contents of "git status".

So, ignore them.

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

10 years agoAdd config.log to gitignore globally
Simon Wilkinson [Wed, 8 Sep 2010 07:22:57 +0000]
Add config.log to gitignore globally

When you end up explicitly regenerating chosen Makefiles by
running ../../config.status Makefile, the working tree ends up littered
with config.log files.

Currently, we only ignore config.log in the top directory - extend this
so that it's ignored across the tree.

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

10 years agoauth: Add a gitignore file for the test directory
Simon Wilkinson [Wed, 8 Sep 2010 07:31:02 +0000]
auth: Add a gitignore file for the test directory

The auth/test directory is optionally built, and so had missed getting
a .gitignore file. Add one now.

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

10 years agopam: Remove unused library definitions
Simon Wilkinson [Thu, 9 Sep 2010 08:04:21 +0000]
pam: Remove unused library definitions

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

10 years agoaklog: Fix some format warnings
Simon Wilkinson [Mon, 6 Sep 2010 08:38:47 +0000]
aklog: Fix some format warnings

Fix some format warnings (size_t vs int) which only appear when we're
building with Heimdal.

Change-Id: I7313ea1a7e01532b11fc6039a8a56e0fd874c347
Reviewed-on: http://gerrit.openafs.org/2740
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoaklog: Fix weak_crypto tests
Simon Wilkinson [Mon, 6 Sep 2010 08:37:23 +0000]
aklog: Fix weak_crypto tests

The tests for the various ways of enabling weak cryptography fail
with current Heimdal master, because it defines krb5_allow_weak_crypto
but does not prototype it.

Fix this by testing for the Heimdal version (which MIT does not provide)
first, and only if that's not available, try to use allow_weak_crypto.

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

10 years agoRX: Make the sample client and server build
Simon Wilkinson [Wed, 1 Sep 2010 10:09:46 +0000]
RX: Make the sample client and server build

Make the RX sample client and server build again

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

10 years agovlserver: Use com_err for Ubik error messages
Simon Wilkinson [Sat, 11 Sep 2010 07:25:15 +0000]
vlserver: Use com_err for Ubik error messages

Use com_err to return a sensible string, rather than just an error code,
for errors with Ubik initialisation.

This has the specific benefit that the error when the database directory
doesn't exist, or isn't readable, becomes

    Ubik init failed: file not found when processing dbase"
rather than
    Ubik init failed with code 5382

Change-Id: I5f770377668a7f545cad7e422f28afd7c9f9888d
Reviewed-on: http://gerrit.openafs.org/2735
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoWarning fix for gcc 4.5 "operation may be undefined" warnings
Marc Dionne [Fri, 10 Sep 2010 01:02:05 +0000]
Warning fix for gcc 4.5 "operation may be undefined" warnings

The inc_header_word and set_header_word macros make repeated use of their
argument, which triggers many (~30) warnings with gcc 4.5, like this one:

./ptutils.c:473:6: warning: operation on â€˜cheader.foreigncount’ may be undefined

Removing the cast to afs_int32 in the macros gets rid of the warning,
and should be safe since we're just getting a small positive integer value
- the offset of the member in the structure - and passing it to the
pr_Write function which expects an afs_int32.

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

10 years agoudebug: Always show tidCounter
Andrew Deason [Fri, 10 Sep 2010 16:17:40 +0000]
udebug: Always show tidCounter

If the queried site doesn't have an active write transaction,
currently udebug doesn't show the tidCounter. The tidCounter can still
be useful to know (especially since some sites will become buggy when
tidCounter rolls over), so always show it.

This adds the "The last trans I handled was" message to udebug.

Change-Id: I10d9ab6ff07188d17df4d8022adf8bb125eb772a
Reviewed-on: http://gerrit.openafs.org/2730
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agonamei: Do not remove n_voldir1
Andrew Deason [Thu, 9 Sep 2010 19:10:01 +0000]
namei: Do not remove n_voldir1

When removing data directories in namei_RemoveDataDirectories, do not
remove the n_voldir1 directory (directory X in /vicepa/AFSIDat/X).
Removing this directory can race against the creation of an entirely
unrelated volume, causing the create op to fail (since it tries to
create a directory in a directory that no longer exists).

We don't currently have the necessary locking to make this safe, and
since the overhead of n_voldir1 existing is pretty negligible, just
leave it there. Also add some comments briefly justifying this.

Note that other similar races probably exist for directories under
n_voldir1, but they would only be between volumes in the same VG, and
so are much less likely to occur.

Change-Id: I5eac894cdbdb3fd1d74d8a0fc226df03686ceeef
Reviewed-on: http://gerrit.openafs.org/2727
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agomanpage correction for restorevol -file option
Michael Meffie [Thu, 9 Sep 2010 19:22:29 +0000]
manpage correction for restorevol -file option

The restorevol -file option specifies which file to read.

Change-Id: I5c03eaaf8bf82fc6d3fb83ff08e8278257e7b65f
Reviewed-on: http://gerrit.openafs.org/2728
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agovol: Add VInit cond var and remove busywaits
Andrew Deason [Thu, 2 Sep 2010 16:25:27 +0000]
vol: Add VInit cond var and remove busywaits

In DAFS, FSYNC_sync was waiting for VInit to reach at least 2 by
looping around pthread_yield(). For a server with a large number of
volumes, it can take a while for volumes to preattach, and so we are
effectively busy-waiting for preattach to finish. This can slow
fileserver startup and peg the cpu.

So instead, add a condition variable for when VInit changes, and wait
on that. Also modify other checkers of VInit to use the cond var.

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

10 years agonamei: Limit traversal when removing data dirs
Andrew Deason [Thu, 2 Sep 2010 20:05:21 +0000]
namei: Limit traversal when removing data dirs

namei_RemoveDataDirectories currently calls delTree with 'tree'
pointing to the part of the path immediately following n_base (i.e.
starting at the beginning of n_voldir1). This causes delTree to
traverse all of n_voldir1, trying to delete every directory it finds.

Since we are typically only trying to remove a single volume when
calling namei_RemoveDataDirectories, instead call delTree with 'tree'
pointing to immediately after n_voldir1, and beginning at n_voldir2
and try to just rmdir n_voldir1 afterwards. This way, we do not
traverse a large fraction of the entire partition when just trying to
delete a single volume, and so can significantly speed up volume
removals.

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

10 years agoAdd new file src/venus/cacheout to things that should be ignored.
Steve Simmons [Tue, 7 Sep 2010 21:38:27 +0000]
Add new file src/venus/cacheout to things that should be ignored.

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

10 years agoubik recovery and remote use correct file number
Derrick Brashear [Wed, 8 Sep 2010 00:31:20 +0000]
ubik recovery and remote use correct file number

the file propagation "out of band" changes should not hardcode recovery
on file 0, but instead work on any file the interface is acting on.
use the provided file number.

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

10 years agoWindows: 1.5.77 Change Log summary
Jeffrey Altman [Tue, 7 Sep 2010 18:35:22 +0000]
Windows: 1.5.77 Change Log summary

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

10 years agoWindows: Improve SMB detection of Local System account
Jeffrey Altman [Tue, 7 Sep 2010 12:21:12 +0000]
Windows: Improve SMB detection of Local System account

Depending on the authentication method, the smb session authenticated
name for the "local system" account may be the nul string.  In this
case it is impossible to use the name to determine if the authenticated
entity is the "local system" account as required by smb_SetToken.
To work around this problem, smb_AuthenticateUserExt() will now obtain
the Security Identifier (SID) for the authenticated account.  The string
representation of the SID will be used in place of the name by
smb_ReceiveV3SessionSetupX() when constructing the smb_user_t object.
A new flag, SMB_USERNAMEFLAG_SID, indicates when the name is in fact
a SID.

smb_userIsLocalSystem() checks for the SMB_USERNAMEFLAG_SID flag and
performs a SID comparison when it is set.

smb_SetToken() will accept either MACHINE\user or a SID string as
the smbname.  It will obtain the SID if possible and create a SID-based
smb_user_t.

It is possible that a SYSTEM service will use an anonymous (S-1-5-7)
SMB connection.  In that case, we also check the RPC Impersonation
SID to see if it is SYSTEM.  If so, the RPC identity supercedes the
SMB identity for SetToken.

smb_IoctlRead, smb_IoctlV3Read and smb_IoctlRawRead are now all
consistent with regards to name processing.

Fixed a couple of comments as well.

FIXES 128022

LICENSE MIT

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

10 years agoWindows: revise NTSTATUS response for ALLBUSY, ALLOFFLINE, and ALLDOWN
Jeffrey Altman [Fri, 3 Sep 2010 04:02:17 +0000]
Windows: revise NTSTATUS response for ALLBUSY, ALLOFFLINE, and ALLDOWN

Replace STATUS_IO_TIMEOUT with RPC_NT_SERVER_TOO_BUSY for CM_ERROR_ALLBUSY.

Replace STATUS_PATH_NOT_FOUND with RPC_NT_SERVER_UNAVAILABLE for
CM_ERROR_ALLOFFLINE and CM_ERROR_ALLBUSY.

These errors provide a more meaningful message to end users when
a failure occurs.

LICENSE MIT

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

10 years agoWindows: Modify signature of buf_CleanAsync and buf_CleanAsyncLocked
Jeffrey Altman [Fri, 3 Sep 2010 01:17:24 +0000]
Windows: Modify signature of buf_CleanAsync and buf_CleanAsyncLocked

The buf_CleanAsync() and buf_CleanAsyncLocked() signature does
not include a cm_scache_t pointer even though buf_CleanAsyncLocked()
needs a pointer to the matching cm_scache_t object.  There are
some calls when the cm_scache_t object is already known.  For those
cases it is more efficient to avoid the additional lookup especially
when buf_CleanAsync*() is being called on every buffer associated
with the cm_scache_t object.

At the same time add a flags field and a constant
CM_BUF_WRITE_SCP_LOCKED to permit the lock state of the cm_scache_t
to be passed in.

Finally, fix up the usage in buf_FlushCleanPages() which gains
the most from these changes.

LICENSE MIT

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

10 years agoWindows: Permit cm_scache rwlock to be dropped when "Stablized"
Jeffrey Altman [Fri, 3 Sep 2010 01:05:15 +0000]
Windows: Permit cm_scache rwlock to be dropped when "Stablized"

The cm_buf_opts_t cm_BufStabilize() function was implemented
such that holding the cm_scache_t.rw lock had to be exclusively
held until cm_BufUnstablize() was called.  Unfortunately, this
prevents using Stabilize/Unstabilize to protect the cm_scache_t
during Flush operations as the cm_scache_t.rw lock must be
acquired after the cm_buf_t mutex and not before it.

This patchset reimplements the synchronization logic using
the new CM_SCACHEFLAG_SIZESETTING flag and cm_SyncOp().

LICENSE MIT

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

10 years agoWindows: fail cm_CheckNTOpen if READ|DELETE for readonly file
Jeffrey Altman [Mon, 30 Aug 2010 03:41:02 +0000]
Windows: fail cm_CheckNTOpen if READ|DELETE for readonly file

If the readonly file attribute is set (stored as a unix mode)
then a CreateFile operation should fail if the file is opened
for DELETE in combination with any other privilege.

LICENSE MIT

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

10 years agoWindows: Add validation for directory buffer contents
Jeffrey Altman [Thu, 26 Aug 2010 15:33:43 +0000]
Windows: Add validation for directory buffer contents

If the directory buffer contents are garbage we can crash
the service.  Add some simple validation checks to ensure
that cm_dirEntry_t objects have the correct flag value and
that the name strings are not too long.

LICENSE BSD

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

10 years agoWindows: cm_TryBulkStatRPC must process VIO errors
Jeffrey Altman [Tue, 24 Aug 2010 20:46:45 +0000]
Windows: cm_TryBulkStatRPC must process VIO errors

If the bulkStat errorCode indicates that a particular object
is inaccessible due to a VIO error, we must update the server
status appropriately in order to permit failover.

LICENSE MIT

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

10 years agoWindows: better handle RX_MSGSIZE errors
Jeffrey Altman [Tue, 24 Aug 2010 20:42:57 +0000]
Windows: better handle RX_MSGSIZE errors

An RX_MSGSIZE error is returned by the new PMTU detection
code.  It is critical that such an error result in a retry of
the operation that failed.  Otherwise, the PMTU detection can't
work and the server will be marked down.

Secondly, it is important that such errors not leak to the
application layer.  Map them to CM_ERROR_RETRY in all cases.

LICENSE MIT

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

10 years agoWindows: print the value of cm_OfflineROIsValid to afsd_init.log
Jeffrey Altman [Tue, 24 Aug 2010 20:40:38 +0000]
Windows: print the value of cm_OfflineROIsValid to afsd_init.log

If we say we are printing the value of cm_OfflineROIsValid,
do so and not cm_deleteReadOnly.

LICENSE MIT

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

10 years agoWindows: Handle RX_RESTARTING consistently for all RPCs
Jeffrey Altman [Sun, 22 Aug 2010 14:05:59 +0000]
Windows: Handle RX_RESTARTING consistently for all RPCs

Translate RX_RESTARTING to the same cache manager error code
for all RPC classes.

LICENSE MIT

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

10 years agoWindows: Log cell along with volume id for server errors
Jeffrey Altman [Sat, 21 Aug 2010 04:23:45 +0000]
Windows: Log cell along with volume id for server errors

When logging server volume instance errors to the windows
application event log, be sure to log the cell as well.
Translating from server ip address is non-trivial.  Make it
easier for administrators triaging issues to plug the volume
and cell info into vos commands.

LICENSE MIT

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

10 years agoWindows: unix modes represented in octal
Jeffrey Altman [Sat, 21 Aug 2010 04:22:22 +0000]
Windows: unix modes represented in octal

Since unix mode bits are represented in octal in most cases
make sure we log them that way.

LICENSE MIT

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

10 years agorx msgsize retry logic change
Derrick Brashear [Fri, 3 Sep 2010 12:18:41 +0000]
rx msgsize retry logic change

only rewrite to RX_MSGSIZE if the MTU changed. otherwise, leave well
enough alone

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

10 years agocacheout: Improve error handling
Andrew Deason [Fri, 3 Sep 2010 15:59:45 +0000]
cacheout: Improve error handling

Bail out when we encounter errors in initialization. Among other
things, this prevents a segfault if we can't read the client
configuration.

Change-Id: I8b35163c5c4750eb05539a225069327051a3f148
Reviewed-on: http://gerrit.openafs.org/2665
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agovos: Show effects in single-volume dryrun mode
Andrew Deason [Fri, 3 Sep 2010 21:32:11 +0000]
vos: Show effects in single-volume dryrun mode

Fix -dryrun mode for 'vos syncvldb' to also show the effects when run
against a specific volume id.

Change-Id: I3a2db96fc8016939f2f2f9561aba29527701ad59
Reviewed-on: http://gerrit.openafs.org/2667
Tested-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>

10 years agovos: Show after effects in dryrun mode
Andrew Deason [Fri, 3 Sep 2010 20:20:10 +0000]
vos: Show after effects in dryrun mode

The dryrun mode of operation for 'vos syncvldb' and 'vos syncserv'
does not currently show the "status after" portion of its output, so
they don't really show what the commands will do. Change them so
"status after" is shown for -dryrun when sync'ing servers or
partitions, and count changes towards the count at the end.

Change-Id: I6cc20c28a989925a1262570b286fdd7d290c0a9a
Reviewed-on: http://gerrit.openafs.org/2666
Tested-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>

10 years agoafs_DoBulkStat: don't call afs_Analyze without holding the GLOCK
Marc Dionne [Sun, 5 Sep 2010 14:48:52 +0000]
afs_DoBulkStat: don't call afs_Analyze without holding the GLOCK

Limit the scope of the GUNLOCK-GLOCK blocks to cover only the RX
calls.  This prevents afs_Analyze from being called without the
GLOCK, which causes an oops in afs_icl_Event4() where there's
an ASSERT_GLOCK.

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

10 years agoRedHat: Package libafshcrypto libraries
Andrew Deason [Wed, 1 Sep 2010 17:04:56 +0000]
RedHat: Package libafshcrypto libraries

Add libafshcrypto.so.* to authlibs, and libafshcrypto.{a,so} to
authlibs-devel.

Change-Id: I9b513bc32e532562be2d679b5185411f002f8208
Reviewed-on: http://gerrit.openafs.org/2643
Tested-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>

10 years agoRedHat: Do not force krb5-config path
Andrew Deason [Wed, 1 Sep 2010 16:14:37 +0000]
RedHat: Do not force krb5-config path

If the %krb5config macro is not defined, do not force using
/usr/kerbers/bin/krb5-config, since sometimes that is not where it is
(RHEL6 puts it in /usr/bin). Instead only specify KRB5_CONFIG if
krb5config is defined; otherwise let configure find krb5-config for
us.

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

10 years agoRedHat: Update openafs.spec for configure changes
Andrew Deason [Wed, 1 Sep 2010 15:32:53 +0000]
RedHat: Update openafs.spec for configure changes

We no longer have the configure options --enable-disconnected and
--with-krb5-conf. Remove them from the spec file and instead specify
krb5-config via the KRB5_CONFIG variable.

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

10 years agoRedHat: Use git-version in makesrpm.pl
Andrew Deason [Wed, 1 Sep 2010 15:18:17 +0000]
RedHat: Use git-version in makesrpm.pl

We no longer have the OpenAFS version in the AM_INIT_AUTOMAKE. Get the
version from the equivalent AC_INIT version, which is determined by
running build-tools/git-version. So, run git-version to get the
version.

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

10 years agoRedHat: Use configure.ac in makesrpm.pl
Andrew Deason [Wed, 1 Sep 2010 15:12:31 +0000]
RedHat: Use configure.ac in makesrpm.pl

We don't have a configure.in anymore; instead we have a configure.ac.

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

10 years agoUpdate Autoconf Kerberos probes to latest rra-c-util version
Russ Allbery [Wed, 1 Sep 2010 17:52:30 +0000]
Update Autoconf Kerberos probes to latest rra-c-util version

We will now look for krb5-config in /usr/kerberos/bin (the path used
on Red Hat Enterprise prior to RHEL6) if it isn't found in the user's
PATH.

This update also adds a new probe for krb5_get_init_creds_opt_free
which is not yet used, but may eventually be useful for klog.krb5.

Change-Id: Iefd67c02ac44fd5f1a30883d1cd6ea4e489b32b1
Reviewed-on: http://gerrit.openafs.org/2644
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoLinux: Updated RedHat spec file with new demand attach servers and docs
Jonathan Billings [Tue, 31 Aug 2010 19:15:26 +0000]
Linux: Updated RedHat spec file with new demand attach servers and docs

Added the following to the openafs-server package:
dafileserver
dafssync-debug
dasalvager
davolserver
salvageserver
salvsync-debug

Added the man pages for the above.
Added a man page for krb.excl

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

10 years agoihandle positional read and write
Michael Meffie [Mon, 15 Mar 2010 17:42:23 +0000]
ihandle positional read and write

When available, use POSIX positional read and write
calls in the ihandle package. Originally written
by Derrick Brashear and Andrew Deason.

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

10 years agoLet SRXAFS_GetStatistics64 return correct values for the workstations
Hartmut Reuter [Tue, 31 Aug 2010 11:30:41 +0000]
Let SRXAFS_GetStatistics64 return correct values for the workstations

h_GetWorkstats was called also for 64bit which let random contents
in the other half of the 64bit field. Worse: little and big endian
machines filled different parts of the field so that a later masking
in fsprobe would net help for all kinds of servers.

Now a small wrapper h_GetWorkstats64 is called which calls h_GetWorkstats
correctly.

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

10 years agoubik recovery kill duplicate code
Derrick Brashear [Mon, 30 Aug 2010 16:32:58 +0000]
ubik recovery kill duplicate code

if recovery wants to invalidate transaction unconditionally and
has code duplication from urecovery_checkTid, just make checkTid
do what we want

Change-Id: I345560c496d4cb4506de6db79357b99c616ffbbe
Reviewed-on: http://gerrit.openafs.org/2628
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoclean up stale defines in volser header
Michael Meffie [Thu, 12 Aug 2010 04:14:03 +0000]
clean up stale defines in volser header

The volserver does not use port 5003 any more.

Change-Id: Ied55709c3831595d63f052cc1c2397e26352e4f1
Reviewed-on: http://gerrit.openafs.org/2536
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoubik: Protect ubik_servers in urecovery_Interact
Andrew Deason [Wed, 9 Jun 2010 17:46:29 +0000]
ubik: Protect ubik_servers in urecovery_Interact

urecovery_Interact can modify the global ubik_servers structures,
including destroying and recreating the RX connection objects. In the
pthreaded case, DBHOLD the database, so we do not modify the
structures out from under another thread trying to use them.

Change-Id: I62ab7b77e17c65ec8840659957ef6d00303ea5a4
Reviewed-on: http://gerrit.openafs.org/2108
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoubik: Drop dbase versionLock during I/O and sleeps
Andrew Deason [Wed, 9 Jun 2010 17:45:57 +0000]
ubik: Drop dbase versionLock during I/O and sleeps

Currently we hold versionLock during all ubik network I/O and while we
are sleeping for whatever reason. For pthreaded ubik, to allow other
things to happen during those times, drop the lock and reacquire when
we hit the net or sleep.

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

10 years agoNew GetToken pioctl
Simon Wilkinson [Wed, 7 Apr 2010 22:03:21 +0000]
New GetToken pioctl

Implement a new, XDR based, GetToken pioctl which mirrors the new
SetToken pioctl.

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

10 years agoaklog: Add support for the new SetToken pioctl
Simon Wilkinson [Sun, 14 Feb 2010 10:00:22 +0000]
aklog: Add support for the new SetToken pioctl

Make aklog use the new extended ktc set token function when storing
tokens.

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

10 years agomacos afsdb reinit resolver on address change
Derrick Brashear [Sat, 28 Aug 2010 21:19:45 +0000]
macos afsdb reinit resolver on address change

assume a new address means we probably have new resolver info; reinit
when we get the callback.

FIXES 126440

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

10 years agocache bypass Also increment page refcount in readpage
Matt Benjamin [Sun, 29 Aug 2010 19:06:22 +0000]
cache bypass  Also increment page refcount in readpage

As noticed by a commenter, afs_linux_bypass_readpage needs
the same get_page operation as in afs_linux_bypass_readpages,
as background page accounting assumes we have done it.

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

10 years agoDFBSD update dfbsd userland
Matt Benjamin [Fri, 27 Aug 2010 23:11:32 +0000]
DFBSD  update dfbsd userland

Add new sysnames.  Fix some userland header inclusions,
defend against kernel-mode ioctl interpretation when
building UKERNEL.  Add fragments missing from DFBSD
MakefileProto template.

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

10 years agoFBSD try-relax child vnode locking (recurse only)
Matt Benjamin [Sun, 29 Aug 2010 21:33:03 +0000]
FBSD  try-relax child vnode locking (recurse only)

In cases where afs_vop_lookup would return a child vnode
locked, continue to take an exclusive lock, but allow
recursion (LK_CANRECURSE).  Allow recursion also at
afs_vop_link, where we specifically encountered a conflict
due to recursion.

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