From: Andrew Deason Date: Tue, 27 Dec 2011 02:22:08 +0000 (-0500) Subject: afs: Grab a reference to setp in afs_icl_Event4 X-Git-Tag: upstream/1.8.0_pre1^2~2864 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7461fa11939556d3b6f3ea38da7ff65607805579;p=packages%2Fo%2Fopenafs.git afs: Grab a reference to setp in afs_icl_Event4 We can drop GLOCK in several places in afs_icl_Event4 and the afs_icl_AppendRecord callee. To ensure that the given afs_icl_set does not get freed while we have GLOCK dropped, grab a reference to the set. Thanks to Ryan C. Underwood for reporting an issue triggered by this. Change-Id: Ifeda229b444abd75b0f22c7acf18a7553d833964 Reviewed-on: http://gerrit.openafs.org/6431 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- diff --git a/src/afs/afs_icl.c b/src/afs/afs_icl.c index ece555302..5fdd7e503 100644 --- a/src/afs/afs_icl.c +++ b/src/afs/afs_icl.c @@ -407,6 +407,7 @@ afs_icl_Event4(struct afs_icl_set *setp, afs_int32 eventID, return 0; AFS_ASSERT_GLOCK(); + afs_icl_SetHold(setp); mask = lAndT >> 24 & 0xff; /* mask of which logs to log to */ ix = ICL_EVENTBYTE(eventID); ObtainReadLock(&setp->lock); @@ -422,6 +423,7 @@ afs_icl_Event4(struct afs_icl_set *setp, afs_int32 eventID, } } ReleaseReadLock(&setp->lock); + afs_icl_SetRele(setp); return 0; }