dm-flakey target refreshed for 2.6.33
Subsystems (2)
PATCH 1/1 dm-flakey target refreshed for 2.6.33
Hello,
I needed a dm target to do some failure testing on btrfs's raid code, and Mike pointed me at this
http://www.kernel.org/pub/linux/kernel/people/agk/patches/2.6/editing/dm-flakey.patch
It just needed a few tweaks, all I did was
-fix the Kconfig/Makefile part so it would apply properly -changed SECTOR_FORMAT to "%llu"
-changed DMERR to printk (for some reason DMERR was failing and I have no idea why)
-dm_unregister_target is void now, whereas this patch had it returning an int, so fixed that too
Then this thing worked great for me. It probably needs to be cleaned up more, but I'm an FS person, not a DM person :). This (or something like it) would be super usefull for testing btrfs's raid code, or really any sort of failure mode with an fs without having to do crazy things like rip out cables, so if it could be included in mainline that would be helpful. Thanks,
Josef
--- drivers/md/Kconfig | 6 ++ drivers/md/Makefile | 1 + drivers/md/dm-flakey.c | 155 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+), 0 deletions(-) create mode 100644 drivers/md/dm-flakey.c
drivers/md/Kconfig +6 -0
@@ -319,4 +319,10 @@ config DM_UEVENT ---help--- Generate udev events for DM events. +config DM_FLAKEY + tristate "Flakey target (EXPERIMENTAL)" + depends on BLK_DEV_DM && EXPERIMENTAL + ---help--- + A debug only target that intermittently fails io. + endif # MD
drivers/md/Makefile +1 -0
@@ -37,6 +37,7 @@ obj-$(CONFIG_BLK_DEV_MD) += md-mod.o obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o obj-$(CONFIG_DM_CRYPT) += dm-crypt.o obj-$(CONFIG_DM_DELAY) += dm-delay.o +obj-$(CONFIG_DM_FLAKEY) += dm-flakey.o obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o obj-$(CONFIG_DM_MULTIPATH_QL) += dm-queue-length.o obj-$(CONFIG_DM_MULTIPATH_ST) += dm-service-time.o
drivers/md/dm-flakey.c new file +155 -0
155 lines not on this page · raw message
Signature · 1 line
1.5.4.3
Alasdair G Kergon
maintainerQuoted 1 line · Josef Bacik
-changed
SECTOR_FORMATto "%llu"
We also cast the parameter to 'unsigned long long' to match when displaying sectors.
Quoted 1 line
-changed DMERR to printk (for some reason DMERR was failing and I have no idea
We moved the target name ('flakey: ') inside the macro instead of having to write it in every message - so it needed #define DM_MSG_PREFIX.
I've made these changes and they'll appear at
http://www.kernel.org/pub/linux/kernel/people/agk/patches/2.6/editing/
next time I sync up.
Quoted 2 lines
with an fs without having to do crazy things like rip out cables, so if it could be included in mainline that would be helpful. Thanks,
Well the main thing I'm missing is a Documentation file and a patch header. This shouldn't be hard to write - any volunteers? Kconfig should get a few more words too.
It still needs a review for adherence to the latest dm standards, but that should be really quick, given how small it is.
Alasdair