Commit Graph

10923 Commits

Author SHA1 Message Date
Simon Wilkinson
0c9e55639c rx: Remove unreachable debug statement
ReceivePacket has a dpf which is conditional on the packet having a
zero callnumber. However, just before we reach this debug statement,
we always return if the header doesn't have a call number included.

So, the debug statement can never run. Just remove it, as it's
potentially confusing.

Change-Id: I5fad9f39c9a0c4aac50853aaf4f853b9f7715e61
Reviewed-on: http://gerrit.openafs.org/8295
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-29 13:33:09 -07:00
Simon Wilkinson
8e118de45c rx: Always provide rxi_WaitForTQBusy
Move the prototype for rxi_WaitForTQBusy to rx_internal.h, and always
provide it (as a prototype for RX_ENABLE_LOCKS, and as a no-op for lwp).

Remove all of the #ifdef RX_ENABLE_LOCKS around rxi_WaitForTQBusy calls.

Change-Id: I6c2b943d6d06bf19d3cb4495201d278e3900b6ef
Reviewed-on: http://gerrit.openafs.org/8294
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-29 13:32:20 -07:00
Jeffrey Altman
7e8278e144 Windows: Set Server Prefs recalc immediately
When processing the set server preferences pioctl call cm_RankServer()
to update the server preference value reported by "getserverprefs"
in addition to cm_ChangeRankVolume() or cm_ChangeRankCellVLServer().

Change-Id: Iacd8d30865286c39a7cc02e2f659b8c684f8f4a4
Reviewed-on: http://gerrit.openafs.org/8328
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-10-29 12:36:36 -07:00
Jeffrey Altman
e59cf940ce Windows: mark server reference offline for VOFFLINE
cm_Analyze() was not marking the cm_ServerRef_t reference to
a volume instance as srv_offline in response to a VOFFLINE error.
As a result the same volume instance is tried again and again.

Change-Id: Ic467f41e96408281e6251a796d2dfba3245bb023
Reviewed-on: http://gerrit.openafs.org/8326
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-10-29 11:23:22 -07:00
Jeffrey Altman
c7061310b7 Revert "Windows: Media Protected if create on RO volume"
This reverts commit f3f282265a.

Returning STATUS_MEDIA_WRITE_PROTECTED in preference to
STATUS_OBJECT_NAME_COLLISION when the file results in silent
failures by some applications (ie, Firefox.exe) when the
first directory in the path below the share name is the
root of a .readonly volume.

FIXES 131416

Change-Id: I342d9ff09ef68615371cf9d372f38fac854ed6c0
Reviewed-on: http://gerrit.openafs.org/8325
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2012-10-29 11:23:07 -07:00
Simon Wilkinson
4bc8d82d9a rx: MUTEX_* are no-ops when !RX_ENABLE_LOCKS
Remove any occurences of
    # ifdef RX_ENABLE_LOCKS
    MUTEX_ENTER(&mutex)
    # endif

and similar for MUTEX_INIT, MUTEX_DESTROY and MUTEX_EXIT, as all of
these operations are no-ops when RX_ENABLE_LOCKS isn't defined.

Change-Id: Ic0f27b42d56ae4362ff095f1f08a06575c4ca2c1
Reviewed-on: http://gerrit.openafs.org/8293
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-29 09:45:36 -07:00
Simon Wilkinson
f224849f29 rx: Get rid of AFS_GLOBAL_RXLOCK_KERNEL
Get rid of the AFS_GLOBAL_RXLOCK_KERNEL #define. RX used to have a
single global lock locking mode, but none of our kernel modules use
it any more. In fact, AFS_GLOBAL_RXLOCK_KERNEL is now only defined
when RX_ENABLE_LOCKS is also defined. Simplify the code by renaming
all of the occurrences of AFS_GLOBAL_RXLOCK_KERNEL as RX_ENABLE_LOCKS,
and remove any cases where we're now doing unecessary tests

