]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
xfstests: add disk failure simulation test
authorDmitry Monakhov <dmonakhov@openvz.org>
Wed, 20 Feb 2013 10:42:15 +0000 (10:42 +0000)
committerRich Johnston <rjohnston@sgi.com>
Mon, 4 Mar 2013 23:35:49 +0000 (17:35 -0600)
commit02e57e1e3a42856dca9061ff943ba72fa7be8469
tree9363b1efb542cab0e53609207534dcfe8d68fa23
parenta3d92a6cbdf9e98d8e256974b50b025d1d4575ec
xfstests: add disk failure simulation test

There are many situations where disk may fail for example
1) brutal usb dongle unplug
2) iscsi (or any other netbdev) failure due to network issues
In this situation filesystem which use this blockdevice is
expected to fail(force RO remount, abort, etc) but whole system
should still be operational. In other words:
1) Kernel should not panic
2) Memory should not leak
3) Data integrity operations (sync,fsync,fdatasync, directio) should fail
   for affected filesystem
4) It should be possible to umount broken filesystem

Later when disk becomes available again we expect(only for journaled filesystems):
5) It will be possible to mount filesystem w/o explicit fsck (in order to catch
   issues like https://patchwork.kernel.org/patch/1983981/)
6) Filesystem should be operational
7) After mount/umount has being done all errors should be fixed so fsck should
   not spot any issues.

This test use fault injection (CONFIG_FAULT_INJECTION=y,
CONFIG_FAIL_MAKE_REQUEST=y and CONFIG_FAULT_INJECTION_DEBUG_FS=y config
options) to force all new IO requests to fail for a given device. Xfs
already has XFS_IOC_GOINGDOWN ioctl which provides similar behavior, but it
is fs specific and it does it in an easy way because it performs freeze_bdev()
before actual shutdown.

Test run fsstress in background and then force disk failure.
Once disk failed it check that (1)-(4) is true.
Then makes disk available again and check that (5)-(7) is also true

BE CAREFUL!! test known to cause memory corruption for XFS
see: https://gist.github.com/dmonakhov/4953045

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
305 [new file with mode: 0644]
305.out [new file with mode: 0644]
common.config
common.rc
group