From 6a2ac1e2d41b30dfd466e001f3a545bda4bc8da8 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Wed, 27 Sep 2006 21:01:10 +0000 Subject: [PATCH] keyring-gcpags-20060927 FIXES 40659 do gcpags for keyrings without needing tasklist_lock --- src/afs/LINUX/osi_groups.c | 14 ++++++++++++++ src/afs/afs_osi_gcpags.c | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index c4a0514dd5..a754cb60f8 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -554,12 +554,26 @@ static int afs_pag_match(const struct key *key, const void *description) return strcmp(key->description, description) == 0; } +static void afs_pag_destroy(struct key *key) +{ + afs_uint32 pag = key->payload.value; + struct unixuser *pu; + + pu = afs_FindUser(pag, -1, READ_LOCK); + if (pu) { + pu->ct.EndTimestamp = 0; + pu->tokenTime = 0; + afs_PutUser(pu, READ_LOCK); + } +} + struct key_type key_type_afs_pag = { .name = "afs_pag", .describe = afs_pag_describe, .instantiate = afs_pag_instantiate, .match = afs_pag_match, + .destroy = afs_pag_destroy, }; void osi_keyring_init(void) diff --git a/src/afs/afs_osi_gcpags.c b/src/afs/afs_osi_gcpags.c index c5df931108..cd54fdfd97 100644 --- a/src/afs/afs_osi_gcpags.c +++ b/src/afs/afs_osi_gcpags.c @@ -226,11 +226,13 @@ afs_osi_TraverseProcTable(void) #endif #if defined(AFS_LINUX22_ENV) -extern rwlock_t tasklist_lock __attribute__((weak)); void afs_osi_TraverseProcTable() { +#if !defined(LINUX_KEYRING_SUPPORT) + extern rwlock_t tasklist_lock __attribute__((weak)); struct task_struct *p; + if (&tasklist_lock) read_lock(&tasklist_lock); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) @@ -267,6 +269,7 @@ afs_osi_TraverseProcTable() else rcu_read_unlock(); #endif +#endif } #endif