Re: SCSI test target for emulating broken/bad disk

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Mon, Sep 15, 2014 at 02:27:55PM -0700, ronnie sahlberg wrote:
> List, All,
> 
> I have been working on creating a "bad disk" for use with testing.
> One aim is for having an easy way to create a SCSI disk that fails in
> certain controllable ways
> to make sure that filesystem code or applications that talk directly
> to a SCSI disk handle
> error conditions and specific sense codes correctly.

Filesystems don't talk directly to the SCSI layer. SCSI is hidden
from filesystems by several layers of abstraction....

> To do things like :
> * flag certain regions of blocks to always fail with certain sense codes
> * cause i/o to certain regions cause the whole device to "hang" for some time
> * torture : "fail 10% of any READs with a certain error".
> * transient errors: make the next #n i/o to a range fail with a sense
> code, then self-heal the device and further i/o complete without
> error.

We're already using dm-flakey for tests that require block devices
that fail specific types of IO or corrupt data. The functionality is
limited at the moment, but it's easy to extend to new types of
failures.

> 
> 
> A very first prototype can be seen at :
> 
> https://github.com/rsahlberg/flaky-stgt
> 
> Please see the README.
> 
> This will probably eventually be merged back into the upstream tgt project.
> 
> Is this something you guys would find useful? If so I am more than
> happy to work with
> you to add what features you need or want.

I can see how flaky scsi behaviour would be useful for testing the
SCSI stack error behaviour, but due to the layers of abstraction it
is not necessarily the best way to do IO error injection/simulation
for generic filesystem testing.

Using DM means we don't have to care what type of block device
people are using - if it can have dm layered on top it can be used
for testing filesystem behaviour on flakey devices regardless of the
underlying storage technologies in use. This is especially important
given that a lot of developers now do their testing inside VMs on
virtio block devices, not SCSI devices.

Hence if your aim is just to improving filesystem error
handling then I'd suggest that adding more features to dm-flakey
and writing xfstests to exercise filesystems one those flakey
devices. If your aim is to provide SCSI layer IO error injection,
then I'm not sure how much use it is going to be to us. I'm sure
if it's useful then someone will come up with some tests ;)

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux