Windows: Do not remove scp from hash table on deletion
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 16 Aug 2013 16:01:55 +0000 (12:01 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 21 Aug 2013 03:27:25 +0000 (20:27 -0700)
If the CM_SCACHEFLAG_DELETED flag is going to have any benefit, the
cm_scache object must not be removed from the hash table in response
to a VNOVNODE error.  Otherwise, a new cm_scache object is allocated,
the CM_SCACHEFLAG_DELETED is not found, and a new callback request
is issued to the file server which in response returns VNOVNODE.

Do this enough times and the abort threshold is triggered and then
the application becomes very unhappy with performance.

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

src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_vnodeops.c

index 0f75e97..bb10393 100644 (file)
@@ -869,7 +869,6 @@ cm_Analyze(cm_conn_t *connp,
                _InterlockedOr(&scp->flags, CM_SCACHEFLAG_DELETED);
                lock_ObtainWrite(&cm_scacheLock);
                 cm_AdjustScacheLRU(scp);
-                cm_RemoveSCacheFromHashTable(scp);
                lock_ReleaseWrite(&cm_scacheLock);
                 cm_LockMarkSCacheLost(scp);
                lock_ReleaseWrite(&scp->rw);
index 62863ba..d204264 100644 (file)
@@ -1747,7 +1747,6 @@ long cm_Unlink(cm_scache_t *dscp, fschar_t *fnamep, clientchar_t * cnamep,
                _InterlockedOr(&scp->flags, CM_SCACHEFLAG_DELETED);
                lock_ObtainWrite(&cm_scacheLock);
                 cm_AdjustScacheLRU(scp);
-                cm_RemoveSCacheFromHashTable(scp);
                lock_ReleaseWrite(&cm_scacheLock);
             }
             cm_DiscardSCache(scp);
@@ -3754,7 +3753,6 @@ long cm_RemoveDir(cm_scache_t *dscp, fschar_t *fnamep, clientchar_t *cnamep, cm_
            _InterlockedOr(&scp->flags, CM_SCACHEFLAG_DELETED);
             lock_ObtainWrite(&cm_scacheLock);
             cm_AdjustScacheLRU(scp);
-            cm_RemoveSCacheFromHashTable(scp);
             lock_ReleaseWrite(&cm_scacheLock);
            lock_ReleaseWrite(&scp->rw);
             if (RDR_Initialized && !(reqp->flags & CM_REQ_SOURCE_REDIR))