linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/5] Enhance tree block validation checker
@ 2017-10-09  1:51 Qu Wenruo
  2017-10-09  1:51 ` [PATCH v4 1/5] btrfs: Move leaf and node validation checker to tree-checker.ch Qu Wenruo
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Qu Wenruo @ 2017-10-09  1:51 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba, nborisov

The patchset can be fetched from github:
https://github.com/adam900710/linux/tree/checker_enhance

It's based on David's misc-next branch, with following commit as base:
a5e50b4b444c ("btrfs: Add checker for EXTENT_CSUM")

According to David's suggestion, enhance the output format of tree block
validation checker.

And move them into separate files: tree-checker.[ch].

Also added a output format rule to try to make all output message
follow the same format.

Some example output using btrfs-progs fsck-test images looks like:

For unagliend file extent member:
---
BTRFS critical (device loop0): corrupt leaf: root=1 block=29360128 slot=7 ino=257 file_offset=0, invalid disk_bytenr for file extent, have 755944791, should be aligned to 4096
---

For bad leaf holes:
---
BTRFS critical (device loop0): corrupt leaf: root=1 block=29360128 slot=28, discontinious item end, have 9387 expect 15018
---

Changelog:
v2:
  Unify the error string format, so it should be easier to grep them
  from dmesg. Thanks Nikolay for pointing this out.
  Remove unused CORRUPT() macro.
v3:
  Replace EIO with EUCLEAN in 2nd patch. Thanks Nikolay for pointing
  this out.
  Correct "btrfs-progs:" to "btrfs:" for 1st patch.
v4:
  Code style change suggested by David.
  Use more easy-to-understand error message for NULL node pointer,
  suggested by Nikolay.
  Helper macro enhancement, including naming change and argument
  protection suggested by David.
  Separate tree-checker.h suggested by David.


Qu Wenruo (5):
  btrfs: Move leaf and node validation checker to tree-checker.ch
  btrfs: tree-checker: Enhance btrfs_check_node output
  btrfs: tree-checker: Enhance output for btrfs_check_leaf
  btrfs: tree-checker: Enhance output for check_csum_item
  btrfs: tree-checker: Enhance output for check_extent_data_item

 fs/btrfs/Makefile       |   2 +-
 fs/btrfs/disk-io.c      | 285 +-------------------------------
 fs/btrfs/tree-checker.c | 429 ++++++++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/tree-checker.h |  23 +++
 4 files changed, 457 insertions(+), 282 deletions(-)
 create mode 100644 fs/btrfs/tree-checker.c
 create mode 100644 fs/btrfs/tree-checker.h

-- 
2.14.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-10-12  5:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-09  1:51 [PATCH v4 0/5] Enhance tree block validation checker Qu Wenruo
2017-10-09  1:51 ` [PATCH v4 1/5] btrfs: Move leaf and node validation checker to tree-checker.ch Qu Wenruo
2017-10-09  1:51 ` [PATCH v4 2/5] btrfs: tree-checker: Enhance btrfs_check_node output Qu Wenruo
2017-10-09  1:51 ` [PATCH v4 3/5] btrfs: tree-checker: Enhance output for btrfs_check_leaf Qu Wenruo
2017-10-11 15:41   ` Nikolay Borisov
2017-10-11 17:56     ` David Sterba
2017-10-12  0:28     ` Qu Wenruo
2017-10-12  5:57       ` Nikolay Borisov
2017-10-09  1:51 ` [PATCH v4 4/5] btrfs: tree-checker: Enhance output for check_csum_item Qu Wenruo
2017-10-09  1:51 ` [PATCH v4 5/5] btrfs: tree-checker: Enhance output for check_extent_data_item Qu Wenruo
2017-10-11 17:57 ` [PATCH v4 0/5] Enhance tree block validation checker David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).