git: cb53f83d8ad8 - main - Revert "stress2: Replace rename() with arc4random()"

From: Peter Holm <pho_at_FreeBSD.org>
Date: Tue, 11 Jun 2024 13:52:17 UTC
The branch main has been updated by pho:

URL: https://cgit.FreeBSD.org/src/commit/?id=cb53f83d8ad8ee6fd9778c38b30e71244254e5bb

commit cb53f83d8ad8ee6fd9778c38b30e71244254e5bb
Author:     Peter Holm <pho@FreeBSD.org>
AuthorDate: 2024-06-11 13:51:21 +0000
Commit:     Peter Holm <pho@FreeBSD.org>
CommitDate: 2024-06-11 13:51:21 +0000

    Revert "stress2: Replace rename() with arc4random()"
    
    This reverts commit f65d0b18d9372b522e247c7bd58422a7ab3d30d8.
    
    Misleading commit message
---
 tools/test/stress2/misc/nfsrename.sh | 4 ++--
 tools/test/stress2/misc/umountf2.sh  | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/test/stress2/misc/nfsrename.sh b/tools/test/stress2/misc/nfsrename.sh
index 864c64aed8ac..b6513fba1553 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", (long)arc4random());
+	fprintf(fp, "blah blah blah garbage %ld\n", random());
 	fclose(fp);
 	if (rename(path, filename) < 0) {
 		warn("rename");
@@ -150,7 +150,7 @@ random_sleep(int base, int slop)
 {
 	long val;
 
-	val = arc4random() % slop;
+	val = random() % slop;
 	usleep(base + val);
 }
 
diff --git a/tools/test/stress2/misc/umountf2.sh b/tools/test/stress2/misc/umountf2.sh
index cd5b53616f97..5018a804c403 100755
--- a/tools/test/stress2/misc/umountf2.sh
+++ b/tools/test/stress2/misc/umountf2.sh
@@ -886,12 +886,11 @@ test(void)
 {
 	unsigned long	offset;
 	unsigned long	size = maxoplen;
-	unsigned long	rv;
+	unsigned long	rv = random();
 	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;