openafs.git
10 years agoRefactor afs_NewVCache
Simon Wilkinson [Sat, 7 Nov 2009 00:16:28 +0000]
Refactor afs_NewVCache

afs_NewVCache was a twisty turny maze of #ifdefs and duplicated code.
This makes a number of sweeping changes to simplify this code, and to
move platform specific elements out into their own directories.

*) ShakeLooseVCaches is refactored so that the same code can be used
   both for platforms that support dynamic vcaches, and those which
   don't.
*) afs_NewVCache, ShakeLooseVCaches, and afs_AllocVCache are all
   modified to remove platform specific code, and to call platform
   specific functions.
*) A new platform file 'osi_vcache.c' is created to hold a number of
   platform specific vcache operations:
   *) osi_TryEvictVCache handles the decision of whether a vcache can
      be evicted or not, and does so if required
   *) osi_NewVnode allocates a new vnode
   *) osi_PrePopulateVCache does the necessary population of the
      vcache, before it's threaded onto the VLRUQ and associated hash
      tables.
   *) osi_AttachVnode handles attaching an OS vnode to our vcache,
      where that is necessary
   *) osi_PostPopulateVCache handles the vcache population that must
      occur after we're on the VLRUQ and have a vnode attached.

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

10 years agopts mem -expandgroups and -supergroups examples
Michael Meffie [Mon, 3 May 2010 19:51:40 +0000]
pts mem -expandgroups and -supergroups examples

Examples of the pts mem -expandgroups and -supergroups
options for the man page.

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

10 years agoOpenBSD: Fix bug in setpag() when group list is empty
Antoine Verheijen [Mon, 3 May 2010 21:04:20 +0000]
OpenBSD: Fix bug in setpag() when group list is empty

In OpenBSD, the PAG uses the 2nd and 3rd group slots in the task's
group list. If an application sets en empty group list (such as Samba
does), any existing PAG is lost and any new one is NOT set because
the existing code will set the new group count to 2 instead of 3, and
it leaves the first group entry as garbage (whatever random value the
memory contained), thereby totally messing up the task's group list.
This patch fixes it so that it behaves as expected.

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

10 years agoFix pattern to detect i386-based OpenBSD system type
Antoine Verheijen [Mon, 3 May 2010 20:32:13 +0000]
Fix pattern to detect i386-based OpenBSD system type

When the pattern to detect OpenBSD system types (via MKAFS_OSTYPE) was split
into two separate ones for amd64 and i386 architectures, the pattern for
i386-based systems was not set quite right. As a result, i386-based OpenBSD
systems are no longer detected properly at this stage, resulting in an error
of "cannot find input file: src/libafs/MakefileProto..in" during configure.
This patch corrects the pattern.

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

10 years agoWindows: Show configuration pages for all types of MSI installations
Asanka Herath [Tue, 20 Apr 2010 19:06:41 +0000]
Windows: Show configuration pages for all types of MSI installations

The OpenAFS MSI installer wizard used to not show any configuration
pages for "Typical" and "Complete" installations.  Setting the
workstation cell and logon options during installation required
selecting the "Custom" option.  Many users choose the "Typical" option
during installation, and thus would never see the configuration pages.
Therefore, for these users, the workstation cell was being set to the
default.

This patch makes the workstation cell and logon option configuration
pages visible to all types of installations (except silent
installations which show no UI).

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

10 years agoProvide a queue_NodeInit() interface
Tom Keiser [Thu, 11 Mar 2010 16:38:31 +0000]
Provide a queue_NodeInit() interface

Provide a queue_NodeInit() interface for the rx queue package.

Change-Id: I85f6caf3605b9a88113ff4d904012ed2aa12a679
Reviewed-on: http://gerrit.openafs.org/1860
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoWindows: Restructure cm_LookupInternal addition of Freelance entries
Jeffrey Altman [Sun, 2 May 2010 19:30:27 +0000]
Windows: Restructure cm_LookupInternal addition of Freelance entries

cm_LookupInternal creates Freelance mount points and symlinks
when queries cannot be found in the Freelance root.afs directory.
If the search name is a full cell name for which vldb information
can be obtained, then a mount point is added.  If the search name
is a left-most substring or the full cell name with a dot appended
to it, then a symlink was created.  This approach created a very
poluted Freelance name space.

This patchset makes the following changes:

 1. Do not create symlinks with a dot appended to the cellname

 2. Do not create symlinks where the left-most substring is not
    a full dot separated component of the cellname.

 3. Permit lookups to succeed when we would have created a
    symlink in the past without creating the symlink.

LICENSE MIT

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

10 years agoWindows: Permit BPlus tree lookups within cm_ApplyDir
Jeffrey Altman [Sun, 2 May 2010 19:26:39 +0000]
Windows: Permit BPlus tree lookups within cm_ApplyDir

BPlus tree lookups are much faster than searching through
the native directory format on Windows because the case sensitive
hash tables cannot be used successfully.  Permit BPlus trees
to be used except when called with cm_BPlusDirFoo as the action
function because cm_BPlusDirFoo is used to build the BPlus trees
from the native directory format.

LICENSE MIT

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

10 years agoWindows: Prevent cm_FreelanceAddSymlink from creating a symlink ending in a dot
Jeffrey Altman [Sun, 2 May 2010 19:05:40 +0000]
Windows: Prevent cm_FreelanceAddSymlink from creating a symlink ending in a dot

