diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2014-02-26 23:23:10 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-02-26 23:23:10 -0500 |
commit | ce5028cfe3ca48695b6a128638fe224426d37ebe (patch) | |
tree | e6b62cc91ec0fb74343a3e231d11dd16b55be2b5 /fs/xfs/xfs_symlink_remote.c | |
parent | db9355c296eb71271bb3807ad4a9d43f6b3c35d3 (diff) |
xfs: modify verifiers to differentiate CRC from other errors
Modify all read & write verifiers to differentiate
between CRC errors and other inconsistencies.
This sets the appropriate error number on bp->b_error,
and then calls xfs_verifier_error() if something went
wrong. That function will issue the appropriate message
to the user.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_symlink_remote.c')
-rw-r--r-- | fs/xfs/xfs_symlink_remote.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/xfs/xfs_symlink_remote.c b/fs/xfs/xfs_symlink_remote.c index defa09ff4076..9b32052ff65e 100644 --- a/fs/xfs/xfs_symlink_remote.c +++ b/fs/xfs/xfs_symlink_remote.c | |||
@@ -133,11 +133,13 @@ xfs_symlink_read_verify( | |||
133 | if (!xfs_sb_version_hascrc(&mp->m_sb)) | 133 | if (!xfs_sb_version_hascrc(&mp->m_sb)) |
134 | return; | 134 | return; |
135 | 135 | ||
136 | if (!xfs_buf_verify_cksum(bp, XFS_SYMLINK_CRC_OFF) || | 136 | if (!xfs_buf_verify_cksum(bp, XFS_SYMLINK_CRC_OFF)) |
137 | !xfs_symlink_verify(bp)) { | 137 | xfs_buf_ioerror(bp, EFSBADCRC); |
138 | XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, bp->b_addr); | 138 | else if (!xfs_symlink_verify(bp)) |
139 | xfs_buf_ioerror(bp, EFSCORRUPTED); | 139 | xfs_buf_ioerror(bp, EFSCORRUPTED); |
140 | } | 140 | |
141 | if (bp->b_error) | ||
142 | xfs_verifier_error(bp); | ||
141 | } | 143 | } |
142 | 144 | ||
143 | static void | 145 | static void |
@@ -152,8 +154,8 @@ xfs_symlink_write_verify( | |||
152 | return; | 154 | return; |
153 | 155 | ||
154 | if (!xfs_symlink_verify(bp)) { | 156 | if (!xfs_symlink_verify(bp)) { |
155 | XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, bp->b_addr); | ||
156 | xfs_buf_ioerror(bp, EFSCORRUPTED); | 157 | xfs_buf_ioerror(bp, EFSCORRUPTED); |
158 | xfs_verifier_error(bp); | ||
157 | return; | 159 | return; |
158 | } | 160 | } |
159 | 161 | ||