LICENSE MIT
avoid deadlock in buf_FlushCleanPages().
cannot obtain buffer mutex after a successful
Stabilize call because the scp will be be locked
and obtaining buffer mutex after scache mutex
is a lock order violation.
(cherry picked from commit 0546641c0da59289d03a9417984fe5f7e5636a75)
LICENSE MIT
Attempts to open files which are already write-locked by another
client took forever to return a lock not granted error. This
was because cm_Analyze() would retry the lock request for up to
the RDRtimeout in response to the EAGAIN error. The problem
was that cm_IntSetLock() was not setting the CM_REQ_NORETRY flag.
While examining this issue, discovered two other things:
(1) the infinite wait logic on lock request processing was broken
(2) the cancel outstanding lock request logic wasn't implemented
(3) cm_Analyze() would put the thread to sleep even when retries
were not permitted.
Also removed a number of compile time warnings.
(cherry picked from commit e9f7894e3576ef9e01234966f7869440f1823718)
LICENSE MIT
Add lock_convertRToW which permits a read-lock to be upgraded to a
write lock. If the caller is the only reader it permits a fast
transition otherwise it adds the caller to the waiters queue.
In the osi_Log macros, check to see if the log is enabled before making
the function call. This avoids significant function call overhead.
In the cache manager, make use of the above.
(cherry picked from commit 72687c02b6ee5ff3029937b0278733b252f14550)
LICENSE MIT
Remove race conditions in the statistics code by switching to
Interlocked functions.
Speed up cm_dnlcEnter() by searching first with a read lock and
then switching to a write lock if not found.
Add HKLM\SOFTWARE\OpenAFS\Client registry values "UseDNLC" and "Debug"DNLC".
I suspect with the B+tree code that the DNLC is unnecessary overhead but
leave it on by default for now.
(cherry picked from commit 107899cefaeebe693f8025e9c0d88784facd2236)
LICENSE IPL10
otherwise we can end up with stale addresses when a client uses then leaves an
address never to return
(cherry picked from commit 428cac5d6dfc287452af51c08eba0f0fca276864)
LICENSE MIT
For organizations with krb5 aware file servers but transarc or old openafs
vldb servers, add force anonymous vldb lookup option
HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters
DWORD "ForceAnonVLDB" (default is 0)
(cherry picked from commit dd72e06bf11fccd70cba32c4b6411a5e6ff3914c)
LICENSE IPL10
FIXES 87416
correctly set and unset HWHO_INPROGRESS as we pass through host probing package.
also, do not block on lock checking for HOSTDELETED. instead, return a null host
and VBUSY; restructure code to allow returning a null host with prejudice.
(cherry picked from commit f4f7ac048c52f859000a0d42640f0a6d43cc942a)
LICENSE MIT
Further testing on the 115KB AT&T Edge connection shows that 128KB
provides reasonably robust performance with six simultaneous copies of
multi-MB files to AFS.
(cherry picked from commit 704fddccd0f714c848b37ccee427f8eeded53bd6)
LICENSE MIT
Add two new configuration knobs to control the behavior of smb_WriteData.
HKLM\SOFTWARE\OpenAFS\Client
DWORD EnableSMBAsyncStore (default: 1)
DWORD SMBAsyncStoreSize (default: 32K)
Instead of tying the async store size to either the chunksize (too large)
or the buffer block size (too small) provide an intermediate value that
can be independently controlled.
In the future it would be desireable for the async store size to be
dynamically determined based upon measurable characteristics of the
network. In the meantime, 32KB is an acceptable performance compromise
that should work well on 1Gbit networks and low-speed cellular networks.
(cherry picked from commit f95915a55ae579bab4052f24f6fedca21d114567)
LICENSE MIT
An implementation of Asanka's idea.
Avoid the need to update the data version number on each buffer associated
with a scache when MergeStatus is called after a StoreData by maintaining
a range of valid data versions as part of the cm_scache_t object.
(cherry picked from commit 9e41258fad54e3122a0722b3f1c24810590c8d0a)
LICENSE MIT
profiling shows large numbers of blocked calls in cm_HoldSCache
from cm_HaveAccess... We can safely avoid the call so do so.
(cherry picked from commit 812ac61cfd3601abb1373f6d3f9e4d52c2ff61b9)
LICENSE MIT
Do not leak a read lock on the bufCreateLock
Add logging to cm_CheckNTOpen[Done]
(cherry picked from commit 8bddb4892bb815076861507f8ae781ae2c3f3310)
LICENSE MIT
Improve parallelism by using InterlockedIncrement and InterlockedDecrement
to adjust the refCount fields of cm_buf_t and cm_scache_t objects. This
permits read locks to be used for increments and decrements but requires
a write-lock to perform any actions based upon the refCount hitting zero.
Inline cm_FidCmp to further improve performance.
Remove unused variables.
(cherry picked from commit 12c6cfd4435c5a491e613e6394fabeeed4d81447)
LICENSE MIT
1. Change RxEnableHotThread default to 'on'
2. Add a 'hash' value to the cm_fid_t structure in order to speed up cm_FidCmp().
Add cm_SetFid() for use in constructing a fid complete with the hash.
3. Redefine the BUF_HASH and BUF_FILEHASH in terms of the cm_fid_t hash which
has a better distribution
4. Modify cm_ConsiderPrefetch to evaluate the amount of data in the most recent
read request instead of the next chunkSize. cm_chunkSize can be dozens or
hundreds of buffers. As a result too much time is spent performing the
evaluation.
5. Fix the usage of cm_scache_t bufCreateLock. The purpose of this lock is
to prevent the creation of new buffers while a truncation is being performed.
All references to bufCreateLock have been removed except in two places:
i. a write-lock surrounding the function that calls buf_Truncate()
ii. a read-lock within buf_GetNewLocked() that actually allocates new
buffers
6. Modify the CM_CONFIG_DATA_MAGIC value to include a CM_CONFIG_DATA_VERSION
number which value be used to force the replacement of the cache file
contents when incompatible changes are made between releases.
7. CM_SCACHESYNC_ASYNCSTORE should not be ordered by cm_SyncOpCheckContinue
8. Avoid calls to multi_Rx if nconns == 0
9. Modify smb_WriteData to perform background writes based upon the crossing
of buf_blockSize boundaries instead of cm_chunkSize boundaries. This will
slow down writes from the SMB interface but will avoid the risk of
the CIFS client disconnecting from the AFS client SMB server.
(cherry picked from commit dcef8fa4adc4c2cdc166494979d77d91c40c1f06)
LICENSE IPL10
critical to label the database invalid when we don't truncate so recovery finishes.
issue in 84609 remains.
(cherry picked from commit d5c32c97a01f02cd69e2167964b43d83c6d413fb)
LICENSE MIT
Add RxEnableHotThread registry option to permit rx_enable_hot_thread
to be set. The default is off for the moment but turning it on does
provide significant performance benefits.
(cherry picked from commit dd4ecb4ca0467d9f5727de1bfe9082f195330b99)
LICENSE MIT
The portable type to be used for sockets is osi_socket not int.
On 64-bit Windows this caused failures when hot threads were enabled.
(cherry picked from commit 5067e6786dc93b8760edf6b1b9d92c3999caea7e)
LICENSE IPL10
my code, though, this is a result of a problem reported by Chaskiel Grundman and analysis by him, Jeff Altman and myself.
I'm just checking in my implementation. In any case, the issue this addresses
is one where we can end up in makecall_waiting in rx on multiple connections
when we multibreakcallback because the lists are sorted differently and each has "pending" calls on a different connection. by sorting by index we will not
block on another caller while also holding what they're after
(cherry picked from commit 7421feda944d5fa05f5223528a69f23a7bb0b724)
LICENSE MIT
The RXKADBADTICKET error is returned when a krb5 derived token is sent
to a server that does not support them. In a mixed cell it is possible
that some servers were not updated. Discarding the token does not make
it possible to perform the request successfully and adversely affects
the user experience because those servers that do support the token
can no longer be accessed in an authenticated manner. Users can't
determine what the cause is, all they see are their tokens disappearing
and there is nothing they can do about it anyway.
From now on return STATUS_NO_KERB_KEY and do not retry.
(cherry picked from commit 7a290f39ec303cb3473f63f7d9c634e767191279)
LICENSE IPL10
Do not grab the peer mutex or the rpc stats mutex if we are not
intending to collect stats. Doing so is a bottleneck.
(cherry picked from commit 5fd85f53f26ba1f0649b8a8c68d3abb1c5159eb9)
LICENSE MIT
if we are going to insert the full ccache name then we must search by
it as well.
(cherry picked from commit f5645ccffe05f2c1b44d5ba1adb32ba45e26aae8)
LICENSE MIT
add srvsvc and wkssvc to reserved names in smb_ShareParse.
include slash in ipc$ reference in dfs referrals check.
(cherry picked from commit 72da5c434c8caef0cb81523091915738e7e930ed)
LICENSE MIT
A sample template for constructing Network Identity Manager OpenAFS
Provider Extensions for obtaining and identifying new token types.
(cherry picked from commit 55aa6f04dcfebae134b3459944e005599d06ef05)
LICENSE MIT
Upon receiving a VNOVNODE error from a file server, be sure to
invalidate any file locks. This prevents on-going attempts to
extend the locks and will cause subsequent attempts to access
the file to receive a invalid handle error.
(cherry picked from commit 38c2524bd16f1e535ea28f9d0788b7eaa8d26c3d)
LICENSE MIT
All calls to buf_Get() must be protected by a read lock on the
cm_scache_t bufCreateLock
When a MergeStatus results in the invalidation of buffers, do
not remove buffers from the hash tables that have active references.
(cherry picked from commit 33bed6296114e16914cecf312c762774d44386c8)
LICENSE MIT
when checking offline volumes, update the cell vlserver info
if required and don't perform a check if there are no servers
in the list.
(cherry picked from commit 935c49a2a6efa476c327e8a24fc4895f0c8f623d)