keyring-pag-finduser-requires-glock-20070320

identical to the fix from chas@cmf.nrl.navy.mil
This commit is contained in:
Chaskiel M Grundman 2007-03-20 18:41:02 +00:00 committed by Derrick Brashear
parent c4183dbc1f
commit 97d8703809

View File

@ -594,13 +594,18 @@ static void afs_pag_destroy(struct key *key)
{ {
afs_uint32 pag = key->payload.value; afs_uint32 pag = key->payload.value;
struct unixuser *pu; struct unixuser *pu;
int locked = ISAFS_GLOCK();
if (!locked)
AFS_GLOCK();
pu = afs_FindUser(pag, -1, READ_LOCK); pu = afs_FindUser(pag, -1, READ_LOCK);
if (pu) { if (pu) {
pu->ct.EndTimestamp = 0; pu->ct.EndTimestamp = 0;
pu->tokenTime = 0; pu->tokenTime = 0;
afs_PutUser(pu, READ_LOCK); afs_PutUser(pu, READ_LOCK);
} }
if (!locked)
AFS_GUNLOCK();
} }
struct key_type key_type_afs_pag = struct key_type key_type_afs_pag =