openafs.git
11 years agoWindows: FILE_FS_DEVICE_INFORMATION Device Type
Jeffrey Altman [Fri, 25 Jan 2013 05:11:41 +0000]
Windows: FILE_FS_DEVICE_INFORMATION Device Type

Consistently report our device type as FILE_DEVICE_NETWORK_FILE_SYSTEM
instead of FILE_DEVICE_DISK or FILE_DEVICE_DISK_FILE_SYSTEM except
when returning FILE_FS_DEVICE_INFORMATION where we must lie and state
that the device type is FILE_DEVICE_DISK.  Otherwise, the Win32 API
GetFileType() returns FILE_TYPE_UNKNOWN instead of FILE_TYPE_DISK.

Applications built from msys (but not current cygwin) treat files
of type FILE_TYPE_UNKNOWN as special character devices instead of
files.  This breaks msysGit.

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

11 years agoWindows: RDR_CleanupFile FSync only files
Jeffrey Altman [Tue, 22 Jan 2013 17:46:20 +0000]
Windows: RDR_CleanupFile FSync only files

If the cm_scache type is something other than a file, there
is no point performing an FSync.   Do not incur the overhead.

Take into account any outstanding AsyncStore operations that
might be in-flight.

Change-Id: I66cd59cbcd81f2a7639e478832f921ac393ea3ae
Reviewed-on: http://gerrit.openafs.org/8972
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSCleanupFile always flush on last handle
Jeffrey Altman [Tue, 22 Jan 2013 17:44:21 +0000]
Windows: AFSCleanupFile always flush on last handle

Do not rely on a count of dirty extents to determine if the
service should flush a file during a cleanup operation.  Simply
because there are no dirty extents held by the redirector does
not imply that the service has no dirty buffers for the file.

Change-Id: Ifc7c139a587413626eae145f343c4295dd94f28a
Reviewed-on: http://gerrit.openafs.org/8971
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: clear ASYNCSTORING flag in scache recycle
Jeffrey Altman [Sun, 20 Jan 2013 18:27:51 +0000]
Windows: clear ASYNCSTORING flag in scache recycle

If the scache has been recycled the ASYNCSTORING flag cannot
be accurrate.  Clear it.

Change-Id: Ie5a5a19bf1818e36f6274ba24ddeaf5f4b835ff4
Reviewed-on: http://gerrit.openafs.org/8970
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: restructure daemon state tracking
Jeffrey Altman [Sun, 20 Jan 2013 18:26:24 +0000]
Windows: restructure daemon state tracking

Move all of the per thread state info into a struct and
allocate an array of structs instead of an array for each
data type.

Change-Id: I25b878192a8f919b21d96e981d7369a429b9171d
Reviewed-on: http://gerrit.openafs.org/8969
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: osisleep cleanup
Jeffrey Altman [Sun, 20 Jan 2013 18:23:50 +0000]
Windows: osisleep cleanup

Change-Id: Id76989dfab53a166a4174569973fb0a5f5e5e972
Reviewed-on: http://gerrit.openafs.org/8968
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: remove out of date cm_buf #define
Jeffrey Altman [Fri, 18 Jan 2013 02:02:36 +0000]
Windows: remove out of date cm_buf #define

Change-Id: Id60f509d7c8a1e9eb2f94d4c481d00e9b820b827
Reviewed-on: http://gerrit.openafs.org/8967
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Convert BkgDaemon Procedures to use rock
Jeffrey Altman [Thu, 17 Jan 2013 06:44:27 +0000]
Windows: Convert BkgDaemon Procedures to use rock

The BkgDaemon functions accepted four 32-bit parameters into
which 64-bit offsets and lengths were fit.  Convert the routines
to use a procedure specific rock type which is allocated by the
caller to cm_QueueBkgRequest and freed by cm_BkgDaemon.

The use of a rock will permit greater flexibility for future
background procedures to be implemented that require more complex
data to be passed around.

Change-Id: I4fc06e1d4a3a3ee25c699c95a90a9c9993199ddd
Reviewed-on: http://gerrit.openafs.org/8966
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Set dirty page limit to 2 x ChunkSize / 4096
Jeffrey Altman [Thu, 17 Jan 2013 06:42:54 +0000]
Windows: Set dirty page limit to 2 x ChunkSize / 4096

4096 is the size of a memory manager page.  ChunkSize is in octets.
Windows doesn't wait until the limit is reached to begin flushing
and ChunkSize is not a hard limit.

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

11 years agoWindows: Add CM_MERGEFLAG_CACHE_BYPASS
Jeffrey Altman [Fri, 25 Jan 2013 00:42:41 +0000]
Windows: Add CM_MERGEFLAG_CACHE_BYPASS

If a store operation is performed direct to the file server
bypassing the AFSCache, call cm_MergeStatus() with
CM_MERGEFLAG_CACHE_BYPASS to ensure that the valid version
numbers for the cm_scache_t object are incremented appropriately.
After a cache bypass occurs, only buffers with the current
data version number are valid since the cached data will be
incomplete.

Change-Id: I9438f8c9759407de69ab894df4f6fe91027a4b94
Reviewed-on: http://gerrit.openafs.org/8964
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSInitPIOCtlDirectoryCB fixes
Jeffrey Altman [Thu, 31 Jan 2013 02:45:44 +0000]
Windows: AFSInitPIOCtlDirectoryCB fixes

Rename ObjectInfo parameter to ParentObjectInfo since
it does represent the parent of the PIOCtlDirectoryCB
that is being allocated.

If the AFS_DIR_ENTRY_TAG allocation fails, do not call
AFSDeleteObjectInfo( pObjectInfoCB) prior to the try_return
because AFSDeleteObjectInfo() will be executed in the try_exit
block.

Finally, do not increment the pDirNode->ObjectInformationCB
reference count when returning STATUS_REPARSE.  The reference
count is tracked by the pDirNode pointer and has already been
allocated.

Change-Id: Iac3d2b1b58d3bf12eb08c92b96beca43e794aef5
Reviewed-on: http://gerrit.openafs.org/8963
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Additional trace %p and %d changes
Jeffrey Altman [Fri, 25 Jan 2013 00:28:44 +0000]
Windows: Additional trace %p and %d changes

Use %p when logging pointers.

Use %d for counts.

Change-Id: Ib3a3b1226945eccb15d912d7ff1c83f0257e7acd
Reviewed-on: http://gerrit.openafs.org/8962
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSProcessCreate drop DirOpenRefCount on exit
Jeffrey Altman [Fri, 25 Jan 2013 00:25:37 +0000]
Windows: AFSProcessCreate drop DirOpenRefCount on exit

AFSProcessCreate() must not maintain its DirOpenReferenceCount
when bFileCreated is true because the AFSCcb maintains its own
count and the one obtained by AFSProcessCreate() will only be
leaked.

Change-Id: I6591eb1c10d3dffe7449894b29c9999f5db91d64
Reviewed-on: http://gerrit.openafs.org/8961
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Trace DirectoryCB allocations
Jeffrey Altman [Fri, 25 Jan 2013 00:14:42 +0000]
Windows: Trace DirectoryCB allocations