Symlinks are ending up in the Freelance root.afs directory that
end with a dot.  Make sure it cannot happen.

LICENSE MIT

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

10 years agoWindows: normalize error codes from cm_FreelanceAddSymlink
Jeffrey Altman [Sun, 2 May 2010 19:03:52 +0000]
Windows: normalize error codes from cm_FreelanceAddSymlink

Return all error codes from the end of the function.

LICENSE MIT

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

10 years agoWindows: Force rebuilding Freelance directory in AddMount and AddSymlink
Jeffrey Altman [Sun, 2 May 2010 18:48:00 +0000]
Windows: Force rebuilding Freelance directory in AddMount and AddSymlink

cm_FreelanceAddMount and cm_FreelanceAddSymlink is supposed to
return the allocated FID of the entry that was added.  However,
cm_NameI is called to perform the lookup without forcing an update
of the Freelance fake directory.  As a result the entry may not be
found.

Force an update prior to calling cm_NameI() by using
cm_clearLocalMountPointChange() and cm_reInitLocalMountPoints()
if required.

LICENSE MIT

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

10 years agoWindows: normalize return codes from cm_FreelanceAddMount
Jeffrey Altman [Sun, 2 May 2010 18:17:43 +0000]
Windows: normalize return codes from cm_FreelanceAddMount

Instead of returning an undefined CM error code, -1, which might
end up being confused with an Rx error, return legal CM_ERROR_xxx
values.

LICENSE MIT

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

10 years agoWindows: use cm_noteLocalMountPointChange whenever fakeDirVersion is changed
Jeffrey Altman [Sun, 2 May 2010 18:03:23 +0000]
Windows: use cm_noteLocalMountPointChange whenever fakeDirVersion is changed

cm_noteLocalMountPointChange() is meant to be used when fakeDirVersion
is changed.  It previously wasn't used because cm_noteLocalMountPointChange()
would obtain the cm_Freelance_Lock.  Now that cm_noteLocalMountPointChange()
can be called while holding the lock, use it everywhere.

LICENSE MIT

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

10 years agoWindows: add locked parameter to cm_noteLocalMountPointChange
Jeffrey Altman [Sun, 2 May 2010 17:56:24 +0000]
Windows: add locked parameter to cm_noteLocalMountPointChange

If cm_Freelance_Lock is held set the 'locked' parameter to TRUE.
This avoids a requirement to drop the lock only to have it be
obtained when cm_noteLocalMountPointChange.

LICENSE MIT

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

10 years agoWindows: remove unused code from cm_FollowMountPoint
Jeffrey Altman [Sun, 2 May 2010 17:21:12 +0000]
Windows: remove unused code from cm_FollowMountPoint

The variable 'tlen' is set to the length of the mount point
target string but is never used.  Remove it.

LICENSE MIT

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

10 years agoWindows: initialize to zero Freelance fake root directory
Jeffrey Altman [Sun, 2 May 2010 17:11:14 +0000]
Windows: initialize to zero Freelance fake root directory

The Freelance fake root directory buffers were not zero-filled.
This results in random behavior that can cause the service to
terminate unexpectedly.

LICENSE MIT

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

10 years agoWindows: make cm_BPlusDirFoo public
Jeffrey Altman [Sun, 2 May 2010 17:04:42 +0000]
Windows: make cm_BPlusDirFoo public

Make cm_BPlusDirFoo so that the function pointer can
be referenced from cm_ApplyDir.

LICENSE MIT

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

10 years agoWindows: correct "fs quota" pioctl validation check
Jeffrey Altman [Sun, 2 May 2010 13:21:48 +0000]
Windows: correct "fs quota" pioctl validation check

The validation check for the response from the GetVolumeStatus
pioctl is incorrect.  The response is not simply a VolumeStatus
structure but also several C strings appended to it.

LICENSE MIT

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

10 years agoWindows: getAFSServer wrong variable used in uncompiled code
Jeffrey Altman [Sun, 2 May 2010 13:16:29 +0000]
Windows: getAFSServer wrong variable used in uncompiled code

In the uncompiled implementation of getAFSServer, the unmodified
'cellname' is used in the send_DNS_AFSDB_Query call instead of
the properly constructed 'query' variable.

LICENSE MIT

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

10 years agoWindows: FlushFile ioctl should call cm_FSync, not buf_CleanVnode
Jeffrey Altman [Wed, 28 Apr 2010 16:33:03 +0000]
Windows: FlushFile ioctl should call cm_FSync, not buf_CleanVnode

When flushing a file, we need to commit the file length changes
as well as the dirty buffers.  Call cm_FSync instead of buf_CleanVnode
which is called by cm_FSync.

LICENSE MIT

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

10 years agoWindows: add 'locked' flag to cm_FSync and call when dropping write locks
Jeffrey Altman [Wed, 28 Apr 2010 16:21:00 +0000]
Windows: add 'locked' flag to cm_FSync and call when dropping write locks

cm_FSync should be called when releasing file server write locks.
This ensures that all dirty buffers are stored before the lock
can be acquired by another client.

Since cm_Unlock holds the cm_scache_t->rw exclusively when calling
cm_FSync, add a 'locked' parameter to cm_FSync to avoid an unnecessary
release and reacquire of the rwlock.

LICENSE MIT

