aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/xattr.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2017-11-08 08:54:25 +0800
committerDavid Sterba <dsterba@suse.com>2018-01-22 16:08:12 +0100
commitad7b0368f33cffe67fecd302028915926e50ef7e (patch)
tree95e33cfe739acba8befa8df5fdcae0d0f45ed007 /fs/btrfs/xattr.c
parentbtrfs: use GFP_KERNEL in btrfs_alloc_inode (diff)
downloadlinux-dev-ad7b0368f33cffe67fecd302028915926e50ef7e.tar.xz
linux-dev-ad7b0368f33cffe67fecd302028915926e50ef7e.zip
btrfs: tree-checker: Add checker for dir item
Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and XATTR_ITEM. This checker does comprehensive checks 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 (crc32c). Check the hash of the name against the key to ensure it's correct. The name hash check is only found in btrfs-progs before this patch. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/xattr.c')
0 files changed, 0 insertions, 0 deletions