Add a trace subsystem for tracking Directory Entry allocations
and deallocations to assist with debugging.

Change-Id: Ic5f0361bf10752f50d433d3e9f4792b32bec8de1
Reviewed-on: http://gerrit.openafs.org/8960
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Introduce NameArray Reference Counts
Jeffrey Altman [Thu, 24 Jan 2013 23:55:24 +0000]
Windows: Introduce NameArray Reference Counts

Split the DirOpenReferenceCounts into those related to DirectoryCB
reference counting unrelated to the NameArrays and those that are
related to the NameArrays.  This helps track down the source of
overcounts and undercounts.

Change-Id: Ie3c6f15394fe116761e32ed4d7756a4bf6a5549f
Reviewed-on: http://gerrit.openafs.org/8959
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSSetRenameInfo Notify correct object of change
Jeffrey Altman [Thu, 24 Jan 2013 23:52:51 +0000]
Windows: AFSSetRenameInfo Notify correct object of change

When AFSSetRenameInfo makes a change, it is the parent object
that must be notified not the parent of the parent.

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

11 years agoWindows: Allocated VolumeCB from PagedPool
Jeffrey Altman [Thu, 24 Jan 2013 23:51:01 +0000]
Windows: Allocated VolumeCB from PagedPool

Only the non-paged portion of the VolumeCB should be allocated
from the non-paged pool.  Allocate the VolumeCB itself from the
paged pool.

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

11 years agoWindows: Move VolumeWorkerContext to NonPaged pool
Jeffrey Altman [Sun, 27 Jan 2013 04:19:05 +0000]
Windows: Move VolumeWorkerContext to NonPaged pool

The VolumeWorkerContext contains a KEVENT which must be allocated
from the NonPaged pool.  Move it to the AFSNonPagedVolumeCB struct.

Change-Id: If24ea5f22e6cc7e71328d0d2d8e0c8b9209ce5b2
Reviewed-on: http://gerrit.openafs.org/8992
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Categorize ObjectInformationCB RefCnts
Jeffrey Altman [Thu, 24 Jan 2013 23:44:33 +0000]
Windows: Categorize ObjectInformationCB RefCnts

To assist in tracking down the source of ObjectInformationCB
overcounts and undercounts, add an advisory array which tracks
the reference counts by category.  In the procress ensure that
all reference count changes are logged by tracing.

Change-Id: I813cd0af5e12e36ba9863577dbd35abef6339414
Reviewed-on: http://gerrit.openafs.org/8956
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFS_SUBSYSTEM_OBJECT_REF_COUNTING fixes
Jeffrey Altman [Thu, 24 Jan 2013 23:24:55 +0000]
Windows: AFS_SUBSYSTEM_OBJECT_REF_COUNTING fixes

A large number of trace messages monitoring ObjectInformationCB
reference counting were categorized under AFS_SUBSYSTEM_FCB_REF_COUNTING
instead of AFS_SUBSYSTEM_OBJECT_REF_COUNTING.  This patchset applies
the correct subsystem category.

Change-Id: I6c309b42b3d679f961d82c1a975d84122c9275f9
Reviewed-on: http://gerrit.openafs.org/8955
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Reduce RDR Object Lifetime
Jeffrey Altman [Thu, 24 Jan 2013 21:29:52 +0000]
Windows: Reduce RDR Object Lifetime

Adjust the redirector object lifetime from 10 minutes (600 seconds)
to 20 seconds.  The object lifetime is how long an object can remain
idle before garbage collection is permitted.

Change-Id: I8db89bfb0ccd40e9295dcbb30fbc2c96813d9fc9
Reviewed-on: http://gerrit.openafs.org/8954
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agowindows: Update raw fetch/store operations
Jeffrey Altman [Sun, 13 Jan 2013 15:15:02 +0000]
windows: Update raw fetch/store operations

rawops.c is a hold over from Eric Williams' original attempt
to implement an AFS redirector.  When the rest of the his code
was purged from the tree and replaced with a more complete
implementation based upon the Kernel Drivers's File System
framework rawops.c was left behind.

Although the source file has been compiled as part of the build,
its functions ReadData and WriteData have never been called.  This
patchset:

 1. renames the functions to raw_ReadData and raw_WriteData

 2. modifies the function signatures and provides a header
    with prototypes

 3. requires that cm_scache.rw be write-locked upon entry

 4. renames variables

 5. removes the #define CM_BUF_BUFSIZE and relies upon
    cm_data.blockSize instead

 6. Always write back the current range as an async store
    instead of the previous chunk as random write patterns
    will fail to store all of the dirty buffers.

Change-Id: I1594b2950ab14da0c0de2a382fd1ba8248a9d1c6
Reviewed-on: http://gerrit.openafs.org/8953
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agovlclient: add -probe option
Michael Meffie [Wed, 16 Jan 2013 17:10:02 +0000]
vlclient: add -probe option

Add a new option to the vlclient test program to call the
probe server RPC to ping the vlservers in a cell. Uses a multi
rx call to do the probes in parallel.

The existing -host option can be used to ping a single
vlserver.

Change-Id: I25666b7ff139ae43364ac04869b14997f3ed0d53
Reviewed-on: http://gerrit.openafs.org/8911
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agotests: Don't use libafsauthent
Simon Wilkinson [Sat, 2 Feb 2013 07:22:50 +0000]
tests: Don't use libafsauthent

Use liboafs_auth.la directly, rather than using libafsauthent, to
build the auth tests

Change-Id: Idf0e7a32626802b6113d21833ded09d9e20e3659
Reviewed-on: http://gerrit.openafs.org/9023
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoauth: Permit NULL fallback in localauth case
Simon Wilkinson [Sat, 2 Feb 2013 07:20:14 +0000]
auth: Permit NULL fallback in localauth case

Allow the caller of afsconf_PickClientSecObj to specify both
local authentication, and to request fallback to null authentication
if local auth isn't available.

Change-Id: Ib3b801bfde3f32b4cb9cdc7c08a3d8ab985c080f
Reviewed-on: http://gerrit.openafs.org/9022
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Fix AIX test_and_set_bit
Simon Wilkinson [Sat, 2 Feb 2013 07:17:53 +0000]
rx: Fix AIX test_and_set_bit

The AIX definition of rx_atomic_test_and_set_bit had its test the
wrong way round - so an already set bit would return false, and a clear
bit would return true. Fix this.

Change-Id: I7778c411016bca53b38257fca59ae0f7aaad64ae
Reviewed-on: http://gerrit.openafs.org/9021
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agofix some typos in bos_setrestricted
Thorsten Alteholz [Wed, 30 Jan 2013 19:11:04 +0000]
fix some typos in bos_setrestricted

the real name of the command is: 'bos setrestricted'
it is sufficient to name 'bos install' only once

Change-Id: Ic68f7cb55466e1c92c34eeda37c0a64a11b7e4d8
Reviewed-on: http://gerrit.openafs.org/8990
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: convert rxinit_status to atomic
Derrick Brashear [Mon, 21 Jan 2013 21:13:56 +0000]
rx: convert rxinit_status to atomic

we don't need to use a lock just for this; switch to atomic and use that
to trigger configuration.

Change-Id: Ia96ec308dda51d1f6d13f290a23251c66665e499
Reviewed-on: http://gerrit.openafs.org/8930
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agodarwin: stop processing upcalls once rx shutdown starts
Derrick Brashear [Mon, 21 Jan 2013 21:10:17 +0000]
darwin: stop processing upcalls once rx shutdown starts

we have a chicken and egg. can't stop upcall without
killing socket; can't kill socket while rx might try to transmit on it.
cheat, and if rx is shut down, don't process things upcall receives.

FIXES 131577

Change-Id: I6b72f6e7aefb7937b768dcb9c0a83d0ee3317bfa
Reviewed-on: http://gerrit.openafs.org/8931
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Disable hard dead timeout for RDR File Server connections
Jeffrey Altman [Wed, 19 Dec 2012 21:52:34 +0000]
Windows: Disable hard dead timeout for RDR File Server connections

The UNIX cache manager does not implement hard dead timeouts
on file server connections.  The Windows cache manager had to
because of the SMB connection timeout requirements.  For the
AFS redirector there is no timeout requirement.  Therefore,
when the SMB stack is disabled the Windows cache manager can
disable the hard dead timeout.

The idle dead timeouts are in place to cancel connections when
file servers stop replying with real data.

Change-Id: I44f77b78a52e7cac3a88a53830748b77f3ff4000
Reviewed-on: http://gerrit.openafs.org/8828
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agolibafsrpc: avoid more concurrent libtool
Derrick Brashear [Fri, 1 Feb 2013 13:42:49 +0000]
libafsrpc: avoid more concurrent libtool

libtool gets confused if it is running two instances in the same
directory, so make sure we build libafsrpc.a after the other things
we already single-stream.

Change-Id: I4c26b5707fdb73319563b063b45eb40b7ca1457e
Reviewed-on: http://gerrit.openafs.org/9017
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorx: atomic bit ops
Simon Wilkinson [Mon, 21 Jan 2013 21:50:25 +0000]
rx: atomic bit ops

Add rx_atomic_test_bit, rx_atomic_set_bit, and rx_atomic_clear_bit
to provide bitwise operations over atomic types. These allow the
use of atomic flag variables.

Uses native platform atomic operations wherever these are available,
otherwise falls back to our 'standard' MUTEX based implementation.

LICENSE BSD

Change-Id: I161631b2408e85f757ff04bf831a631ccb1f930d
Reviewed-on: http://gerrit.openafs.org/8936
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: rename 'rbytes' to 'rxbytes' for clarity
Jeffrey Altman [Fri, 25 Jan 2013 08:25:46 +0000]
Windows: rename 'rbytes' to 'rxbytes' for clarity

Throughout cm_dcache.c, the various 'rbytes' represents the number
of bytes to be read from the next rx_Read or rx_Readv call.
Rename the variable to 'rxbytes' to improve clarity.

Change-Id: Iffd8dd397c0e6ab4cc44019b7f937a80f5d492d2
Reviewed-on: http://gerrit.openafs.org/8952
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Update Bulk I/O Descriptor
Jeffrey Altman [Thu, 3 Jan 2013 19:11:31 +0000]
Windows: Update Bulk I/O Descriptor

Update the cm_bulkIO_t and associated functions such that
the 'reserved' field is no longer a boolean indicated whether
or not buffers have been reserved but instead becomes a count
of the number of buffers that have been reserved.

buf_TryReserveBuffers is modified to return an afs_uint64
count of the number of buffers reserved instead of a boolean.

cm_SetupStoreBIOD, cm_SetupFetchBIOD, and cm_ReleaseBIOD altered
to store the reserved buffer count and use it when freeing the
BIOD.

Prior to this change it was not possible to reserve a count other
than the number of buffers it takes to store one chunkSize of data.

Change-Id: I78d71c77ffddd7f34278314fcfe9ee568b835a8b
Reviewed-on: http://gerrit.openafs.org/8951
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: reformat
Jeffrey Altman [Sun, 16 Dec 2012 07:02:06 +0000]
Windows: reformat

Change-Id: Ifba4f0d54032bd9580c97e7a94d2550e49b1a1ac
Reviewed-on: http://gerrit.openafs.org/8950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: handle CM_ERROR_RETRY in cm_Analyze()
Jeffrey Altman [Tue, 6 Nov 2012 11:41:47 +0000]
Windows: handle CM_ERROR_RETRY in cm_Analyze()

cm_Analyze() was not forcing a retry when it received CM_ERROR_RETRY.

Change-Id: I5c392623a3917bebdd5cb9bd86b030395d7a7d48
Reviewed-on: http://gerrit.openafs.org/8949
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Decrement Fcb OpenHandleCount while locked
Jeffrey Altman [Sat, 29 Dec 2012 20:58:06 +0000]
Windows: Decrement Fcb OpenHandleCount while locked

AFSCleanup performs tests on the Fcb Open Handle Count to determine
when to perform final cleanup tasks on the last handle close.  The
test is protected by holding the Fcb Resource.  If the Open Handle
Count is decremented after dropping the Resource, it creates a
race with other threads that might be blocked entering AFSCleanup
to close their handle on the same object.

Change-Id: I0403d8aeafd736484728a25c5c48ab28e8b8a804
Reviewed-on: http://gerrit.openafs.org/8863
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSOpenRoot obtain VolumeRoot OpenReferenceCount earlier
Jeffrey Altman [Sat, 29 Dec 2012 21:12:21 +0000]
Windows: AFSOpenRoot obtain VolumeRoot OpenReferenceCount earlier

In AFSOpenRoot obtain the VolumeRoot reference count before performing
any operations that require use of the VolumeRoot.  If the operations
fail, release the reference count.

Change-Id: I2e5a6574f87db858aa60d812c68f637266db529e
Reviewed-on: http://gerrit.openafs.org/8862
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: RDR FILE Processing Tracing
Jeffrey Altman [Sat, 29 Dec 2012 21:10:14 +0000]
Windows: RDR FILE Processing Tracing

Additional/improved trace messaging for name not found and
path not found errors.

Change-Id: Ieedbee072c0f2c7050a33734fe16b4dfc0504cea
Reviewed-on: http://gerrit.openafs.org/8861
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: DirOpenReferenceCount reorganizing completed
Jeffrey Altman [Sat, 29 Dec 2012 05:57:31 +0000]
Windows: DirOpenReferenceCount reorganizing completed

This patchset completes the reorganizing of the DirOpenReferenceCount
handling.  Now that every AFSCcb is given a refCount in AFSInitCcb()
which is released in AFSRemoveCcb() it is possible to simplify some
of the logic surrounding DirOpenReferenceCount handling across
the AFSCommonCreate -> XXX -> AFSLocateNameEntry -> {MountPoint, Symlink}
call sequences.

