mbox series

[v2,0/3] btrfs-progs: provide command to dump checksums

Message ID 20190424144754.4612-1-jthumshirn@suse.de (mailing list archive)
Headers show
Series btrfs-progs: provide command to dump checksums | expand

Message

Johannes Thumshirn April 24, 2019, 2:47 p.m. UTC
Provide a command to dump checksums from 'btrfs inspect-internal'. This
command does a lookup for the given file's extents via FIEMAP (which is
handy as it already skips holes) and walks the checksum tree printing all
checksums of an extent.

It is tested against different layouts of files with and without holes,
but further testing done by others is highly appreciated.

It is also available on github @ https://github.com/morbidrsa/btrfs-progs/tree/inspect-csums

As this feature set will be used in upcomming fstests test cases, which will
serve as regression tests around the checksum tree I, I decided that no
standalone tests in btrfs-progs are needed.

Changes since v1:
* Reworked error path's per Sun's comments
* Misc cleanups per Nikolay's comments
* Factored out super block reading from load_and_dump_sb() to be re-usable,
  also per Nikolay

Changes since RFC:
* Complete re-write using ioctl()s (FIEMAP and BTRFS_TREE_SEARCH_V2) to
  gather the extent and checksum informtion, as per David's (private)
  comment.
* Re-named btrfs_lookup_csum() as per Qu's comment.

Johannes Thumshirn (3):
  btrfs-progs: factor out super_block reading from load_and_dump_sb
  btrfs-progs: add 'btrfs inspect-internal csum-dump' command
  btrfs-progs: completion: wire-up dump-csum

 Makefile                  |   3 +-
 btrfs-completion          |   4 +-
 cmds-inspect-dump-csum.c  | 253 ++++++++++++++++++++++++++++++++++++++++++++++
 cmds-inspect-dump-super.c |   6 +-
 cmds-inspect.c            |   2 +
 commands.h                |   2 +
 utils.c                   |  17 ++++
 utils.h                   |   2 +
 8 files changed, 283 insertions(+), 6 deletions(-)
 create mode 100644 cmds-inspect-dump-csum.c