From 781f55d5a7fefa92de1782907afa2be52e738b0c Mon Sep 17 00:00:00 2001 From: David Howells Date: Tue, 4 May 2010 14:16:10 +0100 Subject: [PATCH] --- yaml --- r: 190563 b: refs/heads/master c: cf8304e8f380903de3a15dc6ebd551c9e6cf1a21 h: refs/heads/master i: 190561: d6e9266d15627be4173896c5851525ff9710a3d6 190559: 343220709a45f30635393001ad9084891ee1e88a v: v3 --- [refs] | 2 +- trunk/security/keys/gc.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 89bbbfa7ebe8..89cd7a43b9d7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d9a9b4aeea334e7912ce3d878d7f5cc6fdf1ffe4 +refs/heads/master: cf8304e8f380903de3a15dc6ebd551c9e6cf1a21 diff --git a/trunk/security/keys/gc.c b/trunk/security/keys/gc.c index 19902319d097..a46e825cbf02 100644 --- a/trunk/security/keys/gc.c +++ b/trunk/security/keys/gc.c @@ -77,10 +77,10 @@ static bool key_gc_keyring(struct key *keyring, time_t limit) goto dont_gc; /* scan the keyring looking for dead keys */ - klist = rcu_dereference_check(keyring->payload.subscriptions, - lockdep_is_held(&key_serial_lock)); + rcu_read_lock(); + klist = rcu_dereference(keyring->payload.subscriptions); if (!klist) - goto dont_gc; + goto unlock_dont_gc; for (loop = klist->nkeys - 1; loop >= 0; loop--) { key = klist->keys[loop]; @@ -89,11 +89,14 @@ static bool key_gc_keyring(struct key *keyring, time_t limit) goto do_gc; } +unlock_dont_gc: + rcu_read_unlock(); dont_gc: kleave(" = false"); return false; do_gc: + rcu_read_unlock(); key_gc_cursor = keyring->serial; key_get(keyring); spin_unlock(&key_serial_lock);