Wherever possible releasing of DirOpenReferenceCounts occur in a
functions try_exit block.  AFSCommonCreate() uses the new variables
bReleaseDir and bReleaseParentDir to track whether these refcounts
need to be released.  Additional comments document the decision
making.

There was at least one code path in AFSLocateNameEntry() where
the DirOpenReferenceCount could be dropped when it should not have
been. (pExistingDirNode == pDirNode).

Change-Id: I266a902ad4c44b4b8e49258c2da4acd2df1f4476
Reviewed-on: http://gerrit.openafs.org/8860
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: NameArray DIRENTRY_REF_COUNT logging
Jeffrey Altman [Sat, 29 Dec 2012 05:51:55 +0000]
Windows: NameArray DIRENTRY_REF_COUNT logging

Include the NameArray pointer in the AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING
log messages generated from the NameArray management routines.  This
permits correlation between the reference count changes and the
NameArray to which they were associated.

Change-Id: Ieb1b78dec35b91fe2b325ed9da760f56e98759c3
Reviewed-on: http://gerrit.openafs.org/8859
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSSetRenameInfo DIRENTRY_REF_COUNTING
Jeffrey Altman [Sat, 29 Dec 2012 05:49:43 +0000]
Windows: AFSSetRenameInfo DIRENTRY_REF_COUNTING

When logging the result of the DirOpenReferenceCount increment,
use lCount instead of referencing the DirOpenReferenceCount field
which could have been changed.

Change-Id: I2227472bf903c347e505e4e1d8b60d35e176c0df
Reviewed-on: http://gerrit.openafs.org/8858
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSSetFileLinkInfo() DirOpenReferenceCount handling
Jeffrey Altman [Sat, 29 Dec 2012 05:44:27 +0000]
Windows: AFSSetFileLinkInfo() DirOpenReferenceCount handling

AFSSetFileLinkInfo() would leak a DirOpenReferenceCount when
pNewTargetDirEntry is not NULL upon exit.  It also did not
properly handle a STATUS_REPARSE response from AFSNotifyHardLink().
The AFSInsertDirectoryNode() call should not be performed when
the result is STATUS_REPARSE since that means the entry already
exists.

Change-Id: Ibbf497cb4c3c412e4f95cdffc6025f03f0e2ed8b
Reviewed-on: http://gerrit.openafs.org/8857
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSNotifyHardLink() DirOpenReferenceCount handling
Jeffrey Altman [Sat, 29 Dec 2012 05:40:25 +0000]
Windows: AFSNotifyHardLink() DirOpenReferenceCount handling

This patchset consolidates the releasing of the DirOpenReferenceCount
within AFSNotifyHardLink() into the try_exit block.  This clarifies
the logic and avoids duplicate code blocks.

Change-Id: I7bf7e5af55646ea570c76e36a673900521a3582c
Reviewed-on: http://gerrit.openafs.org/8856
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSNotifyFileCreate() DirOpenReferenceCount handling
Jeffrey Altman [Sat, 29 Dec 2012 05:36:44 +0000]
Windows: AFSNotifyFileCreate() DirOpenReferenceCount handling

This patchset consolidates the releasing of the DirOpenReferenceCount
within AFSNotifyFileCreate() into the try_exit block.  This clarifies
the logic and avoids duplicate code blocks.

Change-Id: I82e964f579f9e8b6e095291ace0bbe2cdac5af60
Reviewed-on: http://gerrit.openafs.org/8855
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSClose() DirOpenReferenceCount handling
Jeffrey Altman [Sat, 29 Dec 2012 05:29:45 +0000]
Windows: AFSClose() DirOpenReferenceCount handling

Unless the caller of AFSRemoveCcb() steals the DirectoryCB object
from the AFSCcb before calling AFSRemoveCcb(), AFSRemoveCcb() will
release the reference count.

In all but one case where the DirectoryCB must be accessed after
the AFSCcb is destroyed AFSClose() can now let AFSRemoveCcb() do the
work.

Change-Id: I8d631d79b2465cd6f2e31444fd052270b078915c
Reviewed-on: http://gerrit.openafs.org/8854
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Fix AFSLocateNameEntry prototype
Jeffrey Altman [Sat, 29 Dec 2012 05:28:04 +0000]
Windows: Fix AFSLocateNameEntry prototype

The VolumeCB parameter is an IN/OUT parameter.

Change-Id: I3eb4231e0d095cc98cc5847905d61d924d12e6f3
Reviewed-on: http://gerrit.openafs.org/8853
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSInitCcb redefinition
Jeffrey Altman [Sat, 29 Dec 2012 05:17:59 +0000]
Windows: AFSInitCcb redefinition

The new AFSInitCcb() allocates its own DirOpenReferenceCount to
associate with the AFSCcb.DirectoryCB.

It also accepts the GrantedAccess mask and the FileAccess values
which are stored in the AFSCcb.

These changes simplify the callers and remove responsibility of
tracking whether or not the DirOpenReferenceCount was successfully
associated with the AFSCcb.

The allocated DirOpenReferenceCount is always released by
AFSRemoveCcb().

Change-Id: Ib475310d934830974c553e0eeff96b114a56541b
Reviewed-on: http://gerrit.openafs.org/8852
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSRemoveCcb cannot fail
Jeffrey Altman [Thu, 27 Dec 2012 19:41:29 +0000]
Windows: AFSRemoveCcb cannot fail

Since AFSRemoveCcb cannot fail, change the signature from returning
NTSTATUS to void.

Remove all error handling code.

Change-Id: Ifa893a714f97cefb9bd122ab84508e5d36987e88
Reviewed-on: http://gerrit.openafs.org/8851
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoRework set_header_word macros
Marc Dionne [Sat, 22 Dec 2012 12:54:54 +0000]
Rework set_header_word macros

Rework the set_header_word macros so that all compilers are
happy:
- the use of offsetof() is avoided, as it has an issue on IRIX
when the result is not constant
- the assignment within the macro is explicitely sequenced before
the function call to avoid a gcc sequence-point warning

Change-Id: I2355233e865b155f958379bfa2736fee19ef2680
Reviewed-on: http://gerrit.openafs.org/8816
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoNEWS updates for 1.6.2
Ken Dreyer [Wed, 12 Dec 2012 17:37:47 +0000]
NEWS updates for 1.6.2

Add an entry for 1.6.2 with "in progress" instead of a date to hold the
release notes for 1.6.2pre4 rather than creating separate entries for
each release candidate. Users who track the release candidates can refer
to the public announcements, and this will be cleaner when reading
history later on.

Change-Id: I625044e20836e072b62ffa738eca23f1d11813a5
Reviewed-on: http://gerrit.openafs.org/8750
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>

11 years agoCellServDB update 28 Jan 2013
Stephan Wiesand [Mon, 28 Jan 2013 14:53:36 +0000]
CellServDB update 28 Jan 2013

