summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGreg Price <price@MIT.EDU>2013-11-30 01:09:37 (GMT)
committerTheodore Ts'o <tytso@mit.edu>2014-03-20 02:18:51 (GMT)
commita58aa4edc6d2e779894b1fa95a2f4de157ff3b3b (patch)
tree9ae4c66ee56c768cdc6370a879154acbccb10133 /drivers
parentee1de406ba6eb1e01f143fe3351e70cc772cc63e (diff)
downloadlinux-a58aa4edc6d2e779894b1fa95a2f4de157ff3b3b.tar.xz
random: forget lock in lockless accounting
The only mutable data accessed here is ->entropy_count, but since 10b3a32d2 ("random: fix accounting race condition") we use cmpxchg to protect our accesses to ->entropy_count here. Drop the use of the lock. Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Price <price@mit.edu> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/random.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 9675821..694510af 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -970,9 +970,6 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
int entropy_count, orig;
size_t ibytes;
- /* Hold lock while accounting */
- spin_lock_irqsave(&r->lock, flags);
-
BUG_ON(r->entropy_count > r->poolinfo->poolfracbits);
/* Can we pull enough? */
@@ -995,7 +992,6 @@ retry:
< random_write_wakeup_thresh)
wakeup_write = 1;
}
- spin_unlock_irqrestore(&r->lock, flags);
trace_debit_entropy(r->name, 8 * ibytes);
if (wakeup_write) {