Project

General

Profile

Actions

Submit #2851

closed

[PATCH v1] sys/dev/disk/dm: Add dm-flakey target

Added by tkusumi about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
11/17/2015
Due date:
% Done:

0%

Estimated time:

Description

This patch is the initial version of dm-flakey target from Linux kernel.
https://www.dragonflybsd.org/~tkusumi/diff/0001-sys-dev-disk-dm-Add-dm-flakey-target.patch

===== Example1 - Error write I/Os
  1. kldload dm_target_flakey
  2. dmsetup create flakey1 --table "0 234436482 flakey /dev/da3 0 1 1"
  3. newfs_hammer -L TEST /dev/mapper/flakey1
    Volume 0 DEVICE /dev/mapper/flakey1 size 111.79GB
    initialize freemap volume 0
    initializing the undo map (504 MB)
    newfs_hammer: Write volume 0 (/dev/mapper/flakey1): Input/output error
  4. dmsetup remove /dev/mapper/flakey1
===== Example2 - Silently drop write I/Os
  1. newfs_hammer -L TEST /dev/da3 > /dev/null
  2. mount_hammer /dev/da3 /HAMMER
  3. cd /HAMMER
  4. git clone /usr/local/src/dragonfly
    Cloning into 'dragonfly'...
    done.
    Checking out files: 100% (34434/34434), done.
  5. cd
  6. umount /HAMMER
  7. dmsetup create flakey2 --table "0 234436482 flakey /dev/da3 0 1 1 1 drop_writes"
  8. mount_hammer /dev/mapper/flakey2 /HAMMER
  9. dmesg | tail -3
    HAMMER Critical error inode=-1 error=5 while flushing meta-data
    HAMMER Forcing read-only mode
    HAMMER mounted clean, no recovery needed
  10. mount | grep "/HAMMER"
    TEST on /HAMMER (hammer, local, read-only)
  11. cd /HAMMER/dragonfly
  12. git log -p > /dev/null; echo $?
    0
  13. cd
  14. umount /HAMMER
  15. dmsetup remove /dev/mapper/flakey2
===== Example3 - Corrupt read I/Os
  1. dd if=/dev/zero of=/dev/da3 bs=1024 count=10000 >/dev/null 2>&1
  2. dmsetup create flakey3 --table "0 234436482 flakey /dev/da3 0 1 1 5 corrupt_bio_byte 1 r 65 0"
  3. od -tx1 /dev/mapper/flakey3 | head -10
    0000000 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *
    0010000 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0010020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *
    0020000 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0020020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *
    0030000 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  4. dmsetup remove /dev/mapper/flakey3
  5. kldunload dm_target_flakey
Actions

Also available in: Atom PDF