FIXES 42312
iafs_InactiveVCache() calls afs_InvalidateAllSegments() which says
it should be called with the vnode locked. so the lock should
probably be moved to afs_InactiveVCache() so it can be droppped
before calling afs_remunlink().
(cherry picked from commit ac52e2f3c0bec9298d020de963036409165f380e)
prevent a stack overflow if the afsd_service does not successfully
start after a request to do so is issued.
(cherry picked from commit 3c13e5f0c0423d5e724ab224af22d7d3606ef1b0)
add debugging code that can be activated with #define DEBUG_REFCOUNT
to assist in debugging scache refcount leaks
(cherry picked from commit 8919e0d5175dae85991a3782f659621c5be4056f)
reformat some code; make sure that pointers are copied while
mutexes are held; ...
(cherry picked from commit b4007635064f08d4d0f019acc9888f0d4005708c)
#ifdef DEBUG_REFCOUNT the ref count log entries so they aren't always
compiled in
comment out the remaining location where the write lock on cm_scacheLock
is dropped in order to obtain the scache mutex on the object returned
from cm_GetNewSCache(). Dropping the lock results in more than one
thread being given the same cm_scache_t which is more dangerous than
blowing away the contents of the object without holding the mutex
ensure that cm_BufWrite is always called with a non-NULL scp. Add
an assertion to double check that we do it all the time.
(cherry picked from commit ffe26eb18da581d2df02f9531d97e31e1c6dee65)
replace all DebugBreak() calls with osi_panic.
remove calls to cm_RecycleSCache from VNOVNODE handler as its not
lock safe to drop and re-obtain locks to adhere to the locking
hierarchy
restore reference to CM_SCACHESYNC_STOREDATA that should
not have been removed.
remove attempts to adhere to locking hierarching from cm_GetNewSCache.
dropping the cm_scacheLock is too dangerous
add a check to ensure that the scache refcount is not zero if there
is a valid smb_fid_t pointing to it.
more debug logging
(cherry picked from commit b7117f61036c63238eb926c6eb71d42a56766501)
still tracking down issues when large numbers of temporary files
are created and deleted in the same directory from multiple
machines.
VNOVNODE must return CM_ERROR_BADFD
ensure that all calls to cm_GetCallback are made from cm_SyncOp.
add CM_SCACHESYNC_FORCECB logic to cm_SyncOp so that it can be
removed from cm_GetAccess
don't mix CM_SCACHESYNC_NEEDCALLBACK with CM_SCACHESYNC_STOREDATA
or CM_SCACHESYNC_FETCHDATA
(cherry picked from commit 4cd9eee0155edba89b77779af9aea4f1aa55cd96)
more cleanup from recent patches. comment out the recycling code because
it is not possible to implement it using the current locking hierarchy.
change cm_BufWrite to take a pointer to cm_scache_t instead of a fid
which must be used to look up a new reference to the cm_scache_t.
more often than not we already have the scp and in the one case we
don't we can let the caller look up the scp and then call cm_BufWrite
if it is found. If not, we have saved a function call and a bunch
of lock operations.
add a lot more logging.
improve the scp mutex handling within smb_CloseFID
(cherry picked from commit 38d464e5791dbd96d6da85a0c0123f8b575f4e39)
misc cleanups
hold scp->mx while recycling
add FILE_NOTIFY_CHANGE_CREATION to the notification mask when adding
or deleting files
(cherry picked from commit de6a01e51d8ea97e943cb4fa93d6bba2ecae9644)
Don't call cm_GetCallback without checking the current callback status
with cm_HaveCallback first
(cherry picked from commit 665a125335c4844d35fa6510a38083602ef7fdbc)
Fix the following problems:
it is possible for a file to be created, buffers to become dirty from
writes, the file to be deleted, the stat cache entry to be reused, and
the dirty buffers to remain dirty until the end of time.
stat cache entry starvation can occur because of large numbers of dirty
buffers which take too long to be written to the file server. The
thread that writes dirty buffers in background writes/checks a small
number of buffers, SQRT(buf-count), and then sleeps for 5 seconds.
Writing all of the dirty buffers via this algorithm produces untimely
results.
threads can end up waiting for a callback on the same stat cache entry
even though there are no threads actually attempting to perform the
FetchStatus.
And:
Fix prototypes
Optimize cm_GetNewSCache to reuse scache entries for deleted files
and entries not in the hashtable before allocating a new one. This
keeps the entries in the hashtable to a minimum and thereby improving
performance for all other operations which must lookup a scache entry
by FID.
Add support for Sequential and Random Access flags
(cherry picked from commit 8da04000ec70e7eebe8bb18d317bb6b348b91449)
try tasklist_lock weak binding in osi_probe
if no tasklist_lock, fall back to rcu locking
(cherry picked from commit 928ad0445e91ecbfcd32a26e8c17b90ee0d83700)
FIXES 40568
this has been broken a while, we just noticed it because of prototypes
(cherry picked from commit 955a58a5a850da4caeba9b45b0e8ff27a143b725)
avoid dealing so well with damaged namei volumes that we assume a temporary clone is damaged
(cherry picked from commit 1221e482d786a56ca52568ed29a9c981e674ad7a)
FIXES 40291
Disable DNS Registrations for the Loopback Adapter and make sure
that Netbios is turned on.
(cherry picked from commit 3e28a968e0b916c176b978da2807a7e4857faa18)