From c38d702330f15b2f09304eff35dd83abbd5816ec Mon Sep 17 00:00:00 2001 From: Antonio Russo Date: Mon, 30 Apr 2018 13:45:47 -0400 Subject: [PATCH] Add test with two kinds of file creation orders Data loss was identified in #7401 when many small files were copied. This adds a reproducer for this bug and other similar ones: randomly generate N files. Then, listing M of them by `ls -U` order, produce those same files in a directory of the same name. This triggers the bug consistently, provided N and M are large enough. Here, N=2^16 and M=2^13. Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Signed-off-by: Antonio Russo Closes #7411 --- tests/runfiles/linux.run | 2 +- .../tests/functional/mv_files/Makefile.am | 3 +- .../tests/functional/mv_files/mv_files.cfg | 4 ++ .../functional/mv_files/random_creation.ksh | 48 +++++++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100755 tests/zfs-tests/tests/functional/mv_files/random_creation.ksh diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run index a0c23a7d6..272c8c773 100644 --- a/tests/runfiles/linux.run +++ b/tests/runfiles/linux.run @@ -499,7 +499,7 @@ tests = ['umount_001', 'umountall_001'] tags = ['functional', 'mount'] [tests/functional/mv_files] -tests = ['mv_files_001_pos', 'mv_files_002_pos'] +tests = ['mv_files_001_pos', 'mv_files_002_pos', 'random_creation'] tags = ['functional', 'mv_files'] [tests/functional/nestedfs] diff --git a/tests/zfs-tests/tests/functional/mv_files/Makefile.am b/tests/zfs-tests/tests/functional/mv_files/Makefile.am index 16a9c65eb..cec02140e 100644 --- a/tests/zfs-tests/tests/functional/mv_files/Makefile.am +++ b/tests/zfs-tests/tests/functional/mv_files/Makefile.am @@ -3,7 +3,8 @@ dist_pkgdata_SCRIPTS = \ setup.ksh \ cleanup.ksh \ mv_files_001_pos.ksh \ - mv_files_002_pos.ksh + mv_files_002_pos.ksh \ + random_creation.ksh dist_pkgdata_DATA = \ mv_files.cfg \ diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files.cfg b/tests/zfs-tests/tests/functional/mv_files/mv_files.cfg index ac81bd360..ed28ff1ef 100644 --- a/tests/zfs-tests/tests/functional/mv_files/mv_files.cfg +++ b/tests/zfs-tests/tests/functional/mv_files/mv_files.cfg @@ -44,3 +44,7 @@ export NEWDIR_ACROSS_FS=$TESTDIR_TGT/newdir export MVNUMFILES=2000 # export MVNUMINCR=1000 # export GANGPIDS=50 # + +# controls the "random_creation" test +export RC_PASS1=65536 # +export RC_PASS2=8192 #