Re: [PATCH 2/2] btrfs: tree-checker: Add check for INODE_REF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 26, 2019 at 07:50:03PM +0800, Qu Wenruo wrote:
> 
> 
> On 2019/8/26 下午7:45, Nikolay Borisov wrote:
> >
> >
> > On 26.08.19 г. 10:40 ч., 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__)
> >
> > This define doesn't bring anything, just opencode the call to
> > inode_item_err directly.
> 
> I could argue we that in an inode ref context, using a inode_item_err()
> doesn't look right.
> 
> And since it's doesn't do any hurt, I prefer to make the error message
> parse to match the context.

I agree the alias inode_ref_err does not hurt, there's no penatly in the
code so for sake of readability let's do it.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux