openafs.git
11 years agorx: Don't have 2 different protos for rxi_CheckCall
Simon Wilkinson [Thu, 25 Oct 2012 10:32:03 +0000]
rx: Don't have 2 different protos for rxi_CheckCall

Use a single prototype for rxi_CheckCall in both the pthread and
lwp cases. Remove the #ifdef maze at the call sites, and take advantage
of the fact that MUTEX_EXIT reduces to an empty string in the lwp
case.

Change-Id: Iaa8c1b983f1c8372e9c2e1b90aaef25a2bc5f81f
Reviewed-on: http://gerrit.openafs.org/8291
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 agorx: Don't double check conn->call
Simon Wilkinson [Thu, 25 Oct 2012 10:27:33 +0000]
rx: Don't double check conn->call

We currently have

call = conn->call[channel]
if (call) {
   ...
} else {
    call = conn->call[channel]
    if (call) {
       ...
    }
}

As we don't drop (or acquire) any locks between the first and the
second check of call, there's no way that the result can be different
from the first time we checked. So just get rid of the uneccessary
code, and reindent the following block to match.

Change-Id: If21a1d0af461fe0c0651e713dfb99a7c5f01cba4
Reviewed-on: http://gerrit.openafs.org/8290
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 agorx: Move bytesSent + bytesRcvd into app only data
Simon Wilkinson [Tue, 23 Oct 2012 18:21:09 +0000]
rx: Move bytesSent + bytesRcvd into app only data

The call->bytesSent and call->bytesRcvd counters are only manipulated
by the application thread in running calls. Move them into the app-only
section of the call structure so this is clear.

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

11 years agorx: Don't use app-thread variable in SendXmitList
Simon Wilkinson [Tue, 23 Oct 2012 12:35:43 +0000]
rx: Don't use app-thread variable in SendXmitList

The value of call->app.mode is changed by the application thread
without taking the call lock. Instead of using this variable in
SendXmitList to determine whether the queue should be flushed, add
a new flag (RX_CALL_FLUSH) to control flushing behaviour.

As call->flags is manipulated under the call lock, its value can
be safely used by SendXmitList.

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

11 years agorx: Make lock-free call data explicit
Simon Wilkinson [Tue, 23 Oct 2012 11:41:07 +0000]
rx: Make lock-free call data explicit

For speed, the application thread accesses a number of elements of
the call structure without holding the call lock. This is safe, as
long as the application thread is the only place in which these
items of data are accessed.

Make this distinction explicit by creating a new structure to hold
all of these fields, and include this structure within the rx_call.

This turns up one place in the code (SendXmitList) which accesses an
application private piece of data in the listener and event threads.
A forthcoming patch will fix this.

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

11 years agoWindows: Makefile dependencies
Jeffrey Altman [Sat, 6 Oct 2012 21:34:52 +0000]
Windows: Makefile dependencies

Permit "afsrdr" and "extra" to be built without the rest of
the tree by making them depend on "config".

Change-Id: I52e484f64d02e7f9b136164e10accdc981835ec0
Reviewed-on: http://gerrit.openafs.org/8321
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: Send all \\AFS\PIPE to afsd_service
Jeffrey Altman [Mon, 6 Aug 2012 16:19:26 +0000]
Windows: Send all \\AFS\PIPE to afsd_service

Anytime there is a pipe service request, forward it to the
afsd_service.exe and permit the service to manage the request.
The prior implementation resulted in STATUS_FILE_NOT_FOUND errors
being delivered when an unexpected service was requested.

Change-Id: I2ae9c45db787c0cb422fa3fecdfb235631927415
Reviewed-on: http://gerrit.openafs.org/8320
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: Treat EIO from file server as fatal error
Jeffrey Altman [Wed, 26 Sep 2012 05:51:37 +0000]
Windows: Treat EIO from file server as fatal error

Return STATUS_DISK_OPERATION_FAILURE to caller when a file
server fails an RPC with EIO.  Previous behavior was to retry
the request indefinitely.

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

11 years agoWindows: ObjectInfo RefCount 0 <-> 1 transitions
Jeffrey Altman [Fri, 19 Oct 2012 15:26:21 +0000]
Windows: ObjectInfo RefCount 0 <-> 1 transitions

When the reference count transitions from 0 <-> 1 ensure that the
ObjectInfoLock is held exclusive to prevent the current thread from
altering the state while another thread is holding the ObjectInfoLock
shared in order to conditionally perform an action based upon
the the reference count being zero.

Change-Id: I5bcf384a0ea90e4896e55b537e92112ac3791a4c
Reviewed-on: http://gerrit.openafs.org/8257
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: PrimaryVolumeWorker ObjectInfoLock deadlock
Jeffrey Altman [Thu, 25 Oct 2012 22:42:11 +0000]
Windows: PrimaryVolumeWorker ObjectInfoLock deadlock

Patchset eaad522651a81f20eac4966a55a731e0e59e39dd inadvertently
introduced a deadlock with invalidation requests from the service.
It is not safe to hold the ObjectInfoLock resource across calls
to AFSCleanupFcb().  Instead of holding the lock obtain a reference
to the ObjectInformationCB.

Change-Id: I048401ec3e432c05c8a72251ef1e32442974256d
Reviewed-on: http://gerrit.openafs.org/8308
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: AFSCleanup re-organization
Jeffrey Altman [Thu, 25 Oct 2012 18:33:29 +0000]
Windows: AFSCleanup re-organization

Reorganize the activities of the AFSCleanup() for File FCBs
so that the Fcb Resource can be dropped prior to issuing the
cleanup request to the cache manager.   The cache manager can
block for a long period of time while flushing data and holding
the Fcb resource blocks all subsequent CreateFile requests.

