]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs: Grab a reference to setp in afs_icl_Event4
authorAndrew Deason <adeason@sinenomine.net>
Tue, 27 Dec 2011 02:22:08 +0000 (21:22 -0500)
committerDerrick Brashear <shadow@dementix.org>
Sat, 7 Jan 2012 14:22:04 +0000 (06:22 -0800)
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.

Reviewed-on: http://gerrit.openafs.org/6431
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 7461fa11939556d3b6f3ea38da7ff65607805579)

Change-Id: I7a33cf96d2031dd1798f7598918396eb8fbde611
Reviewed-on: http://gerrit.openafs.org/6494
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afs/afs_icl.c

index 7c3d175956bfcffa322c06db8fcbfdb9c8b496e7..7b99e904eb9ae6356859e7f568feec8ef5cfd52a 100644 (file)
@@ -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;
 }