aboutsummaryrefslogtreecommitdiff
path: root/tools/test/stress2/misc/rename18.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/stress2/misc/rename18.sh')
-rwxr-xr-xtools/test/stress2/misc/rename18.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/test/stress2/misc/rename18.sh b/tools/test/stress2/misc/rename18.sh
new file mode 100755
index 000000000000..f71e29bb1bef
--- /dev/null
+++ b/tools/test/stress2/misc/rename18.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Test scenario from:
+# Bug 295826 - kern_renameat() infinite loop
+
+set -u
+root=/root
+cd $root
+mkdir -p $root/test_loop/a
+mkdir -p $root/test_loop/b
+echo '123' > $root/test_loop/b/file
+touch $root/test_loop/a/file
+mount_nullfs -o rw -o nocache -o noatime -o noexec -o nosuid $root/test_loop/b/file $root/test_loop/a/file
+echo '123' > /tmp/file
+
+# The "mv" would spin
+mv /tmp/file $root/test_loop/a/file
+
+umount $root/test_loop/a/file
+rm -rf /tmp/file $root/test_loop
+exit