Change-Id: Ieaf3653ebf487670bce1043e73be093eb77a8736
Reviewed-on: http://gerrit.openafs.org/8307
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: AFSCleanup Flush Data decision
Jeffrey Altman [Thu, 25 Oct 2012 18:31:14 +0000]
Windows: AFSCleanup Flush Data decision

AFSCleanup() should instruct the cache manager to flush dirty
data when the Context Control Block indicates that the handle
being closed was opened for writing and was granted appropriate
permissions.   The decision to flush should not be dependent on
the open handle count because the last handle might belong to
an authentication group that does not have write permission.

Change-Id: I4e181616f1c8eba9e4c6184e2035d9f6cbaba1d0
Reviewed-on: http://gerrit.openafs.org/8306
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: buf_DirtyBuffersExist return value
Jeffrey Altman [Thu, 25 Oct 2012 18:12:42 +0000]
Windows: buf_DirtyBuffersExist return value

buf_DirtyBuffersExist() should return 'found' not '0'.

Change-Id: I037ce37d5fc8a63f563ded196925af930434fb16
Reviewed-on: http://gerrit.openafs.org/8305
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: AFSMarkDirty() require ExtentsResource held
Jeffrey Altman [Tue, 23 Oct 2012 00:40:21 +0000]
Windows: AFSMarkDirty() require ExtentsResource held

Instead of dynamically testing if the ExtentsResource is held
and if not acquire it within AFSMarkDirty(), simply require that
it be held.  AFSMarkDirty() is only called from one location.

Change-Id: If30fc05fead4c9e0604555239e9b862659de3e8b
Reviewed-on: http://gerrit.openafs.org/8304
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: AFSFlushExtents QueuedFlushCount leak
Jeffrey Altman [Tue, 23 Oct 2012 00:34:59 +0000]
Windows: AFSFlushExtents QueuedFlushCount leak

The FCB QueuedFlushCount was decremented in all code paths
but only incremented if the AuthGroup acquisition succeeded.
Increment the counter before the AuthGroup checks.

Change-Id: I3f58075124412cc4a7ac63dc6a7f90a91af369cf
Reviewed-on: http://gerrit.openafs.org/8303
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: RDRFunction remove DebugBreak
Jeffrey Altman [Tue, 23 Oct 2012 00:29:47 +0000]
Windows: RDRFunction remove DebugBreak

DebugBreak hard coded into the source tree makes debugging
other unrelated issues difficult if the code path being executed
includes them.  Remove them.

Change-Id: I0f55b1fbccdbac13abecb4f4e9774b23fa57678d
Reviewed-on: http://gerrit.openafs.org/8302
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: Promote DELETED from DirEntry to ObjInfo
Jeffrey Altman [Fri, 19 Oct 2012 13:33:18 +0000]
Windows: Promote DELETED from DirEntry to ObjInfo

On deletion of the DirEntry in AFSDeleteDirEntry() set the
AFS_OBJECT_FLAGS_DELETED flag on the ObjectInformation object
if and only if the AFS_DIR_ENTRY_DELETED flag was set in the
DirEntry.  Setting the AFS_OBJECT_FLAGS_DELETED should not
be conditional on the ObjectInformatION ReferenceCount being
zero.

Remove the test and set of AFS_OBJECT_FLAGS_DELETED from
AFSClose() because that operation will already have been
performed in the call to AFSDeleteDirEntry() if necessary.

Change-Id: Ib52f89633e6a343b08d408ef24b067c8fae73e0f
Reviewed-on: http://gerrit.openafs.org/8256
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
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 agoopr: Clarify opr_time copyright
Simon Wilkinson [Fri, 19 Oct 2012 13:06:57 +0000]
opr: Clarify opr_time copyright

opr_time.h made it in to the tree without a copyright statement.
Clarify that it is BSD licensed.

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

11 years agovolser: comment with a list of all dump tags
Hartmut Reuter [Sat, 20 Oct 2012 22:24:53 +0000]
volser: comment with a list of all dump tags

this is a list of all the dump tags currently defined

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

11 years agoLinux: Rework handling of names in the lookup functions
Marc Dionne [Sat, 20 Oct 2012 16:59:01 +0000]
Linux: Rework handling of names in the lookup functions

Rework the name lookup functions in the kernel to deal more cleanly
with the change of API for kernel 3.7

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

11 years agolwp: zero reused request blocks
Magnus Ahltorp [Fri, 19 Oct 2012 22:12:13 +0000]
lwp: zero reused request blocks

new blocks are calloc()d as zeroed. reused ones are not.
zero them

FIXES 131369

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

11 years agoLinux: fix afs_putname wrapper for pre-3.7 kernels
Marc Dionne [Fri, 19 Oct 2012 17:31:53 +0000]
Linux: fix afs_putname wrapper for pre-3.7 kernels

Make the compatibility function use the right type for pre-3.7
kernels.

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

11 years agoWindows: Remove 'bAllocatedFcb' from AFSCreate.cpp
Jeffrey Altman [Tue, 16 Oct 2012 13:36:56 +0000]
Windows: Remove 'bAllocatedFcb' from AFSCreate.cpp

All functions now call AFSInitFcb() and the ObjectInfo->Fcb == NULL
test is performed internally.  Therefore, it is not possible for
the caller to track whether or not an Fcb was allocated.  It is
irrelevant.  The Fcb will be cleaned up when the ObjectInfo is
destroyed by the PrimaryVolumeWorker thread.