Change-Id: Icb622cc5480aeba108b9a11f55cfb44ab7f7c262
Reviewed-on: http://gerrit.openafs.org/8982
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agolibafs: fs flushall for unix cm
Michael Meffie [Thu, 7 Jun 2012 18:46:04 +0000]
libafs: fs flushall for unix cm

Implement the fs flushall command on the unix cache manager to flush
all volume data.  Uses a new common pioctl code point VIOC_FLUSHALL (14),
registered with the grand.central.org assigned numbers.

Change-Id: I214d8c762573b308d79fa7122a91d48ddd403eb9
Reviewed-on: http://gerrit.openafs.org/7540
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoWindows: Use %p for ptrs in redirector trace messages
Jeffrey Altman [Thu, 24 Jan 2013 03:50:26 +0000]
Windows: Use %p for ptrs in redirector trace messages

Pointers were being logged with %08lX which results in partial
pointer values being logged on 64-bit systems.

Change-Id: Ic11e5b607b3df41f145536dfcb02dfa22537ee77
Reviewed-on: http://gerrit.openafs.org/8943
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoSOLARIS: Use vn_renamepath as early as possible
Andrew Deason [Fri, 18 Jan 2013 20:27:16 +0000]
SOLARIS: Use vn_renamepath as early as possible

Commit 6c509601 uses the vn_renamepath when we are building on Solaris
11. However, some recent patch level of Solaris 10 (more recent than
stock 10u10) has the same problem fixed by that commit, where
vn_setpath takes an additional argument. So instead, just test for the
existence of vn_renamepath itself, so we also use it on Solaris 10
when we can.

Thanks to Rich Sudlow for reporting this.

Change-Id: Ic1c0437d2438c6e19b8fff8278ecda9b96bd020b
Reviewed-on: http://gerrit.openafs.org/8920
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoaklog: Fix allow_weak_crypto warning
Andrew Deason [Tue, 22 Jan 2013 21:41:38 +0000]
aklog: Fix allow_weak_crypto warning

It's _crypto, not _enctypes. The user will just be more confused than
before if we tell them to do the wrong thing.

Change-Id: Ib94b14efbd3c89d9f58fb8985326ee8691fd993b
Reviewed-on: http://gerrit.openafs.org/8938
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agorx: Remove warning inhibition on rx.c
Simon Wilkinson [Fri, 18 Jan 2013 22:54:03 +0000]
rx: Remove warning inhibition on rx.c

The CFLAGS_NOERROR rule for rx.c seems to have crept back in as
part of the libtool changes. The LWP build of rx.c has never had
warning inhibition on rx.c, and the inhibition in the pthread
builds was removed by 327762071be3806c5d08be0218982c7027754756

Change-Id: Icde3f0b6ee2f8ae0818a3dc722c6171284d6a9e6
Reviewed-on: http://gerrit.openafs.org/8921
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoFreeBSD 9.1: Warning fixes
Andrew Deason [Fri, 18 Jan 2013 23:05:12 +0000]
FreeBSD 9.1: Warning fixes

Fix warnings caused by some changes in FreeBSD 9.1:

 - afs_cmount takes a uint64_t for flags instead of an int
 - vn_rdwr takes a ssize_t* for resid instead of an int*

[kaduk@mit.edu: rebase onto master and use fine-grained version checks]

Change-Id: I03ab805a625790004a910df96b96aeda1121e2a7
Reviewed-on: http://gerrit.openafs.org/8922
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Police Library IOCTLs
Rod Widdowson [Sun, 30 Dec 2012 11:13:24 +0000]
Windows: Police Library IOCTLs

Ensure that the callers of the various library ioctls have
the correct identity or privs.  All this policing is done in
the fs (non unloadable) layer, and to ensure that the library
layer cannot receive these calls directly we forbid non
create Opens of the library control device.

Change-Id: I2342fe10047642082adfbd1cc6aaee09cc91b520
Reviewed-on: http://gerrit.openafs.org/8893
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Police the DEBUG TRACE ioctls
Rod Widdowson [Fri, 28 Dec 2012 15:00:15 +0000]
Windows: Police the DEBUG TRACE ioctls

When we get a IOCTL_AFS_GET_TRACE_BUFFER, a IOCTL_AFS_CONFIGURE_DEBUG_TRACE
or a IOCTL_AFS_FORCE_CRASH, we check to see whether the caller is in the
Administrators group and if it isn't we fail the request with ACCESS_DENIED.

NOTE that this does not check whether the user has done the "run as admin"
thing.  We actually need to determine which priviledges are appropriate to
this action and use that rather than group membership to police these actions
and this will be added in a later patch.  Meanwhile this represents a
significant increment in security from previously.

Change-Id: I0997e59a82735735674d8edee7a7a68d241e6ef8
Reviewed-on: http://gerrit.openafs.org/8843
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agomacos: update decode-panic
Derrick Brashear [Mon, 21 Jan 2013 16:57:54 +0000]
macos: update decode-panic

fix a couple brain-os from the last round of updates, so it can
actually decode panics.

Change-Id: If39f1fb273a834d0618264d944387bd8b6751284
Reviewed-on: http://gerrit.openafs.org/8929
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoImprove libroken configure check
Andrew Deason [Thu, 17 Jan 2013 21:37:06 +0000]
Improve libroken configure check

It is not sufficient to just check if libroken is available; we need
to check if the specific functionality we want is there. So, try to
compile and link while referencing specific functions.

As mentioned in the comments, testing every single function we use may
not be practical, and we should perhaps just add functions to test as
we find breakage. This commit tests rk_rename, which is missing in at
least the Debian package heimdal-dev, version
1.4.0~git20100726.dfsg.1-2+squeeze1.

Change-Id: I0ac6c9aea1f8598bb1b1315544683b2403de5f69
Reviewed-on: http://gerrit.openafs.org/8916
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoxstat: length check cm call info
Michael Meffie [Mon, 10 Dec 2012 23:00:25 +0000]
xstat: length check cm call info

Define the cm xstat function call counters with an xmacro to avoid
duplicating the list of cm function names.  This obviates the need
to update xstat_cm_test.c when new function names are added to the
cm xstat collection id 0.

Check the number of returned records when printing the function call
counts to avoid over-running when a newer xstat_cm_test client
receives data from an older cm.

Change-Id: I3c5470afb7b04167173b41bb576a4a6ec14753f7
Reviewed-on: http://gerrit.openafs.org/8741
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoxstat: remove unused call info function
Michael Meffie [Mon, 10 Dec 2012 23:02:20 +0000]
xstat: remove unused call info function

Remove the dead function PrintCallInfo(), which was replaced
by print_cmCallStats() long, long ago.

Change-Id: Id67323d66cc498f77e55f173218547ad5d4223c7
Reviewed-on: http://gerrit.openafs.org/8740
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoOpenBSD: Add support for missing routine memmove() in kernel.
Antoine Verheijen [Mon, 21 Jan 2013 08:48:01 +0000]
OpenBSD: Add support for missing routine memmove() in kernel.

