openafs.git
13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 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>

13 years agoFBSD, DFBSD (future) call afs_FakeOpen in the write path
Matt Benjamin [Sun, 29 Aug 2010 01:57:38 +0000]
FBSD, DFBSD (future)   call afs_FakeOpen in the write path

Call afs_FakeOpen in the write path, even though nominally
it is AFS_VM_RDWR_ENV.

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

13 years agoFBSD, DFBSD (future) vnode_pager_setsize updates
Matt Benjamin [Sun, 29 Aug 2010 00:43:41 +0000]
FBSD, DFBSD (future)  vnode_pager_setsize updates

Based on review of bundled filesystems on FBSD and DFBSD,
call vnode_pager_setsize in three unhandled cases (getattr,
setattr, and io growing a file;  truncation was handled
correctly already).  Following up on a suggestion by Ben
Kaduk.

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

13 years agoMake hcrypto depend on config
Marc Dionne [Sat, 28 Aug 2010 19:50:04 +0000]
Make hcrypto depend on config

hcrypto needs the top-level include structure to be present so it
can install its header files.  Add a dependency to "config" in
the Makefile to make this explicit and prevent occasional failures
with parallel builds.

Change-Id: If588d6a15fa1fdf371ec2841cc3a6e75077cccb0
Reviewed-on: http://gerrit.openafs.org/2620
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
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 agoFBSD restore old syscall register logic for older kernels
Matt Benjamin [Fri, 27 Aug 2010 02:54:20 +0000]
FBSD  restore old syscall register logic for older kernels

The syscall_register code appears to depend on coordination
with FreeBSD upstream, which hopefully can be completed by
RELENG_9.  Use the original code for installation of the AFS
syscall everything older than that.

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

13 years agosed s/porc/proc/
Matt Benjamin [Fri, 27 Aug 2010 00:37:52 +0000]
sed s/porc/proc/

There is no osi macro osi_curporc.  Typo.

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

13 years agoAdd new SetTokenEx pioctl
Simon Wilkinson [Sun, 14 Feb 2010 01:14:54 +0000]
Add new SetTokenEx pioctl

This change implements the new, XDR based, SetTokenEx pioctl. This
pioctl permits sending multiple tokens, of multiple types, into the
kernel in a single pioctl call. This patch provides a kernel
implementation of the pioctl, and a new library function
ktc_SetTokenEx, which will use either the new pioctl, or fall back
to the old one should SetTokenEx not be available.

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

13 years agoMake unixuser's vid advisory
Simon Wilkinson [Sun, 7 Feb 2010 14:15:26 +0000]
Make unixuser's vid advisory

The 'vid' element of the unixuser structure was performing two
functions. It was used in debug messages to clarify which user's
token had expired and, in a few locations, to signify whether the
user had tokens or not.

This patch removes this dual usage. 'vid' is renamed to viceId, so
all uses are found and fixed. Where it is used for debugging, it remains,
but we only set the viceId for a user when we first use an rxkad token
on that context. Other uses of 'vid' have been replaced with tests
against the UHasTokens flag in the user's states.

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

13 years agoUnix CM: Generalise token storage
Simon Wilkinson [Fri, 5 Feb 2010 11:12:45 +0000]
Unix CM: Generalise token storage

This generalises token storage in the Unix CM, so that it isn't
rxkad specific. We add a new, dynamically allocated, list of tokens
hanging off each unixuser structure. Each token is expressed as
a discrimated union keyed on the security class of that token,
with the token's details contained within that Union.

All token handling is performed through a set of functions in
afs_token.c - token access is modified to use this interface
throughout the rest of the code.

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

13 years agoFBSD: properly register our syscall
Ben Kaduk [Thu, 26 Aug 2010 03:21:30 +0000]
FBSD: properly register our syscall

Use the provided interface, syscall_register(), instead of
manually tweaking the sysent table.
Starting afsd will still fail at present on FreeBSD HEAD
without an additional kernel patch to syscalls.master.

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

13 years agoFBSD: give osi_NetReceive time to shutdown, reprise
Matt Benjamin [Wed, 25 Aug 2010 20:19:18 +0000]
FBSD:  give osi_NetReceive time to shutdown, reprise

The delay logic needs to follow soshutdown, and precede
soclose.  The thread in osi_NetReceive is racing to do
another soreceive.  That thread needs to win the race
and notice the socket is shut down before rx_socket is
torn down.

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

13 years agoFBSD CM: don't call afs_close when recycling
Matt Benjamin [Wed, 25 Aug 2010 07:34:35 +0000]
FBSD CM: don't call afs_close when recycling

