Commit Graph

1 Commits

Author SHA1 Message Date
David Sterba
6f05548661 btrfs-progs: add error injection helper script
Add a convenience script for adding new injection cookies and filter for
actual testing.

- ./inject-error new - return new unique cookie
- ./inject-error file tune/change-csum.c - show all cookies in the given
  file (takes regexp)

Example usage:

  for i in $(./inject-error file tune/change-csum.c | awk '{print $1}') ; do
	  echo "Inject $i"
	  export INJECT="$i"
	  rm img
	  cp --reflink img.filled img
	  ./btrfstune --csum blake2 img
	  btrfs check img
  done

Where 'img' is a filesystem with sample files and directories.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-07-27 14:45:29 +02:00