Change-Id: I70bbeffc24ec4238461281bab4006b3a57b275e2
Reviewed-on: http://gerrit.openafs.org/1876
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

10 years agoWarning fix: cpp hates apostrophes
Marc Dionne [Wed, 28 Apr 2010 23:07:32 +0000]
Warning fix: cpp hates apostrophes

The compiler complains when the text in a #warning contains a
single apostrophe:
   error: missing terminating ' character

Change the text to avoid it.

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

10 years agonetbsd: rebase cm at NetBSD 4.0
Matt Benjmain [Wed, 28 Apr 2010 10:19:16 +0000]
netbsd: rebase cm at NetBSD 4.0

Rebases the NetBSD client port at OpenBSD, which was originally
based on an original NetBSD client port by John Kohl.  The
platforms remain closely connected.

At latest milestone, the port builds as a NetBSD LKM, which was
loadable and can mount /afs (but much work remains past this
point).

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

10 years agoupstream dumpscan changes
Derrick Brashear [Wed, 28 Apr 2010 06:02:05 +0000]
upstream dumpscan changes

pull in code changes from upstream for dumpscan

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

10 years agoLinux: Register number sysctls only when desperate
Simon Wilkinson [Wed, 28 Apr 2010 00:13:30 +0000]
Linux: Register number sysctls only when desperate

The AFS sysctl interface was trying to register numeric system
calls whenever the kernel would let it. This is anti-social, as
we've never had sysctl numbers allocated to us. In kernels newer
than 2.6.24, this misbehaviour is detected and punished. In recent
kernels, the binary interface has gone away entirely.

Since 2.6.19, the kernel has supported allocated unnumbered system
calls. These are only available via /proc/sys (and not the using
the legacy, binary, API), but they're really the only interface
available to us.

Change the sysctl registration code to use unnumbered calls whenever
they are available. Unnumbered calls aren't available in 2.4.x, so
completely remove that code there.

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

10 years agoLinux: specify void argument for afs_try_to_freeze inlines
Marc Dionne [Wed, 28 Apr 2010 00:00:23 +0000]
Linux: specify void argument for afs_try_to_freeze inlines

The new freeze inlines take no arguments, but need to be declared
as taking (void) to prevent warnings that it is not a proper prototype.

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

10 years agoLinux autoconf: fix name for struct cred test
Marc Dionne [Tue, 27 Apr 2010 22:36:46 +0000]
Linux autoconf: fix name for struct cred test

The new macro scheme changes the name of the tested define.
Update the code to match.

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

10 years agoLinux autoconf typo
Marc Dionne [Tue, 27 Apr 2010 22:25:15 +0000]
Linux autoconf typo

The test for the new export ops has a typo which
makes the test fail where it should succeed: eops -> _eops

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

10 years agoAdd some directory package doxygen comments
Tom Keiser [Thu, 25 Mar 2010 17:08:51 +0000]
Add some directory package doxygen comments

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

10 years agoLinux: autoconf fallout
Simon Wilkinson [Tue, 27 Apr 2010 21:16:24 +0000]
Linux: autoconf fallout

grap != grab - fix spelling of grab_cache_page_write_begin

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

10 years agonetbsd: remove old (non-original) NBSD port
Matt Benjmain [Tue, 27 Apr 2010 16:06:48 +0000]
netbsd: remove old (non-original) NBSD port

Prepare for rebase of NBSD port at the current OBSD port,
which is descended directly from the original NBSD port and
more closely resembles it.

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

10 years agoLinux: Remove unnecessary crhold on incomplete kernel credentials
Marc Dionne [Sun, 25 Apr 2010 02:12:27 +0000]
Linux: Remove unnecessary crhold on incomplete kernel credentials

When credentials debugging is active in the kernel, sanity checks
in various credentials functions such as get_cred or put_cred
require that they are called with full fledged kernel credentials.
This can be a problem with recent kernels in osi_Init where we
build our own credentials and try to "crhold" them.
Getting a reference doesn't make much sense anyway since we're
using a statically allocated structure that we never try to free
or modify.

As a minimal fix, just don't call crhold when we're using
the kernel credentials structure.

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

10 years agoflush changes on LOCK_EX unlock
Derrick Brashear [Mon, 26 Apr 2010 21:43:16 +0000]
flush changes on LOCK_EX unlock

right now, flock with LOCK_EX, on unlock, triggers an async store.
make it sync, but also, make sure to ask to have any in-memory
data sent to us (e.g. VM_StoreAllSegments); unlike Solaris
VMSYNC_INVAL, we don't want to invalidate the pages, just get copies
written back.

LOCK_SH did not, does not and AFAICT should not trigger writes.

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

10 years agoallow file length to be updated unless we're writing
Derrick Brashear [Mon, 26 Apr 2010 20:41:29 +0000]
allow file length to be updated unless we're writing

right now, merely having the file open O_RDWR, or mapped,
precludes a length update from being reflected.

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

10 years agoLinux: Reorder the tests
Simon Wilkinson [Tue, 27 Apr 2010 18:31:55 +0000]
Linux: Reorder the tests

As a final change to the Linux autoconf stuff, reorder the list of
tests so that it's more easy to see what's being checked for, and to
prevent multiple copies of the same thing being added.

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

10 years agoLinux: Don't preprocess osi_vfs.h
Simon Wilkinson [Tue, 27 Apr 2010 17:57:30 +0000]
Linux: Don't preprocess osi_vfs.h