Don't call afs_close when handling VOP_CLOSE on a recycled
vnode, since there was no matching open.  This corrects the
opens count, which was seen to go have gone negative in the
reclaim vop.  For clarity, assert if afs_vop_close is entered
with a VI_DOOMED vnode and avc->opens != 0.

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

13 years agoBSD CMs: Don't call nonexistent afs_FlushVS in afs_vop_reclaim
Matt Benjamin [Wed, 25 Aug 2010 00:48:24 +0000]
BSD CMs:  Don't call nonexistent afs_FlushVS in afs_vop_reclaim

Revert BSDs to call FlushVCache in their respective reclaim vops,
afs_FlushVS no longer exists.

FIXES 127955

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

13 years agoImport of code from heimdal
Heimdal Developers [Tue, 24 Aug 2010 16:40:51 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
4f5390877a6cdb9615cf1f61f1884edc7b91522c
which is described as switch-from-svn-to-git-1447-g4f53908

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

13 years agovenus: build cacheout
Andrew Deason [Mon, 23 Aug 2010 19:03:03 +0000]
venus: build cacheout

Build 'cacheout' in all builds, so it does not succumb to bitrot.

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

13 years agovenus: make cacheout build again
Andrew Deason [Mon, 23 Aug 2010 17:55:21 +0000]
venus: make cacheout build again

Make src/venus/cacheout buildable again, by fixing several compiler
errors and warnings. Also clean up a few small things, like adding
'static' qualifiers.

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

13 years agovlserver: Allow reading during ubik writes
Andrew Deason [Fri, 21 May 2010 21:26:53 +0000]
vlserver: Allow reading during ubik writes

Turn on the new ubik_BeginTransReadAnyWrite functionality for the
vlserver, which allows us to read data from ubik during a conflicting
ubik write lock. When writing, we now update a copy of the
application-level cache, and write back the changes during a commit.

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

13 years agovlserver: Access cache via vl_ctx
Andrew Deason [Fri, 21 May 2010 20:54:33 +0000]
vlserver: Access cache via vl_ctx

The vlserver application-level ubik cache (which consists of
HostAddress, ex_addr, and cheader) is currently being accessed via
global variables everywhere. Instead, access these via the new vl_ctx
struct that is passed to functions during a transaction, so we have
the ability to modify the cache without making all changes visible as
we change it.

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

13 years agovlserver: Add a struct for trans-specific data
Andrew Deason [Fri, 21 May 2010 16:12:50 +0000]
vlserver: Add a struct for trans-specific data

Instead of passing a ubik_trans pointer to many functions inside the
vlserver, pass a vlserver-defined vl_ctx struct, so we can add new
things to keep track of in a transaction that are not part of ubik.

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

13 years agoubik: add interface for reading during write locks
Andrew Deason [Thu, 20 May 2010 20:22:11 +0000]
ubik: add interface for reading during write locks

Add ubik_BeginTransReadAnyWrite, which allows for reading from the
database, even while there is a conflicting ubik write lock. Reads are
still blocked while the local database is updating due to a write
transaction commit.

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

13 years agoubik: Fix buffers for reading-during-writes
Andrew Deason [Tue, 22 Jun 2010 19:36:42 +0000]
ubik: Fix buffers for reading-during-writes

If we are reading while a write transaction is in progress, we can
encounter a buffer that is dirty if we're on the same site as the
writer. Ignore these buffers for readers, since they contain
uncommitted changes. Then, when the writer commits, invalidate the
resultant duplicate buffer, if one exists.

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

13 years agoubik: Abstract buffer matching and pass trans ptrs
Andrew Deason [Tue, 22 Jun 2010 18:24:27 +0000]
ubik: Abstract buffer matching and pass trans ptrs

Abstract the code for matching buffers in DRead, and pass around
ubik_trans pointers instead of ubik_dbase pointers. This changes no
behavior, but makes changing ubik buffer code a bit easier.

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

13 years agoDon't include afsconfig.h in rxgen headers
Simon Wilkinson [Sat, 21 Aug 2010 11:05:37 +0000]
Don't include afsconfig.h in rxgen headers

Some headers generated by rxgen are installed. We can't use
afsconfig.h in installed headers, as it isn't installed (and it
shouldn't be, as it contains autoconf defines which will almost
certainly have namespace conflicts with other packages)

Revert the portion of 972a407 that added afsconfig.h to the
h_output function. This should now be safe as stds.h no longer
relies on the result of autoconf tests.

FIXES 127931

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

