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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This reverts commit 94bf003a72.
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>