Before we did inodes properly, we needed to pre-process osi_vfs.h,
in order to merge our inode structure with the Linux one. Ever since
we moved to native inodes, that preprocessing has been disabled, and
we've just copied osi_vfs.hin to osf_vfs.h Skip this pointless step,
permanently rename osi_vfs.hin to osi_vfs.h, and remove the unused
support scripts.

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

10 years agoLinux: Don't waste autoconf checks on cpp defines
Simon Wilkinson [Tue, 27 Apr 2010 16:49:19 +0000]
Linux: Don't waste autoconf checks on cpp defines

If something is a #define, then there's no point in doing a test
compile to check for its presence. Instead, just do #if defined(X)

Remove the tests for for_each_process and prev_task.

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

10 years agoLinux: Add general autoconf macro for Linux kernel
Simon Wilkinson [Tue, 27 Apr 2010 16:41:22 +0000]
Linux: Add general autoconf macro for Linux kernel

Add AC_CHECK_LINUX_BUILD() to do a standardised Linux build, which
takes a "checking" message, the autoconf variable to use to cache
the results, headers and code to run, preprocessor variable to
define, and a description of that variable.

Reimplement all of our existing check macros in terms of this one,
resolving many typos along the way.

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

10 years agoLinux: Add autoconf macro for structure checks
Simon Wilkinson [Tue, 27 Apr 2010 12:02:20 +0000]
Linux: Add autoconf macro for structure checks

Add a new autoconf macro for doing structure element checks, and
modify all simple structure checks to use it. This introduces a
standard name form - STRUCT_structure_HAS_element, so there are
some changes in the code to make use of this standard form.

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

10 years agoLinux: Macroise kernel function autoconf tests
Simon Wilkinson [Mon, 26 Apr 2010 22:54:05 +0000]
Linux: Macroise kernel function autoconf tests

We spend a lot of time in autoconf checking to see if kernel
functions are available. Rather than copying and pasting the same
code everytime we do so, create a macro to do function tests, and
use that macro. This results in standardised naming, so change all
of the places that use autoconf results to use the same standardised
names.

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

10 years agoLinux: Tidy up freezer code
Simon Wilkinson [Mon, 26 Apr 2010 21:13:39 +0000]
Linux: Tidy up freezer code

Linux now provides try_to_freeze(), which can be used to replace
all of our refrigerator code. This has been in the tree for a long
time, and actually predates many of the changes we've been modifying
our code to work with. So, use try_to_freeze wherever we can, and keep
a simpler compatibility function for kernels which are too old to have
it.

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

10 years agoLinux: Simplify header file checks
Simon Wilkinson [Mon, 26 Apr 2010 20:34:17 +0000]
Linux: Simplify header file checks

Provide an autoconf macro to perform tests for the existence of
Linux kernel header files. Use this to standardise the naming of
header file presence #defines, and to simplify the linux tests.

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

10 years agoRename afs_nbsd_* functions in OBSD
Matt Benjamin [Tue, 27 Apr 2010 17:03:36 +0000]
Rename afs_nbsd_* functions in OBSD

The OBSD cm port prefixes function names with afs_nbsd_, an
artifact of its origin in the original NBSD cm port.  Make the
prefix afs_obsd_.

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

10 years agoOverzealous .gitignore under rxkad
Simon Wilkinson [Mon, 26 Apr 2010 22:36:38 +0000]
Overzealous .gitignore under rxkad

The .gitignore in rxkad ignores sboxes.h and fcrypt.h,
since they used to get copied there from the domestic subdir.
Now that they actually live under rxkad, they souldn't be
ignored.

(with thanks to Marc for the commit message)

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

10 years agoOverzealous clean target under rxkad
Marc Dionne [Mon, 26 Apr 2010 22:15:16 +0000]
Overzealous clean target under rxkad

The clean target under rxkad removes sboxes.h and fcrypt.h,
since they used to get copied there from the domestic subdir.
Now that they actually live under rxkad, they souldn't be
removed.

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

10 years agodcache dirty pages flag is solaris only
Derrick Brashear [Mon, 26 Apr 2010 19:55:57 +0000]
dcache dirty pages flag is solaris only

note that IFDirtyPages is Solaris-only, so there's no confusion. may be
worth visiting to see if and how the code should be minimized or adapted
for elsewhere

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

10 years agoLinux: Don't hide memory management
Simon Wilkinson [Fri, 23 Apr 2010 16:07:40 +0000]
Linux: Don't hide memory management

Given that we now only switch from user space into kernel space in
one place, don't hide the mechanism we use to do so behind macros.
This makes it much easier to visually confirm the correctness of the
code.

Change-Id: Ie52e071c81a9178c792be1eaa7e36d8453ebb319
Reviewed-on: http://gerrit.openafs.org/1820
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoLinux: The kernel module always runs in the kernel
Simon Wilkinson [Fri, 23 Apr 2010 16:10:15 +0000]
Linux: The kernel module always runs in the kernel

There's no situation where we'd be including osi_machdep.h and not
be building for the kernel, so just remove the case that disables all of
the locks if __KERNEL__ isn't defined.

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

10 years agofix other oldtvix typo
Derrick Brashear [Mon, 26 Apr 2010 04:21:30 +0000]
fix other oldtvix typo

i failed to push this to commit 0dac8f93af5262472bc5bdf94dbb605a24da59d0,
and so, well, here's the real fix. sorry.

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