13 years agos390x: only declare afs_sys_setgroups32_page where needed
Marc Dionne [Fri, 20 Aug 2010 20:11:59 +0000]
s390x: only declare afs_sys_setgroups32_page where needed

Variable afs_sys_setgroups32_page is only used when __NR_setgroups32
is not defined.  Make the declaration depend on it as well to clear
up an unused variable warning.

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

13 years agoFixes for signed char architectures
Marc Dionne [Fri, 20 Aug 2010 20:37:56 +0000]
Fixes for signed char architectures

"char" is unsigned on s390x, which causes a few warnings where we
test for negative values.

Add a signed modifier in a few cases, and in vos.c replace with an
int to match a similar section of code in the same file.

Mostly a warning fix, but in one case the variable could be used
to return a -1 error value, so it may have caused an actual bug.

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

13 years agoIgnore old style definition warnings in generated code
Marc Dionne [Fri, 20 Aug 2010 21:42:47 +0000]
Ignore old style definition warnings in generated code

Older flex can generate functions that trigger the
"old-style-definition" warning.
Since it's generated code, just ignore it.

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

13 years agoPrototype warning cleanup - big endian
Marc Dionne [Fri, 20 Aug 2010 20:27:44 +0000]
Prototype warning cleanup - big endian

Move function definitions above their use in quad_cksum.c and
remove the (incomplete) prototypes.

Clears up a few warnings on big endian systems.

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

13 years agoConfigure: Tidy up AC_CHECK_FUNCS
Simon Wilkinson [Fri, 20 Aug 2010 12:17:53 +0000]
Configure: Tidy up AC_CHECK_FUNCS

Move all of our AC_CHECK_FUNCS calls into a single, ordered, list
so that it's easier to see what's being checked for and what's not.

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

13 years agohcrypto: Check for arc4random
Simon Wilkinson [Fri, 20 Aug 2010 12:07:04 +0000]
hcrypto: Check for arc4random

Add a configure test for the arc4random function which hcrypto can
use as an entropy source

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

13 years agoAdd a few missing entries to our .gitignores
Simon Wilkinson [Fri, 20 Aug 2010 12:19:30 +0000]
Add a few missing entries to our .gitignores

Add a couple of build products to the relevant .gitignore files

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

13 years agohcrypto: Fix for IRIX
Simon Wilkinson [Thu, 19 Aug 2010 23:18:17 +0000]
hcrypto: Fix for IRIX

Fix the hcrypto build for IRIX, by including param.h in the
configuration header so that the platform specific redefinitions of
"inline" work correctly.

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

13 years agoAvoid thread-unsafe PrintInode in threaded code
Andrew Deason [Mon, 12 Jul 2010 20:47:15 +0000]
Avoid thread-unsafe PrintInode in threaded code

Some potentially-threaded callers were calling PrintInode with a NULL
first argument, which is not threadsafe. Alter them to use local
storage.

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

13 years agoWindows: vol-salvage SalvInfo fixes
Andrew Deason [Thu, 19 Aug 2010 16:35:40 +0000]
Windows: vol-salvage SalvInfo fixes

Commit 3d7388b790ef21de552ec60d379764df067ae421 broke the windows
build. Fix it:

 - SVGParms_t has no salvinfo member, but an svgp_salvinfo member

 - Correct the SalvageVolumeGroup prototype to match the actual
   implementation

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

13 years agoAdd OpenAFS build machinery for libhcrypto
Simon Wilkinson [Wed, 7 Apr 2010 20:45:39 +0000]
Add OpenAFS build machinery for libhcrypto

Add an OpenAFS build environment for the symmetric algorithms in
libhcrypto.

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

13 years agoRemove the global tempHeader/stuff structures
Andrew Deason [Thu, 22 Apr 2010 22:09:18 +0000]
Remove the global tempHeader/stuff structures

Currently, volinodes.h defines an array ('stuff') for easily accessing
information about different inode types. Part of the array points to
parts of a global 'tempHeader' structure, making this not threadsafe.
Change this into an interface which utilizes local storage to make
this threadsafe and remove those horridly-named global variables.

This adds the init_inode_info static inline function, for initializing
a local inode information table.

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

13 years agovol-salvage: Move global vars into SalvInfo struct
Andrew Deason [Thu, 24 Jun 2010 20:45:05 +0000]
vol-salvage: Move global vars into SalvInfo struct

Reduce the number of globals used in the salvager code, by making
functions pass around a 'salvinfo' structure that contains the
information regarding a particular salvage.

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

13 years agolibafsrpc: Add new XDR symbols to exports
Simon Wilkinson [Thu, 22 Jul 2010 14:22:09 +0000]
libafsrpc: Add new XDR symbols to exports