OpenBSD does not have the memmove() routine available to dynamically
loaded modules in its kernel. It exists but is not exported so it
winds up "mia" on dynamic load of the kernel module. It's needed for
the Heimdal code that's been added into OpenAFS. This patch deals
with this issue by creating an inline version in the OS-specific
param.h file.

Note that this issue does not seem to exist in the amd64 version of
OpenBSD so (at least for now) tis fix is only applied to the i386
version of the header files.

Change-Id: Ide8a5ff49cb662e145fd93aefd8e3a12d7cbead5
Reviewed-on: http://gerrit.openafs.org/8926
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoOpenBSD 4.6/4.7: Define curproc for rx_atomic.h.
Antoine Verheijen [Mon, 21 Jan 2013 06:27:02 +0000]
OpenBSD 4.6/4.7: Define curproc for rx_atomic.h.

For OpenBSD 4.6 and 4.7, the rx_atomic.h header ultimately resorts
to the use of the default atomic routines that rely on MUTEX
macros. Those macros require that 'curproc' be defined, which in
turn requires the presence of the 'sys/proc.h' header. This patch
inserts that header into the param.h file for those systems.

Note that subsequent versions of OpenBSD have __sync_fetch_and_add
and don't require 'curproc' as a result.

Change-Id: I5131aed60631ef285eda92180ef65845165526b1
Reviewed-on: http://gerrit.openafs.org/8925
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux 3.8: vmtruncate removal
Marc Dionne [Thu, 10 Jan 2013 02:22:27 +0000]
Linux 3.8: vmtruncate removal

vmtruncate had been deprecated for a while and has now been
removed.  Do things the new way based on truncate_setsize.

Change-Id: If584329f7330f44be3909e4c8b935e4fe5e2b536
Reviewed-on: http://gerrit.openafs.org/8906
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux 3.8: session_keyring changes
Marc Dionne [Thu, 10 Jan 2013 00:26:54 +0000]
Linux 3.8: session_keyring changes

The session_keyring is now attached directly to the cred structure
and the thread_group_cred structure (cred->tgcred) no longer exists.

Adapt code that makes use of tgcred, and use the standard rcu based
mechanism to update session_keyring.

Change-Id: If4b88cbc7f9af6343353648837b28541a5088429
Reviewed-on: http://gerrit.openafs.org/8905
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux: setpag() may replace credentials
Marc Dionne [Sat, 19 Jan 2013 03:40:03 +0000]
Linux: setpag() may replace credentials

For recent Linux. setpag() may replace the current process' cred
structure with a new one.  This is not a problem for most callers,
but in the case of processing a SetTokens2 pioctl with the setpag
option, the new credentials should be used to determine the target
for the token.

Change-Id: I4441349b8a72eac7d56276abcdf243b2ffd21b98
Reviewed-on: http://gerrit.openafs.org/8924
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorxperf: print achieved transfer rate
Dan van der Ster [Fri, 14 Dec 2012 10:08:44 +0000]
rxperf: print achieved transfer rate

Prints the client transfer rate in appropriate units (kbit/s, Mbit/s, or Gbit/s).

Change-Id: I5632185953c5d2bfc962af71152734d842cfb021
Reviewed-on: http://gerrit.openafs.org/8758
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoCatch up to FreeBSD KPI for vfs_cmount
Ben Kaduk [Fri, 11 Jan 2013 18:03:02 +0000]
Catch up to FreeBSD KPI for vfs_cmount

Almost a year ago, mckusick changed the VFS KPI/KBI for the cmount
VFS operation, making the flags argument a 64-bit quantity.
Introduce appropriate conditionals for our prototype of afs_cmount
for the change on the 10.x and 9.x branches.

Change-Id: Ia0b8759f027e64f98f087daabbf1a51030171f21
Reviewed-on: http://gerrit.openafs.org/8907
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLINUX: fix array indexing issue in memory statistics
Chas Williams (CONTRACTOR) [Thu, 17 Jan 2013 02:16:31 +0000]
LINUX: fix array indexing issue in memory statistics

The comma is a sequence point and i gets incremented and then used.
This results in writing past the end of the array by one (and failing
to initialize the first element as well).

Potential fix for RT ticket 131566.

Change-Id: Iabe7e78961d1f5348bca75ca5b9e6e29d8554957
Reviewed-on: http://gerrit.openafs.org/8914
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoubik: Remove bare global ubik_epochTime
Andrew Deason [Thu, 17 Jan 2013 22:35:09 +0000]
ubik: Remove bare global ubik_epochTime

Commit e4ac552a moved ubik_epochTime into a global version_globals
struct. However, it missed a references to the existing
ubik_epochTime value it was moving, as well as its declaration. Remove
the declaration, and move the reference to use the version_globals
structure.

Change-Id: I2552ba850f286b2b93f3c1b696d993a7cfc074c8
Reviewed-on: http://gerrit.openafs.org/8918
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoubik: Trivial formatting fix
Andrew Deason [Thu, 17 Jan 2013 22:37:56 +0000]
ubik: Trivial formatting fix

Change-Id: Ie409dc5dc7fe63cc72c97666146e7019e5db086e
Reviewed-on: http://gerrit.openafs.org/8917
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agogcc 4.8: fix warnings
Marc Dionne [Wed, 9 Jan 2013 23:42:32 +0000]
gcc 4.8: fix warnings

Quiet new warnings introduced by gcc 4.8:

- Many unused typedefs under src/admin.
- A possibly uninitialzed variable under src/viced

Change-Id: I96858c2d12a9ee3270d89a64fcf772affe93e9eb
Reviewed-on: http://gerrit.openafs.org/8913
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agodoc: dynamic mount requires dynroot and fakestat
Michael Meffie [Mon, 10 Dec 2012 17:01:38 +0000]
doc: dynamic mount requires dynroot and fakestat

Document that dynamic mount (/afs/.:mount) requires
dynroot and fakestat on non-linux unix.

Change-Id: I947edd30d510c7cc6840bc2cc74d0ef07b692afb
Reviewed-on: http://gerrit.openafs.org/8739
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>

11 years agoSOLARIS: Avoid open count cleanup for Solaris 11
Andrew Deason [Tue, 8 Jan 2013 23:50:57 +0000]
SOLARIS: Avoid open count cleanup for Solaris 11

The comments in here no longer apply to Solaris, as of OpenSolaris
commit 11736:63a134e1f09c by Donghai Qiao (4492533 Filesystems may
need VOP_CLOSE() for executables following a VOP_OPEN()). This means
that this workaround should no longer be necessary for any Solaris 11
release, any illumos release, and anything else based off of
OpenSolaris. So, stop doing it.

Thanks to Frank Batschulat for pointing this out, and providing all of
the details.

Change-Id: I54ed545e3b9d858fbffc762246ae805cd9c63a64
Reviewed-on: http://gerrit.openafs.org/8895
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoSOLARIS: Use vn_renamepath when available
Andrew Deason [Tue, 8 Jan 2013 23:41:21 +0000]
SOLARIS: Use vn_renamepath when available