10 years agoInitialize oldvtix
Marc Dionne [Thu, 22 Apr 2010 21:22:37 +0000]
Initialize oldvtix

Initialize the variable to avoid compiler complaints that it
could be used uninitialized.  Use a sentinel value and issue
a warning if we try to use the variable and we haven't set
it to a useful value.

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

10 years agoLinux: Use kernel network helper functions
Simon Wilkinson [Fri, 23 Apr 2010 17:03:49 +0000]
Linux: Use kernel network helper functions

Linux has various network helper functions available, which are
guaranteed to do the right thing in terms of setting address space
limits, not dereferencing NULL pointers, and the like. Use these, where
they're available, rather than rolling our own.

kernel_sendmsg and kernel_recvmsg appeared in 2.6.8.

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

10 years agoLinux: Remove old code from RX kernel implementation
Simon Wilkinson [Fri, 23 Apr 2010 17:38:02 +0000]
Linux: Remove old code from RX kernel implementation

The RX implementation was split into LINUX and LINUX24 along with
the kernel, but the old 2.4 and 2.2 only code was never removed from
the LINUX/ directory. Do so now.

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

10 years agoLinux: Don't pass f_pos down to the filesystem
Simon Wilkinson [Fri, 23 Apr 2010 15:54:39 +0000]
Linux: Don't pass f_pos down to the filesystem

In 2.6.8, Linux shifted from passing f_pos directly to the read
and write routines, and started passing a copy. This helps reduce,
but does not remove, the race issues with f_pos itself. Make this
change for us.

Take the opportunity to remove the uneccessary macros, and tidy up
some casting.

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

10 years agoLinux: Removed unused define
Simon Wilkinson [Fri, 23 Apr 2010 14:59:46 +0000]
Linux: Removed unused define

VFS_STATFS isn't used in the Linux 2.6 case, and is wrong anyway.
Remove it in an attempt to clarify some particularly muddy water.

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

10 years agoLinux: Don't roll our own llseek
Simon Wilkinson [Fri, 23 Apr 2010 14:07:58 +0000]
Linux: Don't roll our own llseek

llseek is a little more complex than just setting the pos field of
the file structure.

Where vfs_llseek is available to us (it has been since 2.6.8) use that
directly. If vfs_llseek isn't available, then use either the
filesystem's llseek method, or default_llseek (available since 2.6.0),
to ensure we get the proper locking.

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

10 years agocachemgr store file too big error exit via usual path
Derrick Brashear [Sat, 24 Apr 2010 21:05:47 +0000]
cachemgr store file too big error exit via usual path

have just one path for exiting on errors so we do everything

this means we will EndCall, instead of not, in the EFBIG case

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