Change-Id: I3255563e1b0c44082e4f390002d294ad333d534f
Reviewed-on: http://gerrit.openafs.org/8242
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: PrimaryvolumeWorker do not pause if busy fcb
Jeffrey Altman [Mon, 8 Oct 2012 03:41:32 +0000]
Windows: PrimaryvolumeWorker do not pause if busy fcb

The AFSPrimaryVolumeWorkerThread should not unnecessarily block
on the FCB Resource because such blockage could be the result of
of waiiting for extents to be delivered from the service.  The
AFSPrimaryVolumeWorkerThread is the primary method by which
extents are released back to the service.

AFSCleanupFcb() is modified to return STATUS_RETRY if the Fcb
resource cannot be obtained without blocking.

The AFSPrimaryVolumeWorkerThread() does not call
AFSCleanupFcb() with 'ForceFlush' parameter set to TRUE and
remembers if STATUS_RETRY is returned.  If any Fcb was busy,
then the worker does not wait for the 5 second timer to fire.

Change-Id: If3eab06b902202483eb354362a4db6bc8167d0df
Reviewed-on: http://gerrit.openafs.org/8227
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: avoid race set/clear ExtentsRequestComplete
Jeffrey Altman [Fri, 19 Oct 2012 12:37:25 +0000]
Windows: avoid race set/clear ExtentsRequestComplete

The FCB ExtentsRequestComplete KEVENT setting, clearing
and testing was racy.  Clear the event before issuing the
request to the service and if the request fails, set it in
case two threads issued requests for the same FCB in parallel
and one fails and the other succeeds.

We must ensure that a clear does not mask the event being set
prior to the request thread returning.

Change-Id: I6d496214a2621aeca2b9f6d2f50095ffd19b6c59
Reviewed-on: http://gerrit.openafs.org/8255
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: clear pending delete upon deletion
Jeffrey Altman [Thu, 18 Oct 2012 13:56:12 +0000]
Windows: clear pending delete upon deletion

During cleanup processing if the DELETE_PENDING flag is set
the service will be told to delete the file when the handle
count reaches 1.  At that point the file will be deleted
and the DELETED flag will be set on the object info object.
The DELETE_PENDING flag was not being cleared which could
lead to confusion.  This patchset clears the flag after deletion.

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

11 years agoWindows: AFSInitFcb Check ObjectInfo->Fcb for NULL
Jeffrey Altman [Sun, 7 Oct 2012 14:23:19 +0000]
Windows: AFSInitFcb Check ObjectInfo->Fcb for NULL

Now that AFSInitFcb is called under the ObjectInfoLock, it is
once again safe to perform a test for ObjectInfo->Fcb != NULL
and return immediately if an Fcb is already assigned.

Change-Id: Id926b9ccf24c7761dbeacf42c53d7cc7d1375482
Reviewed-on: http://gerrit.openafs.org/8226
Tested-by: BuildBot <buildbot@rampaginggeek.com>
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: Fix DV Raced Trace Message Parameters
Jeffrey Altman [Sun, 7 Oct 2012 14:20:11 +0000]
Windows: Fix DV Raced Trace Message Parameters

Data Versions are logged as HighPart:LowPart not QuadPart.

Change-Id: I7cfb712060fd602a1d20ca1d4f20b892820edf89
Reviewed-on: http://gerrit.openafs.org/8225
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: Protect ObjectRefCnts with ObjectInfoLock
Jeffrey Altman [Fri, 5 Oct 2012 15:36:45 +0000]
Windows: Protect ObjectRefCnts with ObjectInfoLock

The ObjectInfoCB.ObjectReferenceCount is tested to determined
when it is safe to remove an FCB from the ObjectInfoCB.  The
value must not be permitted to change while a removal is performed.

Protect AFSRemoveFcb() calls with exclusive holds of the
ObjectInfoCB.NonPagedInfo->ObjectInfoLock.  New functions:

  AFSObjectInfoIncrement()
  AFSObjectInfoDecrement()

perform all increments and decrements while holding the
ObjectInfoLock in a Shared state.

Change-Id: If89b7668ef0a891d55b039d9516620b581c79e10
Reviewed-on: http://gerrit.openafs.org/8224
Tested-by: BuildBot <buildbot@rampaginggeek.com>
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: AFSPrimaryVolumeWorkerThread AFSRemoveFcb
Jeffrey Altman [Wed, 3 Oct 2012 01:11:01 +0000]
Windows: AFSPrimaryVolumeWorkerThread AFSRemoveFcb

Do not call AFSRemoveFcb() on a directory entry whose Fcb
has a non-zero use count.

Change-Id: I0d733327c094f15a7b681eb1806a4fa9a4a6c151
Reviewed-on: http://gerrit.openafs.org/8223
Tested-by: BuildBot <buildbot@rampaginggeek.com>
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: Always AFSInitFcb and AFSRemoveFcb
Jeffrey Altman [Wed, 3 Oct 2012 01:07:21 +0000]
Windows: Always AFSInitFcb and AFSRemoveFcb

Instead of comparing ObjectInfo->Fcb to NULL and conditionally
calling AFSInitFcb() or AFSRemoveFcb(), always call them and use
InterlockedExchangePointer() as the test.

Change-Id: I81915dfdfdf180c04ad2b4ff7506784a83ee8c2a
Reviewed-on: http://gerrit.openafs.org/8221
Tested-by: BuildBot <buildbot@rampaginggeek.com>
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: AFSRequestExtentsAsync and AFSDoExtentsMapRegion
Jeffrey Altman [Sat, 6 Oct 2012 21:36:25 +0000]
Windows: AFSRequestExtentsAsync and AFSDoExtentsMapRegion

