git: f65d0b18d937 - main - stress2: Replace rename() with arc4random()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 11 Jun 2024 07:39:26 UTC
The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=f65d0b18d9372b522e247c7bd58422a7ab3d30d8 commit f65d0b18d9372b522e247c7bd58422a7ab3d30d8 Author: Peter Holm <pho@FreeBSD.org> AuthorDate: 2024-06-11 07:38:13 +0000 Commit: Peter Holm <pho@FreeBSD.org> CommitDate: 2024-06-11 07:38:13 +0000 stress2: Replace rename() with arc4random() --- tools/test/stress2/misc/nfsrename.sh | 4 ++-- tools/test/stress2/misc/umountf2.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/test/stress2/misc/nfsrename.sh b/tools/test/stress2/misc/nfsrename.sh index b6513fba1553..864c64aed8ac 100755 --- a/tools/test/stress2/misc/nfsrename.sh +++ b/tools/test/stress2/misc/nfsrename.sh @@ -137,7 +137,7 @@ write_file(void) unlink(path); } - fprintf(fp, "blah blah blah garbage %ld\n", random()); + fprintf(fp, "blah blah blah garbage %ld\n", (long)arc4random()); fclose(fp); if (rename(path, filename) < 0) { warn("rename"); @@ -150,7 +150,7 @@ random_sleep(int base, int slop) { long val; - val = random() % slop; + val = arc4random() % slop; usleep(base + val); } diff --git a/tools/test/stress2/misc/umountf2.sh b/tools/test/stress2/misc/umountf2.sh index 5018a804c403..cd5b53616f97 100755 --- a/tools/test/stress2/misc/umountf2.sh +++ b/tools/test/stress2/misc/umountf2.sh @@ -886,11 +886,12 @@ test(void) { unsigned long offset; unsigned long size = maxoplen; - unsigned long rv = random(); + unsigned long rv; unsigned long op = rv % (3 + !lite + mapped_writes); /* turn off the map read if necessary */ + arc4random_buf(&rv, sizeof(rv)); if (op == 2 && !mapped_reads) op = 0;