summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-checker.c
Commit message (Collapse)AuthorAgeFilesLines
* btrfs: tree-checker: use %zu format string for size_tArnd Bergmann2017-10-301-1/+1
| | | | | | | | | | | | | | We now get a harmless compile-time on 32-bit architectures: fs/btrfs/tree-checker.c: In function 'check_extent_data_item': fs/btrfs/tree-checker.c:189:70: error: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'unsigned int' [-Werror=format=] This changes the format string to use %zu instead of %lu for size_t. Fixes: c1f6520bf360 ("btrfs: tree-checker: Enhance output for check_extent_data_item") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: tree-checker: Enhance output for check_extent_data_itemQu Wenruo2017-10-301-28/+69
| | | | | | | | Output the invalid member name and its bad value, along with its expected value range or alignment. Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: tree-checker: Enhance output for check_csum_itemQu Wenruo2017-10-301-3/+9
| | | | | | | | Output the bad value and expected good value (or its alignment). Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> [ unindent long strings ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: tree-checker: Enhance output for btrfs_check_leafQu Wenruo2017-10-301-6/+21
| | | | | | | | | | | Enhance the output to print: 1) the eason 2) the ad value, if reason is not sufficient 3) good value (range) Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> [ wording, unidented long strings ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: tree-checker: Enhance btrfs_check_node outputQu Wenruo2017-10-301-7/+61
| | | | | | | | | | | | | | | | | | | | Use inline function to replace macro since we don't need stringification. (Macro still exists until all callers get updated) And add more info about the error, and replace EIO with EUCLEAN. For nr_items error, report if it's too large or too small, and output the valid value range. For node block pointer, added a new alignment checker. For key order, also output the next key to make the problem more obvious. Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> [ wording adjustments, unindented long strings ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs: Move leaf and node validation checker to tree-checker.cQu Wenruo2017-10-301-0/+309
It's no doubt the comprehensive tree block checker will become larger, so moving them into their own files is quite reasonable. Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> [ wording adjustments ] Signed-off-by: David Sterba <dsterba@suse.com>