On 8.11.2017 02:54, Qu Wenruo wrote: > Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and > XATTR_ITEM. > > This checker does comprehensive check for: > 1) dir_item header and its data size > Against item boundary and maximum name/xattr length. > This part is mostly the same as old verify_dir_item(). > > 2) dir_type > Against maximum file types, and against key type. > Since XATTR key should only have FT_XATTR dir item, and normal dir > item type should not have XATTR key. > > The check between key->type and dir_type is newly introduced by this > patch. > > 3) name hash > For XATTR and DIR_ITEM key, key->offset is name hash (crc32). > Check the hash of name against key to ensure it's correct. > > The name hash check is only found in btrfs-progs before this patch. > > Signed-off-by: Qu Wenruo <w...@suse.com> > --- > fs/btrfs/tree-checker.c | 141 > ++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 141 insertions(+) >
I'm gonna 'hijack' this patch to discuss something - we do return the correct EUCLEAN status from the leaf checker, however the only place where it's called is in btree_readpage_end_io_hook and if the check fails we only return -EIO. I wonder whether want to propagate the EUCLEAN from there, any thoughts? -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html