When calling AFSDoExtentsMapRegion() the FCB ExtentsResource
must be held.   AFSRequestExtentsAsync() failed to hold the
ExtentsResource across the call.

Change-Id: I607cfb45725410c7f079b3be03002b002fccbea4
Reviewed-on: http://gerrit.openafs.org/8220
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 agolwp: add shared-locked macro
Hartmut Reuter [Thu, 18 Oct 2012 11:32:50 +0000]
lwp: add shared-locked macro

we have a macro to check for write locked, add one for shared locked

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

11 years agomemcache: add extend-entry function
Hartmut Reuter [Thu, 18 Oct 2012 11:28:33 +0000]
memcache: add extend-entry function

export directly and rewrite writevblk in terms of it

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

11 years agobypasscache: update threshold variable type
Hartmut Reuter [Thu, 18 Oct 2012 11:14:26 +0000]
bypasscache: update threshold variable type

if we're doing things based on size, we should allow storing
a size

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

11 years agolibafs: add partial background store
Hartmut Reuter [Thu, 18 Oct 2012 11:07:21 +0000]
libafs: add partial background store

add a bop that does a partial store

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

11 years agoWindows: Remove Fcb.Specific.File.LazyWriterThread
Jeffrey Altman [Tue, 16 Oct 2012 13:08:37 +0000]
Windows: Remove Fcb.Specific.File.LazyWriterThread

The LazyWriterThread should not be recorded in the FCB.  It is
possible for multiple lazy writes to occur on a file in parallel
in separate threads.  The value is not used for anything in any
case.  AFSCommonWrite() tests the LazyWriterThread value but only
if 'bMapped' is FALSE.  Since 'bMapped' is always TRUE, the
comparison is never performed.   Remove the test and the value.

Change-Id: Iddbb65d2125f39f0362aba72ae20ab2666944367
Reviewed-on: http://gerrit.openafs.org/8241
Tested-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_SyncOp to cm_ReadMountPoint()
Jeffrey Altman [Sun, 14 Oct 2012 19:46:06 +0000]
Windows: Add cm_SyncOp to cm_ReadMountPoint()

Add a cm_SyncOp(CM_SCACHESYNC_FETCHDATA) call to cm_ReadMountPoint()
to prevent multiple FetchData RPCs being issued for the same
mount point at the same time.

Change-Id: I7651f4505727289d800af060cc3ff5a5f449f447
Reviewed-on: http://gerrit.openafs.org/8235
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: AFSInitFcb assign pFcb->ObjectInformation
Jeffrey Altman [Wed, 3 Oct 2012 01:09:35 +0000]
Windows: AFSInitFcb assign pFcb->ObjectInformation

In AFSInitFcb() assign pFcb->ObjectInformation before the
InterlockedExchangePointer call and not afterwards.  Assigning
it afterwards leaves a small race where the ObjectInformation
value will be invalid.

Change-Id: Ie79587e0b2f161b7ff612fc4fb283135bafd1085
Reviewed-on: http://gerrit.openafs.org/8222
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: OpenTargetDirectory AFSInitFcb Reparse Test
Jeffrey Altman [Wed, 17 Oct 2012 00:26:43 +0000]
Windows: OpenTargetDirectory AFSInitFcb Reparse Test

In AFSOpenTargetDirectory the test to determine if AFSInitFcb
allocated a FCB or returned an existing one (STATUS_REPARSE)
was reversed.  If AFSInitFcb was called and AFSOpenTargetDirectory
eventually failed, an in use FCB would be freed.

Change-Id: Ie5974fee5202685575f286fe4fef43dfdc0698cb
Reviewed-on: http://gerrit.openafs.org/8244
Tested-by: BuildBot <buildbot@rampaginggeek.com>
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: ObjectInformationCB indentation
Jeffrey Altman [Fri, 5 Oct 2012 15:40:44 +0000]
Windows: ObjectInformationCB indentation

Fix indentation within ObjectInformationCB structure

Change-Id: I004ca5a16fceb63522e3f244177e60e4459e507b
Reviewed-on: http://gerrit.openafs.org/8219
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: Do not call buf_ClearRDRFlag unlink/rmdir
Jeffrey Altman [Sat, 6 Oct 2012 05:40:47 +0000]
Windows: Do not call buf_ClearRDRFlag unlink/rmdir

When processing unlink and remdir operations initiated by the
SMB stack do not call  buf_ClearRDRFlag.  The redirector upon
receiving the AFS_INVALIDATE_DELETE call will cancel outstanding
extent operations, mark the FCB deleted, and tear down any held
extents.

Change-Id: I5203dbe5489fcfd0a1c871c3e7aa6aa1a7d65e9a
Reviewed-on: http://gerrit.openafs.org/8218
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: Correct alloc size SetFileExtents result
Jeffrey Altman [Sat, 6 Oct 2012 00:16:35 +0000]
Windows: Correct alloc size SetFileExtents result

AFSFileExtentCB objects not AFSSetFileExtentsCB objects.
The latter are too large.  Just wastes memory.

Change-Id: I2ffd1bfd639acc37e2d06bc61749d4ac93376668
Reviewed-on: http://gerrit.openafs.org/8217
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_INVALIDATE_DELETE must cancel IO
Jeffrey Altman [Fri, 5 Oct 2012 02:07:40 +0000]
Windows: AFS_INVALIDATE_DELETE must cancel IO

When processing an AFS_INVALIDATE_DELETE the redirector
must cancel any outstanding extent requests on the file
prior to tearing down the extents.

