]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: add lock assertions to cm_buf.c
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 16 May 2011 01:53:56 +0000 (21:53 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 18 May 2011 13:43:44 +0000 (06:43 -0700)
add lock assertions to cm_buf.c in hopes of detecting why
periodic buf_scacheHashTable corruption is being detected.

Change-Id: I247ad7090a9484ae76b2e56f6f53ef8ee5af1abc
Reviewed-on: http://gerrit.openafs.org/4659
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
src/WINNT/afsd/cm_buf.c

index e871f2e273edaa8ec9eefead07cd8d93d7165336..e62a20b152c201681f5943691283c69c2a7d2e9d 100644 (file)
@@ -658,6 +658,8 @@ cm_buf_t *buf_FindLocked(struct cm_scache *scp, osi_hyper_t *offsetp)
     afs_uint32 i;
     cm_buf_t *bp;
 
+    lock_AssertAny(&buf_globalLock);
+
     i = BUF_HASH(&scp->fid, offsetp);
     for(bp = cm_data.buf_scacheHashTablepp[i]; bp; bp=bp->hashp) {
         if (cm_FidCmp(&scp->fid, &bp->fid) == 0
@@ -1068,6 +1070,8 @@ long buf_GetNewLocked(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *req
              * appropriate label, if requested.
              */
             if (scp) {
+                lock_AssertWrite(&buf_globalLock);
+
                 bp->qFlags |= CM_BUF_QINHASH;
                 bp->fid = scp->fid;
 #ifdef DEBUG