I made a patch to the loopback device which allows you to discard I/Os
going to disk. You can either activate it via an ioctl from user space,
or via a function call in the kernel.
You can also make reads fail, but this was not very useful for me, because
it caused the ASSERTs in ext3 to oops. Also the read "failures" are not
the same as the real thing, so it may not be a valid test. They only
return a zero'd page, rather than really causing a non-up-to-date page.
I used it quite a bit when developing the orphan code for ext3, and for
testing journal integration in InterMezzo. You can use it for testing
a loopback file, or loopback mount a block device, but as with regular
loopback devices, there is a 2GB limit.
I posted it to fsdevel a few months ago, but I have also uploaded it to:
ftp://ftp.stelias.com/pub/adilger/loopdiscard-2.2.16.patch
ftp://ftp.stelias.com/pub/adilger/loop_discard.c
The loop_discard.c program simply calls the ioctl to enable or disable
I/O on the specific loop device. Unconfiguring the loop device also
resets the I/O status.
Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/