Add the new XDR symbols which we've recently introduced to the
exports list so they can be used from the shared libraries

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

13 years agoWindows: fix Freelance trailing dot enforcement
Jeffrey Altman [Tue, 17 Aug 2010 05:24:39 +0000]
Windows: fix Freelance trailing dot enforcement

The cm_enforceTrailingDot() function failed if there was a
trailing dot followed by white space.

LICENSE MIT

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

13 years agoImport of code from heimdal
Heimdal Developers [Sun, 9 May 2010 18:33:54 +0000]
Import of code from heimdal

This commit updates the code imported from the external
heimdal git repository to their revision
40ef7759b917648938416e15521d383e2eade5cf
which is described as switch-from-svn-to-git-1333-g40ef775

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

13 years agoHeimdal import: Add hcrypto files
Simon Wilkinson [Sat, 15 May 2010 21:48:37 +0000]
Heimdal import: Add hcrypto files

Add the files which we intend to use from Heimdal's hcrypto library
to the list of files which we import from the Heimdal git repo.

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

13 years agoHandle whitespace better in import script
Simon Wilkinson [Sun, 16 May 2010 12:04:47 +0000]
Handle whitespace better in import script

Make the import script handle multiple, rather than just single,
whitespace separators between source and destination files.

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

13 years agoWindows: Fix remove 'register' patch
Jeffrey Altman [Tue, 17 Aug 2010 06:13:31 +0000]
Windows: Fix remove 'register' patch

The register removal patch broke the Windows build.
Fix it.

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

13 years agodeath to trailing whitespace
Marcus Watts [Tue, 17 Aug 2010 03:52:36 +0000]
death to trailing whitespace

if we're gonna clean up...

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

13 years agodeath to register
Marcus Watts [Thu, 15 Jul 2010 03:13:20 +0000]
death to register

in soviet compilers, compiler optimizes you.
stop providing dated (and annoying for debugging) register keywords.

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

13 years agoopenafs 1.5.76 openafs-devel-1_5_76
Derrick Brashear [Thu, 12 Aug 2010 04:33:58 +0000]
openafs 1.5.76

make openafs 1.5.76

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

13 years agoWindows Change Log for 1.5.76
Jeffrey Altman [Thu, 12 Aug 2010 05:47:41 +0000]
Windows Change Log for 1.5.76

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

13 years agoWindows: Return error for SetToken PIOCTL_LOGON if not LocalSystem
Jeffrey Altman [Mon, 16 Aug 2010 18:27:44 +0000]
Windows: Return error for SetToken PIOCTL_LOGON if not LocalSystem

If the PIOCTL_LOGON flag is set and the user is not LocalSystem,
return Access Denied.

LICENSE MIT

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

13 years agoWindows: prevent buffer overrun in cklog
Jeffrey Altman [Mon, 16 Aug 2010 14:09:22 +0000]
Windows: prevent buffer overrun in cklog

The Windows version of klog.exe will overwrite the realm and
password buffers if the command line input is too long.  Generate
an error and terminate the program instead.

Change-Id: I80671adcf92e9140f14a943b2677a352d2223eee
Reviewed-on: http://gerrit.openafs.org/2558
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 agoWindows: Only Local System Account may set tokens for alternate ids
Jeffrey Altman [Thu, 12 Aug 2010 05:48:16 +0000]
Windows: Only Local System Account may set tokens for alternate ids

Only permit tokens to be set for alternate ids from the system
account.

LICENSE MIT

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

13 years agoWindows: Parse Freelance entries and enforce trailing dot but no trailing ws
Jeffrey Altman [Sat, 14 Aug 2010 00:58:43 +0000]
Windows: Parse Freelance entries and enforce trailing dot but no trailing ws

Make sure that there is a trailing dot and no trailing whitespace
for both Mount Point and Symlink entries read from the Freelance
registry key.

LICENSE MIT

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

13 years agoautoconf detection of label support
Chaz Chandler [Wed, 4 Aug 2010 18:17:03 +0000]
autoconf detection of label support

acinclude.m4 now has struct label support detection and sets
HAVE_STRUCT_LABEL_SUPPORT in afsconfig.h.  Obviates complicated
ifdefs in various src/afs/ and src/rx/ files.  Must run regen.sh
to generate new configure and afsconfig.h.in, then configure will
detect label support and set afsconfig.h appropriately.  Not sure
what to do for Windows, but should be a step in the right
direction.

Fixes issue with compilation of libuafs on IRIX and sunpro by accurately
detecting label support.

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