Change-Id: I061d8d364c61168370b223cdac48ad161f0c9d74
Reviewed-on: http://gerrit.openafs.org/8292
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-29 09:45:13 -07:00
Simon Wilkinson
9358e452a9 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>
2012-10-29 09:14:12 -07:00
Simon Wilkinson
e93b6dca2f 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>
2012-10-29 09:12:04 -07:00
Simon Wilkinson
c00c0effd1 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>
2012-10-29 09:10:44 -07:00
Simon Wilkinson
6f8da199e5 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>
2012-10-29 09:09:21 -07:00
Simon Wilkinson
ada1fc2567 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>
2012-10-29 09:08:06 -07:00
Jeffrey Altman
c584b68213 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>
2012-10-28 09:24:16 -07:00
Jeffrey Altman
e9e5978a4d 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>
2012-10-28 09:23:56 -07:00
Jeffrey Altman
f714841896 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>
2012-10-28 09:23:45 -07:00
Jeffrey Altman
5857dd36b2 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>
2012-10-27 18:58:10 -07:00
Jeffrey Altman
fd7a16d5b0 Windows: PrimaryVolumeWorker ObjectInfoLock deadlock
Patchset eaad522651 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>
2012-10-27 18:55:50 -07:00
Jeffrey Altman
08d4464248 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>
2012-10-27 18:54:51 -07:00
Jeffrey Altman
3a996b58de 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>
2012-10-27 18:53:03 -07:00
Jeffrey Altman
ea2f25372c 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>
2012-10-27 18:51:48 -07:00
Jeffrey Altman
c33c678760 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>
2012-10-27 18:51:05 -07:00
Jeffrey Altman
3c57bab34e 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>
2012-10-27 18:49:57 -07:00
Jeffrey Altman
651cceabc3 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>
2012-10-27 18:48:46 -07:00
Jeffrey Altman
f869b6f8c1 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>
2012-10-27 18:44:38 -07:00
Simon Wilkinson
89c200c565 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>
2012-10-23 04:54:11 -07:00
Hartmut Reuter
dc0441d0a2 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>
2012-10-22 23:54:41 -07:00
Marc Dionne
eca04c7e52 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>
2012-10-20 11:39:47 -07:00
Magnus Ahltorp
a550d64f8e 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>
2012-10-20 02:36:20 -07:00
Marc Dionne
115850076c 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>
2012-10-20 02:36:03 -07:00
Jeffrey Altman
0b538f21be 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>
2012-10-19 08:51:01 -07:00
Jeffrey Altman
2bfe3653e3 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>
2012-10-19 08:50:19 -07:00
Jeffrey Altman
dfcb68cdc8 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>
2012-10-19 08:48:56 -07:00
Jeffrey Altman
555412a03f 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>
2012-10-19 07:19:22 -07:00
Jeffrey Altman
05fa1202fb 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>
2012-10-19 07:03:31 -07:00
Jeffrey Altman
9eb4bcfced 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>
2012-10-19 07:02:25 -07:00
Jeffrey Altman
eaad522651 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>
2012-10-19 07:01:56 -07:00
Jeffrey Altman
cecd99abd3 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>
2012-10-19 05:55:20 -07:00
Jeffrey Altman
8827be7084 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>
2012-10-19 05:47:34 -07:00
Jeffrey Altman
23c9200669 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>
2012-10-19 05:41:34 -07:00
Hartmut Reuter
edef37033c 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>
2012-10-19 05:07:13 -07:00
Hartmut Reuter
f821c7e5c8 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>
2012-10-19 05:06:55 -07:00
Hartmut Reuter
df8709012b 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>
2012-10-19 03:32:34 -07:00
Hartmut Reuter
5bd05894dd 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>
2012-10-19 03:32:22 -07:00
Jeffrey Altman
f6ab5cc8bd 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>
2012-10-19 02:50:06 -07:00
Jeffrey Altman
fe28a0c596 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>
2012-10-19 02:49:27 -07:00
Jeffrey Altman
7b1115d470 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>
2012-10-19 02:47:34 -07:00
Jeffrey Altman
7fd9890162 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>
2012-10-19 02:46:55 -07:00
Jeffrey Altman
ae10a40c5c 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>
2012-10-19 02:43:57 -07:00
Jeffrey Altman
1335eefeff 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>
2012-10-19 02:43:40 -07:00
Jeffrey Altman
816776215d 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>
2012-10-19 02:42:58 -07:00