This code path is triggered either when VNOVNODE is received
from a file server or when an alternate cache manager interface
(SMB) unlinks the file.

Change-Id: I16c08c2469228b33ae4ece0e45a9890a057ab257
Reviewed-on: http://gerrit.openafs.org/8206
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 agosalvager: fix formatting in the rest of the Log messages
Derrick Brashear [Mon, 15 Oct 2012 16:22:03 +0000]
salvager: fix formatting in the rest of the Log messages

right now some not-commonly-defined code fails to compile with warnings.
fix it so it uses a format string like everything else.

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

11 years agorx: Use opr queues
Simon Wilkinson [Fri, 12 Oct 2012 09:07:22 +0000]
rx: Use opr queues

Modify RX so that it uses opr queues throughout, rather than the older,
non-type-safe rx_queue structure and macros. Attempt to clarify which
items in a structure are queue headers, and which are linkage pointers.

This has the knock on effect that including an RX header doesn't
automatically give you rx_queue.h in your application's namespace.

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

11 years agorx: Move server queue entry structure out of rx.h
Simon Wilkinson [Thu, 11 Oct 2012 11:34:46 +0000]
rx: Move server queue entry structure out of rx.h

Hide the server queue management structure in its own header file,
rather than exposing it globally in rx.h. This structure has always
been private - applications have no business knowing about it!

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

11 years agolibafs: Fix second pass in ShakeLooseVCaches
Marc Dionne [Fri, 12 Oct 2012 20:31:24 +0000]
libafs: Fix second pass in ShakeLooseVCaches

Commit 3105c7ff introduced a two phase process for reclaiming
vcache entries.  First go through the list and do what's possible
without sleeping (skipping aliased dentries on Linux), then do
a second pass only if necessary, allowing sleeping.

Unfortunately the test for the end of the VLRU scan is incorrect
and can never trigger, so this second pass was effectively disabled
and any code that is conditional on defersleep=1 was never
exercised.  The code to start the second scan also has issues.

Fix the end of VLRU test, and also correctly set the variables
needed to restart the scan.

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

11 years agoLinux 3.7: putname is no longer exported
Marc Dionne [Mon, 15 Oct 2012 16:26:09 +0000]
Linux 3.7: putname is no longer exported

putname is unexported in kernel 3.7.  Add a compatibility inline
afs_putname function and open code it if necessary.

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

11 years agorxperf: Use libtool RX library
Simon Wilkinson [Tue, 16 Oct 2012 14:07:38 +0000]
rxperf: Use libtool RX library

Use the libtool built liboafs_rx.la, rather than using libafsrpc
for OpenAFS

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

11 years agorx: Export some more functions
Simon Wilkinson [Wed, 17 Oct 2012 11:13:39 +0000]
rx: Export some more functions

Export some symbols that are required by rxperf

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

11 years agorx: Skip rxi_CheckPeerDead if we are DALLY
Andrew Deason [Tue, 11 Sep 2012 19:23:02 +0000]
rx: Skip rxi_CheckPeerDead if we are DALLY

DALLY connections don't need to be marked dead, so just skip the whole
function if we are DALLY.

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

11 years agoLINUX: Ignore 'offender' in error queue processing
Andrew Deason [Tue, 11 Sep 2012 18:59:21 +0000]
LINUX: Ignore 'offender' in error queue processing

The 'offender' is who generated the error, possibly who sent us an
icmp packet (the given 'port' will be 0). What we want is the peer
that is actually unavailable, which is already in the 'addr' variable
we received from the recvmsg itself.

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

11 years agorx: Check for peer deadness in rxi_Resend
Andrew Deason [Tue, 11 Sep 2012 17:48:14 +0000]
rx: Check for peer deadness in rxi_Resend

If we need to resend something, the peer we're sending to may be dead.
Check if the peer is dead in rxi_Resend, so we don't have to wait
(possibly several seconds) for the next rxi_CheckCall.

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

11 years agorx: Process all errors received
Andrew Deason [Mon, 10 Sep 2012 21:31:01 +0000]
rx: Process all errors received

When we receive a buffer of errors from the error queue, loop through
all of them, and do not stop at the first applicable one we find.

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

11 years agolinux: always define do_handlesocketerror
Derrick Brashear [Tue, 16 Oct 2012 13:25:03 +0000]
linux: always define do_handlesocketerror

even if we are not handling socket errors, have a stub function

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

11 years agorx: pthread sendmsg should return success, not a bytecount
Derrick Brashear [Wed, 17 Oct 2012 22:52:41 +0000]
rx: pthread sendmsg should return success, not a bytecount

thanks to Marc Dionne for noticing the error

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

11 years agoLINUX: Allocate error queue buffer once
Andrew Deason [Fri, 7 Sep 2012 22:04:18 +0000]
LINUX: Allocate error queue buffer once

We call osi_HandleSocketError in a loop, so make sure we process all
of the errors. We were allocating a buffer to process the errors in
osi_HandleSocketError itself, but we can reuse the same buffer on
subsequent invocations, to reduce allocation/free pressure if we need
to call osi_HandleSocketError more than once. So, do that.

Change-Id: Idca2b9d21a48a868574ce6cfc5efe2efba3570a1
Reviewed-on: http://gerrit.openafs.org/8115
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 agorx: Process error queue after noticing errors
Andrew Deason [Fri, 7 Sep 2012 21:58:05 +0000]
rx: Process error queue after noticing errors

If errors exist in the socket error queue, we will notice by a sendmsg
or recvmsg returning an error. If we never get an error, we don't need
to check the error queue. So, only call osi_HandleSocketError after
such an error has been returned, so we can avoid unnecessarily
checking the error queue when there are no errors.

