diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-07 13:37:13 -0500 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-11 19:07:01 -0500 |
commit | 7d36c19538d38f9ff6b93d2a3d23ee879b076dc6 (patch) | |
tree | fe8bf04bddb297059e7db80126f9db0bb63a31e2 /fs/xfs/libxfs/xfs_inode_buf.c | |
parent | 5837f62592ef7c07859a1b1a6e82030d85869f0f (diff) |
xfs: add xfs_verify_agino_or_null helper
Add a new helper to check that a per-AG inode pointer is either null or
points somewhere valid within that AG.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_buf.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_inode_buf.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 09d9c8cfa4a0..82c4374acb4c 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c | |||
@@ -99,8 +99,7 @@ xfs_inode_buf_verify( | |||
99 | unlinked_ino = be32_to_cpu(dip->di_next_unlinked); | 99 | unlinked_ino = be32_to_cpu(dip->di_next_unlinked); |
100 | di_ok = dip->di_magic == cpu_to_be16(XFS_DINODE_MAGIC) && | 100 | di_ok = dip->di_magic == cpu_to_be16(XFS_DINODE_MAGIC) && |
101 | xfs_dinode_good_version(mp, dip->di_version) && | 101 | xfs_dinode_good_version(mp, dip->di_version) && |
102 | (unlinked_ino == NULLAGINO || | 102 | xfs_verify_agino_or_null(mp, agno, unlinked_ino); |
103 | xfs_verify_agino(mp, agno, unlinked_ino)); | ||
104 | if (unlikely(XFS_TEST_ERROR(!di_ok, mp, | 103 | if (unlikely(XFS_TEST_ERROR(!di_ok, mp, |
105 | XFS_ERRTAG_ITOBP_INOTOBP))) { | 104 | XFS_ERRTAG_ITOBP_INOTOBP))) { |
106 | if (readahead) { | 105 | if (readahead) { |