In Solaris 11.1, the signature of vn_setpath changes; it gains an
extra boolean_t argument called 'force'. Instead of trying to adapt to
it, call vn_renamepath() instead, which will do the correct thing and
call vn_setpath &co for us. vn_renamepath has existed since Solaris 10
Update 8, and is in all releases of Solaris 11. Only call it in
Solaris 11, since it makes the ifdefs easier, and there are no
problems with calling vn_setpath on Solaris 10.

Thanks to Frank Batschulat for all of the relevant information.

Change-Id: Iad4ada70abbb5ec2289c30149ab4c571fa8a68ff
Reviewed-on: http://gerrit.openafs.org/8894
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoFix build for separate objdirs
Ben Kaduk [Mon, 7 Jan 2013 20:05:40 +0000]
Fix build for separate objdirs

In particular, setting UNTHREADED=${srcdir}/dir and then referring
to ${srcdir}/${UNTHREADED} is a recipe for sadness.

Fix the libtool invocation to correctly find .la.sym files in ${srcdir}.

Also add some missing header dependencies that are hidden when building
in the src tree.

Change-Id: I1b663141c549cc4b90e46327c3fb31dc80294eaa
Reviewed-on: http://gerrit.openafs.org/8891
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Restrict the Service IOCTLS to the service process
Rod Widdowson [Fri, 28 Dec 2012 15:43:52 +0000]
Windows: Restrict the Service IOCTLS to the service process

When the service starts the system we save it's PID and when we see a
IOCTL_AFS_INITIALIZE_REDIRECTOR_DEVICE,
IOCTL_AFS_PROCESS_IRP_REQUEST, IOCTL_AFS_PROCESS_IRP_RESULT,
IOCTL_AFS_SYSNAME_NOTIFICATION or IOCTL_AFS_SYSNAME_NOTIFICATION
ioctl we check that the calling process has that PID.

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

11 years agocorrect whitespace errors in readme files
Michael Meffie [Sat, 5 Jan 2013 18:37:51 +0000]
correct whitespace errors in readme files

Fix the trailing whitespace and leading spaces
before tabs in the readme files.

Change-Id: If20e528ddb28f82e4d3d1b1f03dec8670f914afc
Reviewed-on: http://gerrit.openafs.org/8877
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Only allow the local system account to speak to the redirector
Rod Widdowson [Fri, 28 Dec 2012 14:40:40 +0000]
Windows: Only allow the local system account to speak to the redirector

When we get the IOCTL_AFS_INITIALIZE_CONTROL_DEVICE IOCTL we check to
see whether the calling process is the LOCAL_SYSTEM_SID (the one that
services run at if they are not running as a specified SID).  If we
are not then the initialize fails ACCESS_DENIED.

If the debug build ONLY, setting the AFS_DBG_DISABLE_SYSTEM_SID_CHECK
bit in OpenAFSDebugFlags circumvents this check, allowing interactive
debugging.

Existing code stops two processes (or even handles) from trying to
initialize the system.

Change-Id: I2ef8ca3a0df908acba38b435178d0509e96d6114
Reviewed-on: http://gerrit.openafs.org/8842
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agolibadmin/vos/vosutils.c: mask out sign-extension
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:59 +0000]
libadmin/vos/vosutils.c: mask out sign-extension

Right-shifting a signed int by 24 bits can produce a value outside of
0..0xff due to sign-extension.  As a result, in AddressMatch(), the
first bPattern!=255 check can never succeed.  Fix by masking with 255
before comparison.

Change-Id: Idb0b4c176ff120c7cf0e03a935ebfdca51084bbd
Reviewed-on: http://gerrit.openafs.org/8884
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agolwp/iomgr.c: avoid off-by-one out-of-bounds access
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:46 +0000]
lwp/iomgr.c: avoid off-by-one out-of-bounds access

Avoid accessing sigDelivered[NSIG] and sigEvents[NSIG], which are
out-of-bounds by one.

Change-Id: Id6a1798cba901987b8103f287e0869b31040b45b
Reviewed-on: http://gerrit.openafs.org/8883
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agobutm/file_tm.c: check for null pointer before dereferencing
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:33 +0000]
butm/file_tm.c: check for null pointer before dereferencing

Move the null pointer check to before the pointer is dereferenced.

Change-Id: I9983dae8802706c1efeff8a507a001b649572686
Reviewed-on: http://gerrit.openafs.org/8882
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoauth/authcon.c: fix likely mistake
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:21 +0000]
auth/authcon.c: fix likely mistake

It seems likely the original developer intended to check
*scIndex==RX_SECIDX_NULL rather than scIndex==RX_SECIDX_NULL.

Change-Id: I8a33d3cb177a9212917613581957073392b08314
Reviewed-on: http://gerrit.openafs.org/8881
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>

11 years agotools/dumpscan/pathname.c: properly check strdup() return value
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:11 +0000]
tools/dumpscan/pathname.c: properly check strdup() return value

Fix the check for strdup() running out of memory.

Change-Id: I4e2d83036095c7b292ee4c386d8ed7b16ec75067
Reviewed-on: http://gerrit.openafs.org/8880
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoubik/udebug.c, vol/vol-info.c: check array index before dereferencing
Nickolai Zeldovich [Sun, 6 Jan 2013 04:44:55 +0000]
ubik/udebug.c, vol/vol-info.c: check array index before dereferencing

Avoid out-of-bounds array accesses by first checking that the index
is in-bounds, and then dereferencing; not the other way around.

Change-Id: Ib36a28ca6181a7a7fd602de45cb5a15fad099a44
Reviewed-on: http://gerrit.openafs.org/8879
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agovolser/vol_split.c: do not dereference known-NULL pointer
Nickolai Zeldovich [Sun, 6 Jan 2013 04:44:33 +0000]
volser/vol_split.c: do not dereference known-NULL pointer

Avoid dereferencing a pointer that we just checked is NULL when printing
an error message.

Change-Id: Ibc89883977e7044cab2a844d97b7f0f7d236f4ea
Reviewed-on: http://gerrit.openafs.org/8878
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agospelling corrections in readme files
Michael Meffie [Sat, 5 Jan 2013 15:40:42 +0000]
spelling corrections in readme files

Fix spelling errors in readme files.

Change-Id: I62348372d5e226f2b2a3a7732b4a5f8c7331b2ff
Reviewed-on: http://gerrit.openafs.org/8876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>

11 years agoSOLARIS: Look for ncurses in ncurses/ncurses.h
Andrew Deason [Fri, 4 Jan 2013 19:18:40 +0000]
SOLARIS: Look for ncurses in ncurses/ncurses.h

Solaris 11+ has ncurses.h in ncurses/ncurses.h. Look for it there.

Without this, on Solaris 11.1 we will detect libncurses automatically
(because it lives in /usr/lib), but not ncurses.h (since it is in
ncurses/ncurses.h, not ncurses.h). So, we will fall back to curses.h,
but will try to link to libncurses, which, as you might guess, fails
with various undefined symbols.

