]> git.baikalelectronics.ru Git - kernel.git/commit
random: only wake up writers after zap if threshold was passed
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 22 Feb 2022 13:01:57 +0000 (14:01 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 24 Feb 2022 15:32:35 +0000 (16:32 +0100)
commit96f0758c32221d85112986eb34ac928a8aa528fb
treefff59506c16c2deeda60cca2e8a4c76b97cd9dd9
parenta328145a0c2c3d7a9b2f1c146e793233e476e49a
random: only wake up writers after zap if threshold was passed

The only time that we need to wake up /dev/random writers on
RNDCLEARPOOL/RNDZAPPOOL is when we're changing from a value that is
greater than or equal to POOL_MIN_BITS to zero, because if we're
changing from below POOL_MIN_BITS to zero, the writers are already
unblocked.

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c