Change-Id: I7c8aaaac42728dac7fb0634538b8cc317f0e7212
Reviewed-on: http://gerrit.openafs.org/8114
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>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>

11 years agoTurn on Linux rx error queue and PMTU handling
Andrew Deason [Wed, 1 Aug 2012 19:30:11 +0000]
Turn on Linux rx error queue and PMTU handling

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

11 years agoRevert "Add some basic tests to check out fuse"
Simon Wilkinson [Wed, 10 Oct 2012 15:49:34 +0000]
Revert "Add some basic tests to check out fuse"

This reverts commit 94bf003a720c9a883ba7ebf43ab3053d3072d3dd.

The fuse tests are fundamentally broken as they stand:

*) They rely on files that have not been committed to the tree. To
   function correctly the file fuse/conf/CellServDB must be present
*) They always run, regardless of whether the fuse helper binaries are
   installed on the developers system, or even on whether the tree was
   built with fuse support enabled.
*) They pass, even if fuse fails to start up
*) The file fuse.sh is committed, despite being unused. This is
   particularly confusing, as it looks like this is where the tests
   are performed from (its not, testing is done in dynroot-t)
*) fuse-log should be either cleaned up, or flagged as ignored in
   .gitignore

Revert the commit until such time as all these issues can be fixed

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

11 years agotests: Reformat loopback tests
Simon Wilkinson [Wed, 10 Oct 2012 13:45:03 +0000]
tests: Reformat loopback tests

Reformat the loopback tests to match our house style - 4 spaces for
first indent, a tab for the second, and so on, opening brace of a
function on a newline, spaces around assignments, and so on.

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

11 years agotests: Tidy up loopback adapter tests
Simon Wilkinson [Wed, 10 Oct 2012 13:42:21 +0000]
tests: Tidy up loopback adapter tests

Remove the unused h_errno extern, which in turn removes the need
for disabling strict prototype warnings in the Makefile

Use roken.h, instead of hardcoding system libraries

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

11 years agoLinux: osi_vcache: Fix loop for the hlist case
Marc Dionne [Fri, 12 Oct 2012 20:25:43 +0000]
Linux: osi_vcache: Fix loop for the hlist case

An hlist is not circular, and the end is marked by a NULL next
pointer.

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

11 years agoDAFS: VRS_r with VOL_SALVAGE_NO_OFFLINE in attach2
Andrew Deason [Thu, 4 Oct 2012 20:49:56 +0000]
DAFS: VRS_r with VOL_SALVAGE_NO_OFFLINE in attach2

One caller of VRequestSalvage_r in attach2 was not passing the
VOL_SALVAGE_NO_OFFLINE flag. This really should be passed for every
place that manually sets vp->nUsers = 0, since then the VPutVolume_r
handlers will never fire.

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

11 years agosys: Split up syscall.lo 'echo's
Andrew Deason [Wed, 3 Oct 2012 19:44:46 +0000]
sys: Split up syscall.lo 'echo's

Currently we echo a string to syscall.lo to generate it. However,
'echo' is often a shell builtin, and some shells (such as bash) do not
interpret escape codes like \n unless the -e option is given. So, this
results in syscall.lo containing a single commented line, which
results in .libs/libafsrpc_sys.a not getting created, which later on
causes errors.

Instead, just split the syscall.lo generation into separate echo
invocations, to make sure we work everywhere.

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

11 years agoafsd: consolidate macos event handling code
Derrick Brashear [Wed, 3 Oct 2012 14:32:34 +0000]
afsd: consolidate macos event handling code

in order that this can potentially be extracted entirely
to a platform-specific file, (and possibly dbus-equivalents
inserted also) consolidate the macos system events handling code

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

11 years agoafs: Avoid tracking file locks for RO volumes
Andrew Deason [Tue, 2 Oct 2012 19:38:20 +0000]
afs: Avoid tracking file locks for RO volumes

Advisory file locks for RO volumes don't make a lot of sense, since
there are no possible writes to worry about. The fileserver already
does not track these, so don't even bother processing them in the
client.

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

11 years agocomerr: no need to libl on macos
Derrick Brashear [Wed, 3 Oct 2012 14:27:37 +0000]
comerr: no need to libl on macos

libl is obsolete on macos; stop linking it

Change-Id: If6e184b6a13ccd3f6b175e9dfbfae9a595322159
Reviewed-on: http://gerrit.openafs.org/8200
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoconfigure: make use of native build assist tools possible
Derrick Brashear [Wed, 3 Oct 2012 11:47:06 +0000]
configure: make use of native build assist tools possible

provide a way to run native rxgen, config and compile_et

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

11 years agoAdd some basic tests to check out fuse
Troy Benjegerdes [Mon, 27 Feb 2012 04:56:06 +0000]
Add some basic tests to check out fuse

Update makefiles to have 'make test' and 'make check' use the
_nolibafs build version, since there are no tests that (currently)
require the AFS kernel module to be built.

Clean up fuse test copyright notice, Alphabetize configure.ac

Change-Id: Icc95dd3393cd66f0d04fa5f6e8f806db60ca031e
Reviewed-on: http://gerrit.openafs.org/8135
Reviewed-by: Troy Benjegerdes <hozer-gerrit@hozed.org>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoconfig: make makefile builder be a config tool also
Derrick Brashear [Wed, 3 Oct 2012 03:42:35 +0000]
config: make makefile builder be a config tool also

all of our helper tools should be configured in one place,
so a cross compile can override them

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