Change-Id: Ia174e2a3c97318d6db2a48a6098569aede93522c
Reviewed-on: http://gerrit.openafs.org/8874
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoSOLARIS: Avoid areq and auid conflict
Andrew Deason [Fri, 4 Jan 2013 18:47:35 +0000]
SOLARIS: Avoid areq and auid conflict

On new Solaris (11.1), nfs/auth.h #defines areq and auid to access
some elements inside the nfsauth_arg structure more easily. We have a
lot of functions that use those names as parameters, so the compiler
throws an error (since we have a decl like "struct vrequest
*areq_u.areq").

We cannot avoid including that header, since we need some NFS-related
headers for the NFS xlator, and they pull in nfs/auth.h
unconditionally. So, work around this by undefining areq and auid
afterwards.

Change-Id: Ifd139917dfe7a1221941351f7873fe183c617159
Reviewed-on: http://gerrit.openafs.org/8873
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoafs: Check dv against localhero aincr
Andrew Deason [Wed, 2 Jan 2013 19:09:06 +0000]
afs: Check dv against localhero aincr

For operations that modify directories, we call afs_LocalHero to
determine if we can perform the directory modification in our local
cache, and avoid fetching the dir blob from the fileserver. Currently,
afs_LocalHero assumes that the DV received from the fileserver is
correct, and will update the cache DV as long as we have a valid
callback on the file.

If for any reason the client cache falls out of sync with what's on
the fileserver, this can cause the client to incorrectly believe its
cache is up to date. Since, the cached data will be marked with the
newest DV, even if the DV on the server has jumped to be larger than
we expected.

While the client cache should never fall out of sync with the
fileserver, in the past this has been possible due to other bugs
(fileserver idle dead processing and client VNOSERVICE handling).
Assuming that the given DV is correct is also just unnecesarily
fragile, since we can always check if it is correct, so just check it,
and add some comments helping explain what's going on here. Note that
regular file writes effectively already check this.

Note that this change makes use of the 'aincr' argument to
afs_LocalHero, which was previously unused. aincr appears to have been
used for a purpose similar to this before OpenAFS 1.0, but was
removed, possibly accidentally.

It is possible this change negatively affects, or even breaks
(unlikely), functionality with the AFS<->DFS translator. Although
nothing of the sort has been seen, it is difficult to know one way or
the other, due to the lack of available DFS translators.

Change-Id: I0e5395bac695257f66ba0cd58695a59ebdf56431
Reviewed-on: http://gerrit.openafs.org/8864
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agovol: correct old conditional for IH_CONDSYNC
Mark Vitale [Fri, 21 Dec 2012 23:26:18 +0000]
vol: correct old conditional for IH_CONDSYNC

Two places in the vol package performed IH_CONDSYNC(vp->linkHandle)
only if AFS_NT40_ENV.  This was correct when the namei implementation
was windows only; however, this ifdef was apparently overlooked
when namei was implemented for UNIX.

Change-Id: I0cbe2c5c0a65ece0485b8c2d5a5f92eeb53725fe
Reviewed-on: http://gerrit.openafs.org/8815
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoMake MIN/MAX code in rx/rx_packet.h more readable
Russ Allbery [Thu, 3 Jan 2013 22:09:02 +0000]
Make MIN/MAX code in rx/rx_packet.h more readable

Eventually all MIN/MAX code in the tree should be handled uniformly,
but until that day, make this chunk of it more readable and
document the odd exception case for Linux kernel builds.

Change-Id: I4afe5d99b63010df831943e6b82ff89733b08066
Reviewed-on: http://gerrit.openafs.org/8871
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoEnsure MIN/MAX are defined in userspace builds of rx
Russ Allbery [Thu, 3 Jan 2013 21:57:02 +0000]
Ensure MIN/MAX are defined in userspace builds of rx

The include of <sys/param.h> was removed from rx_packet.h on
Linux 2.6 and later to fix kernel builds with 3.7, which doesn't
have that header in kernel space.  However, while kernel space
always provides MIN/MAX defines, userspace relied on the header.
On at least powerpc, no other include chain includes sys/param.h,
so MIN/MAX were left undefined.

Fix this by only skipping the include of <sys/param.h> on Linux
if building in kernel mode.

Change-Id: Icd2edd645ef4d18d626de8ce8b81ac07f37b1f21
Reviewed-on: http://gerrit.openafs.org/8870
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoFix spelling error (retreive for retrieve) in strings
Russ Allbery [Thu, 3 Jan 2013 17:13:26 +0000]
Fix spelling error (retreive for retrieve) in strings

Caught by Lintian analysis of the compiled binaries.

Change-Id: I5d53d596d30ad8fea5d3f8f0116122a8c1aa808c
Reviewed-on: http://gerrit.openafs.org/8865
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoviced: initInterfaceAddr_r regardless of ICBS code
Andrew Deason [Fri, 28 Dec 2012 18:16:49 +0000]
viced: initInterfaceAddr_r regardless of ICBS code

Currently we only call initInterfaceAddr_r for a host if a call to
RXAFS_InitCallBackState3 succeeds. However, this leaves the host
without a host->interface structure, which indicates that the host
does not support UUIDs, and is represented by just a single host,port
pair.

But this is not correct; the host probably does have the relevant UUID
associated with it, but it is just not responding. So, with the
current code, we create a uuid-less host structure for a host that
probably has a uuid; that host structure will probably never be used,
and will just get deleted later.

So instead, always call initInterfaceAdd_r. Do it before the ICBS
call, so the host will be findable via UUID as early as possible. If
the ICBS call fails, the host will be marked as 'down' later on.

Change-Id: I3a000af90773acbdd66fc22718e5e742619839a1
Reviewed-on: http://gerrit.openafs.org/8847
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoviced: Avoid dangling uuid hash table entry
Andrew Deason [Fri, 28 Dec 2012 17:58:33 +0000]
viced: Avoid dangling uuid hash table entry

Currently we add a given host to the uuid hash table, then call
RXAFS_InitCallBackState3, and then only initialize the host->interface
structure if the ICBS3 call succeeded.

If the ICBS3 call fails, we have added a host to the uuid hash table,
but the host structure does not contain that uuid. If the host is then
deleted, we will not remove the host from the uuid hash table (since
host->interface is NULL), and so the uuid hash table entry will still
point to the freed host. If that host is then later looked up via that
uuid, we can reference a freed host, which can cause all kinds of
undefined behavior.

So instead, add the host to the uuid hash table at the same time that
we initialize the host->interface structure, inside
initInterfaceAddr_r.

FIXES 131277

Change-Id: Ib2ca82cc498877ec896ab1806cf675f1271ec214
Reviewed-on: http://gerrit.openafs.org/8846
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agovol: fix everything to use volumeid type
Derrick Brashear [Fri, 28 Dec 2012 05:46:12 +0000]
vol: fix everything to use volumeid type

use one type for volumeid, not 3. kill VolId, and stop
using afs_uint32 (and a few times, afs_int32)

Change-Id: Ibcbd09b5a24d8720b02a02f926e6f59dc0f529aa
Reviewed-on: http://gerrit.openafs.org/8845
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>