]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
e2fsprogs-tests-f_random_corruption.patch
authorAndreas Dilger <adilger@sun.com>
Sat, 2 Feb 2008 08:46:27 +0000 (01:46 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Feb 2008 03:36:56 +0000 (22:36 -0500)
commit79d5be051387d421f0fab096bf04d94f5764f4f2
tree2bde95c3baf95619aee3db7b8566a5dde3d3e392
parentb8e4377458807b2110f940642fe84f6a12e476ca
e2fsprogs-tests-f_random_corruption.patch

The f_random_corruption test enables a random subset of filesystem features,
picks one of the valid filesystem block and inode sizes, and a random device
size and creates a new filesystem with those parameters.

It is possible to disable the running of the test by setting the environment
variable F_RANDOM_CORRUPTION=skip.  By default the test script is run only
one time, but setting the LOOP_COUNT variable allows the test to run multiple
times.

If the script is running as root the filesystem is mounted and populated with
file data to allow a more useful test filesystem to be generated.  In some
cases the kernel may not support the requested filesystem features and the
filesystem cannot be mounted.  This is not considered a test failure.

The resulting filesystem is corrupted with both random data and by shifting
data from one part of the device to another and then repaired by e2fsck.
In some rare cases the random corruption is severe enough that the filesystem
is not recoverable (e.g. small filesystem with no backup superblock has bad
superblock corruption) but in most cases "e2fsck -fy" should be able to fix
all errors in some way.

After e2fsck has repaired the filesystem, it is optionally mounted (if the
environment variable MOUNT_AFTER_CORRUPTION=yes is set) and the test files
created in the filesystem are deleted.  This verifies that the fixes in the
filesystem are sufficient for the kernel to use the filesystem without error.
Since there is some possibility of the kernel oopsing if there is a filesystem
bug, this part of the test is not enabled by default.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
tests/Makefile.in
tests/f_random_corruption/script [new file with mode: 0644]