11 years agoafs: Use common cleanup code for lockctl EINVAL
Andrew Deason [Tue, 2 Oct 2012 20:04:47 +0000]
afs: Use common cleanup code for lockctl EINVAL

afs_lockctl has common cleanup code in the 'done' label. Use it here,
instead of trying to duplicate it.

Currently this code path appears to not be dropping the discon lock,
which this rectifies.

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

11 years agobos: convert struct bnode to use opr
Chas Williams (CONTRACTOR) [Mon, 1 Oct 2012 14:11:22 +0000]
bos: convert struct bnode to use opr

Convert struct bnode to use the common linked list code from opr.
bnode_Deactivate() was converted but is unused by the code and isn't
tested.

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

11 years agobos: convert struct bnode_proc to use opr
Chas Williams (CONTRACTOR) [Mon, 1 Oct 2012 14:10:22 +0000]
bos: convert struct bnode_proc to use opr

Convert struct bnode_proc to use the common linked list code from opr.

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

11 years agobos: convert struct bnode_type to use opr
Chas Williams (CONTRACTOR) [Mon, 1 Oct 2012 14:08:36 +0000]
bos: convert struct bnode_type to use opr

Convert struct bnode_type to use the common linked list code from opr.

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

11 years agobos: split part of bnode.p.h into bnode_internal.h
Chas Williams (CONTRACTOR) [Mon, 1 Oct 2012 13:59:09 +0000]
bos: split part of bnode.p.h into bnode_internal.h

Move the bosserver specific parts of bnode.p.h into bnode_internal.h
so that inclusion of bnode.h doesn't expose bosserver's internals.

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

11 years agogenerated target updates
Derrick Brashear [Mon, 1 Oct 2012 20:09:09 +0000]
generated target updates

tweak what's needed to build helper binaries for cross-compile

Change-Id: Ib476716e1e32444f0b2aeb8cb8a1e91ab49471de
Reviewed-on: http://gerrit.openafs.org/8173
Tested-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: File Info Query Symlinks
Jeffrey Altman [Mon, 1 Oct 2012 16:03:49 +0000]
Windows: File Info Query Symlinks

For Symlinks, always set the Reparse Point attribute and
set the Directory attribute if the target is a directory.
Do not return the file attributes of the target.

Change-Id: I72dcde912c998e1ab3eea45426d019314e10e740
Reviewed-on: http://gerrit.openafs.org/8171
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: Dir Enum behavior for Symlinks / MPs
Jeffrey Altman [Mon, 1 Oct 2012 15:04:23 +0000]
Windows: Dir Enum behavior for Symlinks / MPs

Comparisons of the behavior of cmd.exe, powershell.exe, and tcc.exe
with regards to directory enumeration show that when Symlink file
information is returned that the "reparse point" data should be
reported along with whether or not the target is a directory.

For mount points, the reparse point file information should always
be returned and the type should always be directory.

The target timestamps, file sizes, etc. should never be returned.

Change-Id: I0f899229061a282d0d218155407ffc4ab62ad377
Reviewed-on: http://gerrit.openafs.org/8170
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 afsredir process type check
Jeffrey Altman [Thu, 27 Sep 2012 02:03:03 +0000]
Windows: Move afsredir process type check

The process type check in afsredir.sys was performed during the
Process Creation callback which is processed in the context of the
parent process which might not be the same type (32-bit or 64-bit)
as the process being created.

Change-Id: I6ae79a6dacf434a986c7bb0135b2238fcfeeb0cd
Reviewed-on: http://gerrit.openafs.org/8165
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: Fix memory leak SRXAFSCB_GetCellServ
Jeffrey Altman [Tue, 25 Sep 2012 17:01:53 +0000]
Windows: Fix memory leak SRXAFSCB_GetCellServ

In commit 19f1e0f7cf40c3da1d49c789358bd814f7e3b3eb strdup()
was replaced by xdr_alloc() and memcpy().  Unfortunately,
the patch was wrong and the pointer to which the result of
xdr_alloc() was assigned was overwritten with zero.

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

11 years agoWindows: duplicate ExtentsResource hold
Jeffrey Altman [Tue, 25 Sep 2012 16:59:04 +0000]
Windows: duplicate ExtentsResource hold

All callers to AFSDoExtentsMapRegion() hold the ExtentsResource
so there is no need to obtain it again within the function.  Instead
add an ASSERT to confirm that the resource is held.

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

11 years agoWindows: make static RDR_ParseIoctlPath[Parent]
Jeffrey Altman [Tue, 25 Sep 2012 18:32:06 +0000]
Windows: make static RDR_ParseIoctlPath[Parent]

The RDR_ParseIoctlPath and RDR_ParseIoctlPathParent functions
are helper functions within RDRIoctl.cpp.   Make them static
and remove them from the header.

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

11 years agoWindows: remove reqp param RDR_IoctlWrite/Read
Jeffrey Altman [Tue, 25 Sep 2012 18:31:11 +0000]
Windows: remove reqp param RDR_IoctlWrite/Read

The RDR_IoctlWrite and RDR_IoctlRead functions no longer
use the cm_req_t parameter so remove it.

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

11 years agoWindows: add cm_req_t to RDR_ioctl_t
Jeffrey Altman [Tue, 25 Sep 2012 18:18:39 +0000]
Windows: add cm_req_t to RDR_ioctl_t

The cm_req_t structure flags store information related to
the source of the request and whether the process is WOW64 or not.
This information is required for proper pioctl processing.  Add
a cm_req_t structure to the RDR_ioctl_t structure and initialize
it in RDR_SetupIoctl() which is called from RDR_PioctlOpen().

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

