]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Apply upstream deltas to fix shutdown problems
authorRuss Allbery <rra@debian.org>
Fri, 27 Mar 2009 14:48:21 +0000 (07:48 -0700)
committerRuss Allbery <rra@debian.org>
Fri, 27 Mar 2009 14:48:21 +0000 (07:48 -0700)
* Apply upstream CVS deltas:
  - STABLE14-cbr-free-what-you-alloc-20090325: dequeue items in the same
    way they were allocated.
  - STABLE14-shutdown-vcache-avoid-null-deref-20090324: avoid oops on
    shutdown.  (LP: #333197)

debian/changelog
src/afs/afs_vcache.c

index 52b2f5a2a5d131935657a05ce3f093eb5185b24d..223cfb96093b71afa63a7cb10bb07496bf63d3ad 100644 (file)
@@ -1,3 +1,13 @@
+openafs (1.4.8.dfsg1-3) unstable; urgency=low
+
+  * Apply upstream CVS deltas:
+    - STABLE14-cbr-free-what-you-alloc-20090325: dequeue items in the same
+      way they were allocated.
+    - STABLE14-shutdown-vcache-avoid-null-deref-20090324: avoid oops on
+      shutdown.  (LP: #333197)
+
+ -- Russ Allbery <rra@debian.org>  Fri, 27 Mar 2009 07:48:11 -0700
+
 openafs (1.4.8.dfsg1-2) unstable; urgency=low
 
   * Make openafs-modules-source architecture-specific (arch: any instead
index 07e8701f906e5e50227120efd5ea69c9cb56fd5f..e369f9f3e8c8d7588fb2fa2297478e68b3a8f213 100644 (file)
@@ -313,6 +313,8 @@ afs_InactiveVCache(struct vcache *avc, struct AFS_UCRED *acred)
  * held, so we don't have to worry about blocking in osi_Alloc.
  */
 static struct afs_cbr *afs_cbrSpace = 0;
+/* if alloc limit below changes, fix me! */
+static struct afs_cbr *afs_cbrHeads[2];
 struct afs_cbr *
 afs_AllocCBR(void)
 {
@@ -334,6 +336,7 @@ afs_AllocCBR(void)
            }
            tsp[AFS_NCBRS - 1].next = 0;
            afs_cbrSpace = tsp;
+           afs_cbrHeads[afs_stats_cmperf.CallBackAlloced] = tsp;
            afs_stats_cmperf.CallBackAlloced++;
        }
     }
@@ -3022,7 +3025,7 @@ shutdown_vcache(void)
      */
 
     {
-       register struct afs_q *tq, *uq;
+       register struct afs_q *tq, *uq = NULL;
        register struct vcache *tvc;
        for (tq = VLRU.prev; tq != &VLRU; tq = uq) {
            tvc = QTOV(tq);
@@ -3077,7 +3080,8 @@ shutdown_vcache(void)
                    tvc->linkData = 0;
                }
 
-               afs_FreeAllAxs(&(tvc->Access));
+               if (tvc->Access)
+                   afs_FreeAllAxs(&(tvc->Access));
            }
            afs_vhashT[i] = 0;
        }
@@ -3085,8 +3089,9 @@ shutdown_vcache(void)
     /*
      * Free any leftover callback queue
      */
-    for (tsp = afs_cbrSpace; tsp; tsp = nsp) {
-       nsp = tsp->next;
+    for (i = 0; i < afs_stats_cmperf.CallBackAlloced; i++) {
+       tsp = afs_cbrHeads[i];
+       afs_cbrHeads[i] = 0;
        afs_osi_Free((char *)tsp, AFS_NCBRS * sizeof(struct afs_cbr));
     }
     afs_cbrSpace = 0;