On Mon, Aug 26, 2019 at 03:40:39PM +0800, Qu Wenruo wrote: > For INODE_REF we will check: > - Objectid (ino) against previous key > To detect missing INODE_ITEM. > > - No overflow/padding in the data payload > Much like DIR_ITEM, but with less members to check. > > Signed-off-by: Qu Wenruo <wqu@xxxxxxxx> > --- > fs/btrfs/tree-checker.c | 53 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 53 insertions(+) > > diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c > index 636ce1b4566e..3ce447eb591c 100644 > --- a/fs/btrfs/tree-checker.c > +++ b/fs/btrfs/tree-checker.c > @@ -842,6 +842,56 @@ static int check_inode_item(struct extent_buffer *leaf, > return 0; > } > > +#define inode_ref_err(fs_info, eb, slot, fmt, ...) \ > + inode_item_err(fs_info, eb, slot, fmt, __VA_ARGS__) I've changed that to #define inode_ref_err(fs_info, eb, slot, fmt, args...) \ inode_item_err(fs_info, eb, slot, fmt, ##args) as this is the common style for the variable macro args used in btrfs.
