On 9/24/18 12:04 PM, Brian Foster wrote: > On Mon, Sep 10, 2018 at 05:22:08PM -0500, Eric Sandeen wrote: >> Verify the inode di_forkoff, lifted from xfs_repair's >> process_check_inode_forkoff(). >> >> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx> >> --- >> >> diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c >> index 30d1d60f1d46..8d76637a49a7 100644 >> --- a/fs/xfs/libxfs/xfs_inode_buf.c >> +++ b/fs/xfs/libxfs/xfs_inode_buf.c >> @@ -415,6 +415,31 @@ xfs_dinode_verify_fork( >> return NULL; >> } >> >> +static xfs_failaddr_t >> +xfs_dinode_verify_forkoff( >> + struct xfs_dinode *dip, >> + struct xfs_mount *mp) >> +{ >> + if (dip->di_forkoff == 0) >> + return NULL; > > I think it would be good to use XFS_DFORK_Q() here, just to be > consistent with the other, similar checks. Otherwise looks good: Ok; personally I hate that macro ;) but you're right, consistency first. -Eric