10 years agoMove rxkad/domestic/* into rxkad/ directory proper
Simon Wilkinson [Sun, 25 Apr 2010 21:07:04 +0000]
Move rxkad/domestic/* into rxkad/ directory proper

Historically, the fcrypt code lived in its own directory, named
'domestic', so that ACLs could be used to prevent nasty foreigners
from getting access to it. Now that those days are gone, having the
domestic directory just complicates builds. Remove it, and reunite
fcrypt with the rest of the tree.

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

10 years agoImprove shared library building support
Simon Wilkinson [Sun, 25 Apr 2010 18:11:06 +0000]
Improve shared library building support

This change removes the need to maintain two forms of symbol export
lists, instead generating the simpler lists required by AIX and Mac OS X
from the more complex Linux and Solaris mapfile. It can only handle
simple mapfiles at present, any more complex files (for example, those
which contain versioning information) will require changes to the
translation script. The now unused .exp files are removed, and a
dependency on the .map file added to the library build line.

This change adds support for export lists to Darwin for the first time.
Doing so identified a number of symbols in libafsrpc that are required
by libafsauthent, which were not being exported. Export these symbols,
and bump the minor revision of the shared library.

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

10 years agoLinux: Remove prototype warning inhibition
Simon Wilkinson [Sun, 25 Apr 2010 10:31:36 +0000]
Linux: Remove prototype warning inhibition

The Linux kernel builds used to add -Wno-strict-prototypes to the
CFLAGS. Now that we've got prototypes for pretty much everything,
remove this line so we can see any real warnings that might occur.

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

10 years agoFix make clean and make distclean
Simon Wilkinson [Sun, 25 Apr 2010 09:55:23 +0000]
Fix make clean and make distclean

Fix these make targets so they actually clean the tree. Reorder the list
of file deletions in distclean so that it exactly mirrors the creation
order in configure.in, which should hopefully make it easier to keep
this all in sync in future. Add all of the missing files in packaging,
and the shared library build tools, to this list.

Make kauth and vol clean remove ka-forwarder and fssync-debug,
respectively.

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

10 years agoReally kill des_stub
Simon Wilkinson [Sun, 25 Apr 2010 20:52:20 +0000]
Really kill des_stub

Some bits of des_stub were lingering on. Get rid of it completely.

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

10 years agoFix objdir builds
Simon Wilkinson [Sat, 24 Apr 2010 16:34:02 +0000]
Fix objdir builds

Change f2db78a346112f5320efc6f0b6b9fe4ae0d893d3 included hard
references to compilation sources with no srcdir prefix, and so
broke objdir builds. Fix this so that we can build outside the
source tree again.

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

10 years agomacos growl agent warning parser fix
Derrick Brashear [Fri, 23 Apr 2010 18:40:45 +0000]
macos growl agent warning parser fix

warnings start at offset 5, not 6 (warn is shorter than fetch or store)

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

10 years agoopenafs 1.5.74.1 openafs-devel-1_5_74_1
Derrick Brashear [Fri, 23 Apr 2010 15:56:08 +0000]
openafs 1.5.74.1

so it can be tagged and non-unversioned builds of the mac client changes can
be seeded for testing

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

10 years agomacos launchd be more patient
Derrick Brashear [Fri, 23 Apr 2010 15:02:32 +0000]
macos launchd be more patient

right now we would wait 20 seconds for shutdown (the default),
get impatient and be useless.

be less useless.

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

10 years agoUnix: Modify disk cache versioning
Simon Wilkinson [Thu, 22 Apr 2010 21:24:11 +0000]
Unix: Modify disk cache versioning

This change increments the disk cache version number, and adds a
structure size record to the disk cache header. All old disk caches
will be replaced when the client is started.

With the various changes made to unify our file handles, and to
support large file handles on Linux, the size of the 'fcache'
structure was modified earlier in the 1.5 series. However, fcache
is also the building block of the CacheItems file, so these changes
inadvertently broke users upgrading from 1.4. In addition, as the
disk cache inode is now a union of many different structures, the
structure size is now potentially volatile across both kernel, and
OpenAFS revisions.

Up the version number so old disk caches are invalidated and won't
crash users who are upgrading. Also take the opportunity to add an
item to the header which stores the size of struct fcache used
by the disk cache. If the size on disk doesn't match that expected
by the kernel module, truncate the cache and start again.

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

10 years agoWarning fix: cast to expected type
Marc Dionne [Thu, 22 Apr 2010 23:39:21 +0000]
Warning fix: cast to expected type

Cast argument to match the expected type from the format string.

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

10 years agoUpdate nextVnodeUnique before checking inUse
Andrew Deason [Thu, 22 Apr 2010 16:54:06 +0000]
Update nextVnodeUnique before checking inUse

When attaching a volume, update the nextVnodeUnique field for the
volume, before we do any checks on the volume; for example, checking
inUse, which may result in a demand-salvage if we are running DAFS.

If we do not do this, we can schedule a demand-salvage without setting
nextVnodeUnique, and VUpdateVolume_r will update the volume header
uniquifier to nextVnodeUnique+200, when nextVnodeUnique is not set.
So, we will always set the uniquifier to 200. Fortunately, the salvage
should usually fix the uniquifer anyway.

So, set nextVnodeUnique before doing any of those checks, to avoid
screwing up the uniquifier when taking the volume offline.

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

10 years agoPrefer EndCall errors in StoreMini
Andrew Deason [Thu, 22 Apr 2010 18:21:52 +0000]
Prefer EndCall errors in StoreMini

Partially revert b1eb6a7a3f80500f0187cc6a1dd2013e1a5e154a, so we do
not mask the rx_EndCall error with a EndRXAFS_StoreData error (for
example, if EndRXAFS_StoreData returns RXGEN_CC_UNMARSHAL, and
rx_EndCall returns VBUSY). We need to agree on how to do this
throughout the tree, but for now, just fix StoreMini.

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

10 years agoLinux: Tidy up packaging
Simon Wilkinson [Thu, 22 Apr 2010 17:02:08 +0000]
Linux: Tidy up packaging

Remove the fuzz setting - we're no longer patching the build, so
we don't need it.

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

10 years agoLinux: RedHat packaging updates for RHEL6
Simon Wilkinson [Thu, 22 Apr 2010 16:56:25 +0000]
Linux: RedHat packaging updates for RHEL6

Update our bundled spec file and related tools so they can be used
to build OpenAFS on the RHEL6 beta.

- Make kmodtool recognise el6 as having "modern" kernel naming
  conventions
- Replace %{PACKAGE_VERSION} (which seems to have disappeared)
  with the standard %{version} macro

Thanks to billings and phalenor on IRC for their testing efforts.

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

10 years agoResolve symlinks for 'fs rmmount'
Andrew Deason [Thu, 22 Apr 2010 14:59:30 +0000]
Resolve symlinks for 'fs rmmount'

'fs rmmount' is the only 'fs' command that does not resolve symlinks
for its pioctls for some reason. Make it resolve symlinks.

Thanks to Arne Wiebalck.

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

10 years agobyte-range lock warning should include pid
Derrick Brashear [Wed, 17 Feb 2010 05:48:03 +0000]
byte-range lock warning should include pid

is is the same pid cmdebug would print. just include it in the logged
byte-range lock warning.

FIXES 126438

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

10 years agoAdding osi_procname macro to different platforms
sanket [Sat, 17 Apr 2010 14:14:25 +0000]
Adding osi_procname macro to different platforms

osi_procname(procname, size) is added to different platforms to obtain
the processname in the string procname( preallocated ) with size size

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

10 years agomacos bulkstat again
Derrick Brashear [Wed, 21 Apr 2010 22:45:33 +0000]
macos bulkstat again

revamp this to avoid various issues with vnode references,
and to avoid potentially finding CVInit vcaches but not reclaiming

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

10 years agoFix UCONTEXT detection on ppc_linux26 via include order
Russ Allbery [Tue, 20 Apr 2010 05:01:27 +0000]
Fix UCONTEXT detection on ppc_linux26 via include order

param.linux26.h defines USE_UCONTEXT for all Linux platforms for
glibc 2.4 and higher, but it does this by testing __GLIBC__ and
__GLIBC_MINOR__.  These are defined by features.h, which is included
by any system header.  At least one system header must be included
before those are defined.  lwp/process.c was including <afsconfig.h>
and <afs/param.h> before any other headers, leading to those macros
being undefined.  Most of the Linux architectures either have their
own implementation or were explicitly defining USE_UCONTEXT in the
per-architecture param file, but ppc_linux26 was relying on the
default.

Fix this by reordering the includes to include the various system
headers before <afs/param.h> and add a comment explaining why.

This previously worked in earlier versions because the old
param.ppc_linux26.h file included <afs/afs_sysnames.h>, which
included "stds.h", which included a system header prior to the check
for ucontext.  The new generic param file reverses that order.

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

10 years agoRecover from afs_GetVolSlot errors
Andrew Deason [Wed, 21 Apr 2010 17:41:21 +0000]
Recover from afs_GetVolSlot errors

afs_GetVolSlot can panic in a few different ways, such as failing to
read from or write to VolumeInfo. Instead of panic'ing, return an
error to the application. Adjust callers to deal with getting a NULL
volume returned.

Based on a patch by Mike Meffie.

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

10 years agoAdd RFC 5864 to the protocol documentation directory
Russ Allbery [Wed, 21 Apr 2010 03:46:32 +0000]
Add RFC 5864 to the protocol documentation directory

Add a copy of RFC 5864 (DNS SRV Resource Records for AFS) to the
protocol documentation directory for reference.  As permitted by
the IETF Trust License Policy section 3(e), I release this document
under the MIT/X Consortium license included in this copy of the
document.

LICENSE MIT

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

10 years agoInstall afsd.fuse and man page if built
Russ Allbery [Tue, 20 Apr 2010 04:18:57 +0000]
Install afsd.fuse and man page if built

If --enable-fuse-client is passed to configure and afsd.fuse is built,
install it into the same directory as afsd and install afsd.fuse.8 as a
symlink to the afsd.8 man page.  Add documentation of afsd.fuse to the
afsd man page.

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

10 years agoAdd src/afsd/afsd.fuse and src/libuafs/afsd to .gitignore
Anders Kaseorg [Wed, 21 Apr 2010 08:09:03 +0000]
Add src/afsd/afsd.fuse and src/libuafs/afsd to .gitignore

Change-Id: I4b7e5261d92944ed871a1113b0f4a651357f9fcf
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/1800
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

10 years agoAdd documentation for fs callback xstats
Andrew Deason [Sun, 18 Apr 2010 23:49:18 +0000]
Add documentation for fs callback xstats

Change I572ff682de4cc7ef27bb46dd028d3d797b873841 added the fileserver
callback xstats collection to afsmonitor. Provide some documentation
for these fields, along with the other fields displayed by afsmonitor.

Change-Id: I21618047519fbb28f6707ff9ba95a17fe27e0f3c
Reviewed-on: http://gerrit.openafs.org/1783
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

10 years agokauth admin tools ubik prototyping
Derrick Brashear [Tue, 20 Apr 2010 23:59:53 +0000]
kauth admin tools ubik prototyping

kill off ubik_Call (but not CallIter, yet)

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

10 years agoUpdated dkms.conf to remove MPS=$SMP from make
Jonathan Billings [Tue, 20 Apr 2010 19:53:21 +0000]
Updated dkms.conf to remove MPS=$SMP from make

* Removed the logic to set $SMP based on CONFIG_SMP from
  /boot/config-$kernelver
* When using --with-linux-kernel-packaging in the configure line, dkms
  no longer needs MPS=$SMP in the make line.

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

10 years agoAdded explanatory comments for restorevol move
Jonathan Billings [Tue, 20 Apr 2010 16:13:11 +0000]
Added explanatory comments for restorevol move

Since restorevol is placed in %{_prefix}/afs/bin by make dest, we
need to fix it so it ends up in %{_bindir} to be used in the base
package.

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

10 years agoFixed more locations to reflect recent changes
Jonathan Billings [Tue, 20 Apr 2010 16:00:21 +0000]
Fixed more locations to reflect recent changes

Moved restorevol man page to base package
Moved state_analyzer man page to server package

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

10 years agoFixed RedHat SPEC file to reflect updates in code
Jonathan Billings [Tue, 20 Apr 2010 15:50:59 +0000]
Fixed RedHat SPEC file to reflect updates in code

Moved the restorevol binary from /usr/afs/bin to /usr/bin
Added the new state_analyzer.8.gz man page

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

10 years agoRemove special-case call sequence for KAM_SetPassword on s390
Russ Allbery [Tue, 20 Apr 2010 04:36:09 +0000]
Remove special-case call sequence for KAM_SetPassword on s390

For Linux s390 (but not s390x), an additional argument was passed
to KAM_SetPassword between the kvno and the encryption key.  This
doesn't seem to match the rest of the code and is now, with stricter
prototyping, preventing the code from compiling.  Remove it and use
the same call sequence on s390 as everywhere else.

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

10 years agoUse AC_PREREQ
Andrew Deason [Mon, 19 Apr 2010 19:48:14 +0000]
Use AC_PREREQ

We use AC_USE_SYSTEM_EXTENSIONS, which was introduced in autoconf
2.60. To allow for less confusion and perhaps a more clear error
message, specify that we require using at least that version.

Change-Id: I42a3f4e889ad443d8d8cd3ba0c085c67606b8be3
Reviewed-on: http://gerrit.openafs.org/1784
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

10 years agoFixes and clarifications to vos setaddrs man page
Russ Allbery [Mon, 19 Apr 2010 21:00:31 +0000]
Fixes and clarifications to vos setaddrs man page

Add a caution explaining how the file server addresses are registered
and pointing users at NetInfo and NetRestrict plus restarting the file
server for the normal case.

Mention what version of OpenAFS introduced this command.  Drop the note
about the version of OpenAFS that added the -encrypt flag, since the
whole command is newer than that.

Reference vos listaddrs -printuuid specifically to get the UUID.

General formatting and wording cleanup: use terminology more consistently,
continue a long example line, wrap long lines, fix a spelling error, and
add cross-references to NetInfo and NetRestrict.

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

10 years agoUpdate Debian packaging for 1.5.74
Russ Allbery [Mon, 19 Apr 2010 21:55:16 +0000]
Update Debian packaging for 1.5.74

Include the Debian changelog entry for 1.5.74-1 and install the new
vos setaddrs man page.

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

10 years agomacos disable bulkstat openafs-devel-1_5_74
Derrick Brashear [Mon, 19 Apr 2010 18:02:14 +0000]
macos disable bulkstat

there's still a bug

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

10 years agomacos bulkstat don't double reget refs
Derrick Brashear [Sun, 18 Apr 2010 17:45:51 +0000]
macos bulkstat don't double reget refs

if another code path already got back the refs from finalizevnode,
don't do it again

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

10 years agobulkstat restore bulkfetching state for reused vcaches
Derrick Brashear [Sun, 18 Apr 2010 17:35:09 +0000]
bulkstat restore bulkfetching state for reused vcaches

when i introduced NewBulkVCache I elided this case. Set it here.

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

10 years agoWindows: Preserve volume location info in case of comm fail
Jeffrey Altman [Sun, 18 Apr 2010 17:34:18 +0000]
Windows: Preserve volume location info in case of comm fail

The cache manager refreshes volume location information every
two hours. If during a refresh the communication with the
vldb server fails, the previously known volume location information
should continue to be used.

The previous behavior in which the volume location information
is discarded first and then the update is performed can result
in unnecessary client failures when a temporary disruption in
communication with the vldb server occurs.  Instead, wait until
we have a successful response from the vldb server before the
previous server list is discarded.

LICENSE MIT

Change-Id: I7c63c4f673a7a1360a74611c356329f31f9ceec3
Reviewed-on: http://gerrit.openafs.org/1769
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

10 years agoWindows: correct locking in cm_FreeServerList
Jeffrey Altman [Sun, 18 Apr 2010 17:20:52 +0000]
Windows: correct locking in cm_FreeServerList

The cm_serverLock must be held when checking the state
of the list head.

LICENSE MIT

Change-Id: I1134a6617d4c1e38b95512b1fdc41c5f5857ea7a
Reviewed-on: http://gerrit.openafs.org/1774
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

10 years agoWindows: prevent infinite idle error response
Jeffrey Altman [Sun, 18 Apr 2010 11:38:27 +0000]
Windows: prevent infinite idle error response

The idle error value (if any) is stored in the cm_req_t object.
Since the value is never cleared, the same value can be returned
for all requests that make use of the same cm_req_t object.

Change the behavior to only return an idle error once and then
clear it.

LICENSE MIT

Change-Id: Iac9ff8e56e856c2f0e440a34ac39ccd68de37c77
Reviewed-on: http://gerrit.openafs.org/1773
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

10 years agoWindows: Increase the memory map version
Jeffrey Altman [Sat, 17 Apr 2010 19:21:32 +0000]
Windows: Increase the memory map version

Since the cm_buf_t data structure changed, update
the memory map version number so that the cache will
not be reused.

LICENSE MIT

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

10 years agoopenafs 1.5.74
Derrick Brashear [Sat, 17 Apr 2010 14:14:50 +0000]
openafs 1.5.74

make 1.5.74 versions

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

10 years agoWindows: 1.5.74 change log
Jeffrey Altman [Sat, 17 Apr 2010 15:13:21 +0000]
Windows: 1.5.74 change log

Important changes affecting the Windows distribution for 1.5.74

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

10 years agoRx: make conn_call_lock and conn_data_lock usage consistent
Jeffrey Altman [Sat, 17 Apr 2010 02:42:34 +0000]
Rx: make conn_call_lock and conn_data_lock usage consistent

The rx_connection.flags field is protected by the conn_data_lock
but the conn_data_lock is not held everywhere the conn flags
field is altered.  This produces a race that can result in a
deadlock when waiter flags are inadvertently prevented from being
cleared.

The conn_call_lock usage in rx_EndCall which was removed in
Change e169708681eb1bbbb31951b95f68e861a4b01c7e must be restored.
If rx_EndCall never obtains the conn_call_lock it can't ensure
that the thread in rx_NewCall actively checking the calls will
not end up blocking when there is now a call channel that can
be reused.  This usage of conn_call_lock can be removed only
if a true producer/consumer model is implemented.

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