13 years agoLinux: avoid oops in memcpy_toiovec
Marc Dionne [Thu, 12 Aug 2010 20:33:04 +0000]
Linux: avoid oops in memcpy_toiovec

With ADAPT_PMTU enabled, kernel_recvmsg can be called to receive
errors.  The call is made with no iovec supplied (we pass a NULL
pointer), but with a size of 256.  In the kernel, the memcpy_toiovec
function tests for size > 0, and proceeds to check iovec->iov_len,
which causes an oops.  Fix by setting the size to 0.

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

13 years agoLinux: Rework statfs super block operations configure test
Marc Dionne [Wed, 11 Aug 2010 23:28:53 +0000]
Linux: Rework statfs super block operations configure test

The configure test to detect if the statfs super block operation
needs a dentry argument is based on vfs_statfs, and assumes that
its signature matches the one of the operation.  In 2.6.36 this is
no longer true and the test fails.

Rework the test to actually test the operation we're interested in.

This change is required for 2.6.36.

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

13 years agoLinux: switch to evict_inode
Marc Dionne [Wed, 11 Aug 2010 22:55:29 +0000]
Linux: switch to evict_inode

In 2.6.36, the delete_inode and clear_inode inode operations
are replaced by evict_inode.
Rename our current clear_inode to evict_inode, and add a few
things that were previously handled by the generic delete_inode.

This is required for 2.6.36.

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

13 years agoLinux: adapt to truncate sequence changes
Marc Dionne [Wed, 11 Aug 2010 22:20:59 +0000]
Linux: adapt to truncate sequence changes

As part of changes to the truncate sequence, inode_setattr() no
longer exists, and all filesystems have to define the setattr op
so we can assume that it is not NULL.

Introduce a compat inline function afs_inode_setattr that hides
the tests and the different versions from the main code.

Note that the existing test for the inode_setattr() return type
will fail, but the value is no longer used in that case.

This is required for 2.6.36

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

13 years agoLinux: use %pI4 if NIPQUAD is not available
Marc Dionne [Wed, 11 Aug 2010 21:18:32 +0000]
Linux: use %pI4 if NIPQUAD is not available

The definition of NIPQUAD has been removed from the kernel headers
in the mainline kernel.  Replace it by using the %pI4 format
specifier which takes the IP address as a single argument.

There should be no change in the output.

This fix is required for 2.6.36.

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

13 years agodisable pmtu error gathering
Derrick Brashear [Thu, 12 Aug 2010 04:48:45 +0000]
disable pmtu error gathering

don't enable kernel pmtu, don't collect errors.

a report from Marc Dionne suggests there are still issues here

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

13 years agoWindows: comparisons of nul strings should match
Jeffrey Altman [Thu, 12 Aug 2010 04:48:44 +0000]
Windows: comparisons of nul strings should match

When comparing nul strings in cm_strnicmp_utf8 and cm_strnicmp_utf16
the functions should return 0.

LICENSE MIT

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

13 years agoviced: VNOVOL on deleted volumes
Andrew Deason [Tue, 10 Aug 2010 19:16:39 +0000]
viced: VNOVOL on deleted volumes

When the volserver deletes a volume, the fileserver should respond to
future access to that volume with VNOVOL and not VOFFLINE, since the
volume doesn't exist anymore. Do this in DAFS via a new state,
VOL_STATE_DELETED, and in non-DAFS by just setting specialStatus to
VNOVOL.

In the future we should also make sure the vp's for deleted volumes
get freed after a couple of hours, but not yet.

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

13 years agovolser: Ignore duplicate file tags when restoring
Andrew Deason [Fri, 6 Aug 2010 19:32:16 +0000]
volser: Ignore duplicate file tags when restoring

Currently, if the volserver encounters multiple file tags for a vnode
when restoring a volume dump, it will create extra vnodes which are
not recorded anywhere, and are leaked when the volume is removed.
Instead of doing that, ignore any duplicate file tags that are
encountered (which is what happens with other tags), and log a
warning.

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

13 years agoLINUX: More flock fixes
Simon Wilkinson [Wed, 11 Aug 2010 22:14:31 +0000]
LINUX: More flock fixes

Turns out the we have two almost identical lock routines on Linux,
one for POSIX locks, and one for flocks. Fix them both. Also,
while we're at it, make the same fixes in the LINUX24 tree.

Thanks to Andrew Deason for pointing out the oversight in the
original patch (5abe706a7e237d3872db3638d947a14c935370d5)

Change-Id: I59f0f1e12af36a97e490df36537ac17e8ed87303
Reviewed-on: http://gerrit.openafs.org/2535
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>