[PATCH] xfstests: add disk failure simulation test
Greg Freemyer
greg.freemyer at gmail.com
Thu Feb 21 21:27:22 CST 2013
On Wed, Feb 13, 2013 at 10:41 AM, Dmitry Monakhov <dmonakhov at openvz.org> wrote:
> 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
Out of curiosity, does xfstest also have fault injection at the sector level?
It may be a little too aggressive, but hdparm --make-bad-sector
nnnnnnn can use a ATA long_write to write out a sector and
non-matching crc. When the sector is then read after that, the drive
returns a media error.
At the end of the test hdparm --repair-sector nnnnnnn will fix the
bad sector and store a valid crc.
The reason I say it is aggressive is that matched pairs of
--make-bad-sector and --repair-sector should have no long term effect
on the drive, but non-matched pairs will leave the drive with a media
error. A normal write to that "bad" sector will force it to be
remapped to a spare sector. I don't know of a simple way to undo that
mapping.
Greg
More information about the xfs
mailing list