From c078ee08ca31f8ac62c2d1b218590a12cbb56138 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Fri, 27 Mar 2009 07:48:21 -0700 Subject: [PATCH] Apply upstream deltas to fix shutdown problems * 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 | 10 ++++++++++ src/afs/afs_vcache.c | 13 +++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 52b2f5a2a..223cfb960 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 07e8701f9..e369f9f3e 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -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; -- 2.39.5