diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-01-08 10:51:06 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-01-08 10:54:46 -0800 |
commit | dc042c2d8ff629dd411e9a60bce9c379e2f8aaf8 (patch) | |
tree | 67c40e032fb069380e08806644405e9c8ce3761d /fs/xfs/libxfs/xfs_inode_fork.c | |
parent | 0795e004fd4f2723f3dbf09a195cd7ccf3c74c58 (diff) | |
download | lwn-dc042c2d8ff629dd411e9a60bce9c379e2f8aaf8.tar.gz lwn-dc042c2d8ff629dd411e9a60bce9c379e2f8aaf8.zip |
xfs: refactor short form directory structure verifier function
Change the short form directory structure verifier function to return
the instruction pointer of a failing check or NULL if everything's ok.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_fork.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_inode_fork.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index fd88cbe8c264..a92395a901d4 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -99,10 +99,9 @@ xfs_iformat_fork( /* Check inline dir contents. */ if (S_ISDIR(inode->i_mode) && dip->di_format == XFS_DINODE_FMT_LOCAL) { - error = xfs_dir2_sf_verify(ip); - if (error) { + if (xfs_dir2_sf_verify(ip)) { xfs_idestroy_fork(ip, XFS_DATA_FORK); - return error; + return -EFSCORRUPTED; } } |