summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_attr_remote.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-01-08 21:51:03 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2018-01-08 21:54:46 +0300
commitbc1a09b8e334bf5fca1d6727aec538dcff957961 (patch)
treee870d817d5c3b4a97b1201c81d80e39bff66b763 /fs/xfs/libxfs/xfs_attr_remote.c
parenta6a781a58befcbd467ce843af4eaca3906aa1f08 (diff)
downloadlinux-bc1a09b8e334bf5fca1d6727aec538dcff957961.tar.xz
xfs: refactor verifier callers to print address of failing check
Refactor the callers of verifiers to print the instruction address of a failing check. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr_remote.c')
-rw-r--r--fs/xfs/libxfs/xfs_attr_remote.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
index 06858db972ed..55514b343216 100644
--- a/fs/xfs/libxfs/xfs_attr_remote.c
+++ b/fs/xfs/libxfs/xfs_attr_remote.c
@@ -122,6 +122,7 @@ xfs_attr3_rmt_read_verify(
{
struct xfs_mount *mp = bp->b_target->bt_mount;
char *ptr;
+ xfs_failaddr_t fa;
int len;
xfs_daddr_t bno;
int blksize = mp->m_attr_geo->blksize;
@@ -137,12 +138,13 @@ xfs_attr3_rmt_read_verify(
while (len > 0) {
if (!xfs_verify_cksum(ptr, blksize, XFS_ATTR3_RMT_CRC_OFF)) {
- xfs_verifier_error(bp, -EFSBADCRC);
+ xfs_verifier_error(bp, -EFSBADCRC, __this_address);
return;
}
- if (xfs_attr3_rmt_verify(mp, ptr, blksize, bno)) {
- xfs_verifier_error(bp, -EFSCORRUPTED);
- return;
+ fa = xfs_attr3_rmt_verify(mp, ptr, blksize, bno);
+ if (fa) {
+ xfs_verifier_error(bp, -EFSCORRUPTED, fa);
+ break;
}
len -= blksize;
ptr += blksize;
@@ -150,7 +152,7 @@ xfs_attr3_rmt_read_verify(
}
if (len != 0)
- xfs_verifier_error(bp, -EFSCORRUPTED);
+ xfs_verifier_error(bp, -EFSCORRUPTED, __this_address);
}
static void
@@ -158,6 +160,7 @@ xfs_attr3_rmt_write_verify(
struct xfs_buf *bp)
{
struct xfs_mount *mp = bp->b_target->bt_mount;
+ xfs_failaddr_t fa;
int blksize = mp->m_attr_geo->blksize;
char *ptr;
int len;
@@ -175,8 +178,9 @@ xfs_attr3_rmt_write_verify(
while (len > 0) {
struct xfs_attr3_rmt_hdr *rmt = (struct xfs_attr3_rmt_hdr *)ptr;
- if (xfs_attr3_rmt_verify(mp, ptr, blksize, bno)) {
- xfs_verifier_error(bp, -EFSCORRUPTED);
+ fa = xfs_attr3_rmt_verify(mp, ptr, blksize, bno);
+ if (fa) {
+ xfs_verifier_error(bp, -EFSCORRUPTED, fa);
return;
}
@@ -185,7 +189,7 @@ xfs_attr3_rmt_write_verify(
* xfs_attr3_rmt_hdr_set() for the explanation.
*/
if (rmt->rm_lsn != cpu_to_be64(NULLCOMMITLSN)) {
- xfs_verifier_error(bp, -EFSCORRUPTED);
+ xfs_verifier_error(bp, -EFSCORRUPTED, __this_address);
return;
}
xfs_update_cksum(ptr, blksize, XFS_ATTR3_RMT_CRC_OFF);
@@ -196,7 +200,7 @@ xfs_attr3_rmt_write_verify(
}
if (len != 0)
- xfs_verifier_error(bp, -EFSCORRUPTED);
+ xfs_verifier_error(bp, -EFSCORRUPTED, __this_address);
}
const struct xfs_buf_ops xfs_attr3_rmt_buf_ops = {