mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Force ztest to always use /dev/urandom
For ztest, which is solely for testing, using a pseudo random is entirely reasonable. Using /dev/urandom ensures the system entropy pool doesn't get depleted thus stalling the testing. This is a particular problem when testing in VMs. Reviewed-by: Tim Chase <tim@chase2k.com> Reviewed by: Thomas Caputi <tcaputi@datto.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #7017 Closes #7036
This commit is contained in:
@@ -907,13 +907,15 @@ lowbit64(uint64_t i)
|
||||
return (__builtin_ffsll(i));
|
||||
}
|
||||
|
||||
char *random_path = "/dev/random";
|
||||
char *urandom_path = "/dev/urandom";
|
||||
static int random_fd = -1, urandom_fd = -1;
|
||||
|
||||
void
|
||||
random_init(void)
|
||||
{
|
||||
VERIFY((random_fd = open("/dev/random", O_RDONLY)) != -1);
|
||||
VERIFY((urandom_fd = open("/dev/urandom", O_RDONLY)) != -1);
|
||||
VERIFY((random_fd = open(random_path, O_RDONLY)) != -1);
|
||||
VERIFY((urandom_fd = open(urandom_path, O_RDONLY)) != -1);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user