11 years agoWindows: Add bWow64 param to RDR_InitReq
Jeffrey Altman [Tue, 25 Sep 2012 18:16:10 +0000]
Windows: Add bWow64 param to RDR_InitReq

Instead of using the pattern

  RDR_InitReq(&req);
  if (bWow64)
     req.flags |= CM_REQ_WOW64;

add bWow64 as a parameter to RDR_InitReq().

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

11 years agoWindows: cm_ExpandSysName for 64-bit processes
Jeffrey Altman [Sun, 23 Sep 2012 18:03:19 +0000]
Windows: cm_ExpandSysName for 64-bit processes

on 64-bit Windows, only 32-bit processes have the WOW64 request
type flag set.   Reverse the conditional to permit proper evaluation
of the 64-bit sysname list.

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

11 years agoRedHat: Avoid the DKMS escaping silliness
Andrew Deason [Tue, 25 Sep 2012 16:16:35 +0000]
RedHat: Avoid the DKMS escaping silliness

Depending on the version of DKMS, the current MAKE[0] variable in the
dkms.conf needs different numbers of backslashes. Commit 81a9a33e
tried to address this by changing the contents of dkms.conf depending
on whether or not we were on Fedora. However, the change occurred in
DKMS 2.2, so if someone running RHEL tries to use a newer DKMS, this
will fail.

So instead of trying to guess at the level of escaping we need, just
avoid needing to escape anything with backslashes. We can quote the
heredoc marker to avoid variable expansion inside the heredoc, we can
use a case statement instead of using backticks and local variables
and such, and we can use single quotes for the outer MAKE assignment.
With this, we should not need any backslashes when writing dkms.conf,
so we should work with any DKMS version.

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

11 years agoafs: casting NULL is generally unnecessary
Chas Williams (CONTRACTOR) [Mon, 24 Sep 2012 19:06:10 +0000]
afs: casting NULL is generally unnecessary

Casting NULL shouldn't be necessary in most cases.  Eliminate this
in favor of shorter lines and consistency.  Function pointers, variadic
arguments should still be cast.

Change-Id: Ibcd67378556e45c2b24f7aa85a4d73c72cd88e02
Reviewed-on: http://gerrit.openafs.org/8151
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 agoviced: Remove unused gettimeofday calls
Marc Dionne [Thu, 27 Sep 2012 01:37:33 +0000]
viced: Remove unused gettimeofday calls

StartTime and EndTime are set with gettimeofday(), but are not
used for any calcualtions or statistics, and appear to never have
been used.  There are platforms where gettimeofday is expensive,
so remove the variables and the calls.

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

11 years agoTESTS: Skip the volser tests if current hostname maps to the loopback network
Jason Edgecombe [Sun, 23 Sep 2012 01:07:51 +0000]
TESTS: Skip the volser tests if current hostname maps to the loopback network

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

11 years agoauth: token jar handling should realloc correctly
Derrick Brashear [Wed, 26 Sep 2012 11:37:11 +0000]
auth: token jar handling should realloc correctly

instead of reallocing n+1 tokens, we would realloc 1 token
plus N bytes

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

11 years agoafsio: add -clear and -crypt option
Chas Williams (CONTRACTOR) [Thu, 22 Mar 2012 00:59:19 +0000]
afsio: add -clear and -crypt option

Allow the user to optionally not use encryption (and also allow
user to ensure that encryption is being used).

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

11 years agoDOXYGEN: Move the protocol and architecture docs into their own modules
Jason Edgecombe [Mon, 17 Sep 2012 01:01:04 +0000]
DOXYGEN: Move the protocol and architecture docs into their own modules

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

11 years agoDOXYGEN: Add a simple index page
Jason Edgecombe [Mon, 17 Sep 2012 01:00:40 +0000]
DOXYGEN: Add a simple index page

Change-Id: I26dde9ae732841f04799f7b6ff79a994c450400b
Reviewed-on: http://gerrit.openafs.org/8129
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Export a few more functions to afsauthent and afsrpc
Marc Dionne [Tue, 25 Sep 2012 00:47:00 +0000]
Windows: Export a few more functions to afsauthent and afsrpc

The following exports are added:

libafsauthent:
    afsconf_SetExtendedCellInfo
    afsconf_PickClientSecObj
    afsconf_SawCell
    ka_PrintBytes
    ka_KeyIsZero

libafsrpc:
    initialize_RXK_error_table

Those functions are referenced by the bos code.

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

11 years agoTESTS: Add a library to check for the default loopback network
Jason Edgecombe [Sat, 22 Sep 2012 03:14:37 +0000]
TESTS: Add a library to check for the default loopback network

Change-Id: Id7bb92345e97309363fa5ddbff9147edf30ccd96
Reviewed-on: http://gerrit.openafs.org/8145
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 agobozo: fix typo in help text
Marc Dionne [Sat, 22 Sep 2012 00:08:58 +0000]
bozo: fix typo in help text

Fix a typo for "interface" in the help text for bosserver.

Change-Id: I042fc52e46f50dd00be9fc9bf62525a0f2755dda
Reviewed-on: http://gerrit.openafs.org/8144
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jason Edgecombe <jason@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>

11 years agoLINUX: Avoid 'wakeup' define
Andrew Deason [Mon, 24 Sep 2012 16:31:29 +0000]
LINUX: Avoid 'wakeup' define

Make 'wakeup' a static inline function instead of redefining 'wakeup',
so we can use the keyword 'wakeup' elsewhere.

Specifically, 'wakeup' is used in some Linux kernel structures, so
redefining it can confuse some things.

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