xfs: print name of verifier if it fails
authorEric Sandeen <sandeen@redhat.com>
Mon, 4 Jan 2016 05:10:19 +0000 (16:10 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 4 Jan 2016 05:10:19 +0000 (16:10 +1100)
This adds a name to each buf_ops structure, so that if
a verifier fails we can print the type of verifier that
failed it.  Should be a slight debugging aid, I hope.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
18 files changed:
fs/xfs/libxfs/xfs_alloc.c
fs/xfs/libxfs/xfs_alloc_btree.c
fs/xfs/libxfs/xfs_attr_leaf.c
fs/xfs/libxfs/xfs_attr_remote.c
fs/xfs/libxfs/xfs_bmap_btree.c
fs/xfs/libxfs/xfs_da_btree.c
fs/xfs/libxfs/xfs_dir2_block.c
fs/xfs/libxfs/xfs_dir2_data.c
fs/xfs/libxfs/xfs_dir2_leaf.c
fs/xfs/libxfs/xfs_dir2_node.c
fs/xfs/libxfs/xfs_dquot_buf.c
fs/xfs/libxfs/xfs_ialloc.c
fs/xfs/libxfs/xfs_ialloc_btree.c
fs/xfs/libxfs/xfs_inode_buf.c
fs/xfs/libxfs/xfs_sb.c
fs/xfs/libxfs/xfs_symlink_remote.c
fs/xfs/xfs_buf.h
fs/xfs/xfs_error.c

index 3479294c1d586603d75c432267a91ff744a31006..e1e7fe3b5424c8e619be4fe25930eb6ca414c6ea 100644 (file)
@@ -535,6 +535,7 @@ xfs_agfl_write_verify(
 }
 
 const struct xfs_buf_ops xfs_agfl_buf_ops = {
+       .name = "xfs_agfl",
        .verify_read = xfs_agfl_read_verify,
        .verify_write = xfs_agfl_write_verify,
 };
@@ -2339,6 +2340,7 @@ xfs_agf_write_verify(
 }
 
 const struct xfs_buf_ops xfs_agf_buf_ops = {
+       .name = "xfs_agf",
        .verify_read = xfs_agf_read_verify,
        .verify_write = xfs_agf_write_verify,
 };
index 90de071dd4c2cf2afbd7a7bde5658f1367b21bd1..eb8bbfe85484e33554fe6b3e48e1d7b5c252fac6 100644 (file)
@@ -379,6 +379,7 @@ xfs_allocbt_write_verify(
 }
 
 const struct xfs_buf_ops xfs_allocbt_buf_ops = {
+       .name = "xfs_allocbt",
        .verify_read = xfs_allocbt_read_verify,
        .verify_write = xfs_allocbt_write_verify,
 };
index aa187f7ba2dd341a4a797ab268747881f3f4deca..01a5ecfedfcf162cc155d1214cd2746eec5a46b7 100644 (file)
@@ -328,6 +328,7 @@ xfs_attr3_leaf_read_verify(
 }
 
 const struct xfs_buf_ops xfs_attr3_leaf_buf_ops = {
+       .name = "xfs_attr3_leaf",
        .verify_read = xfs_attr3_leaf_read_verify,
        .verify_write = xfs_attr3_leaf_write_verify,
 };
index 5ab95ffa4ae9f6ee38ff4b56a5f1ca0d61e38e67..f3ed9bf0b0655e2fd746da915aa095ffd1280523 100644 (file)
@@ -201,6 +201,7 @@ xfs_attr3_rmt_write_verify(
 }
 
 const struct xfs_buf_ops xfs_attr3_rmt_buf_ops = {
+       .name = "xfs_attr3_rmt",
        .verify_read = xfs_attr3_rmt_read_verify,
        .verify_write = xfs_attr3_rmt_write_verify,
 };
index 6b0cf6546a82f7752bc8a7121d8741f3257269c7..1637c37bfbaa1cb61ef69e48c52eb95716ecd649 100644 (file)
@@ -720,6 +720,7 @@ xfs_bmbt_write_verify(
 }
 
 const struct xfs_buf_ops xfs_bmbt_buf_ops = {
+       .name = "xfs_bmbt",
        .verify_read = xfs_bmbt_read_verify,
        .verify_write = xfs_bmbt_write_verify,
 };
index e89a0f8f827ce0da6829c7189471a4438d019b05..097bf7717d8055693e9a2285c9f5a4ff30509281 100644 (file)
@@ -245,6 +245,7 @@ xfs_da3_node_read_verify(
 }
 
 const struct xfs_buf_ops xfs_da3_node_buf_ops = {
+       .name = "xfs_da3_node",
        .verify_read = xfs_da3_node_read_verify,
        .verify_write = xfs_da3_node_write_verify,
 };
index 9c10e2b8cfcb594101a38011ee68bfcf6a5e09a1..aa17cb788946b02ebb54a7a75350ae43869a758a 100644 (file)
@@ -123,6 +123,7 @@ xfs_dir3_block_write_verify(
 }
 
 const struct xfs_buf_ops xfs_dir3_block_buf_ops = {
+       .name = "xfs_dir3_block",
        .verify_read = xfs_dir3_block_read_verify,
        .verify_write = xfs_dir3_block_write_verify,
 };
index af71a84f343c33b98471665df2d2f37b025571cc..725fc7841fdeb38fdfdba08f1621a83f764baeea 100644 (file)
@@ -305,11 +305,13 @@ xfs_dir3_data_write_verify(
 }
 
 const struct xfs_buf_ops xfs_dir3_data_buf_ops = {
+       .name = "xfs_dir3_data",
        .verify_read = xfs_dir3_data_read_verify,
        .verify_write = xfs_dir3_data_write_verify,
 };
 
 static const struct xfs_buf_ops xfs_dir3_data_reada_buf_ops = {
+       .name = "xfs_dir3_data_reada",
        .verify_read = xfs_dir3_data_reada_verify,
        .verify_write = xfs_dir3_data_write_verify,
 };
index 3923e1f9469761548b34a6db73076bb8f90d0c66..b887fb2a2bcf5d39fdabe01d5fbd6a2b60410811 100644 (file)
@@ -245,11 +245,13 @@ xfs_dir3_leafn_write_verify(
 }
 
 const struct xfs_buf_ops xfs_dir3_leaf1_buf_ops = {
+       .name = "xfs_dir3_leaf1",
        .verify_read = xfs_dir3_leaf1_read_verify,
        .verify_write = xfs_dir3_leaf1_write_verify,
 };
 
 const struct xfs_buf_ops xfs_dir3_leafn_buf_ops = {
+       .name = "xfs_dir3_leafn",
        .verify_read = xfs_dir3_leafn_read_verify,
        .verify_write = xfs_dir3_leafn_write_verify,
 };
index 70b0cb2fd55606422eaf08ce9e016e33f66fe6a2..63ee03db796ca9a55b9f9f10a427a6fd539c30d4 100644 (file)
@@ -150,6 +150,7 @@ xfs_dir3_free_write_verify(
 }
 
 const struct xfs_buf_ops xfs_dir3_free_buf_ops = {
+       .name = "xfs_dir3_free",
        .verify_read = xfs_dir3_free_read_verify,
        .verify_write = xfs_dir3_free_write_verify,
 };
index 5331b7f0460c7e16a72aab1b7b96f727a606a10c..11cefb2a372a829f9a7c8e43c3ff9b3a692d4324 100644 (file)
@@ -282,6 +282,7 @@ xfs_dquot_buf_write_verify(
 }
 
 const struct xfs_buf_ops xfs_dquot_buf_ops = {
+       .name = "xfs_dquot",
        .verify_read = xfs_dquot_buf_read_verify,
        .verify_write = xfs_dquot_buf_write_verify,
 };
index 70c1db99f6a720df26fa0d4c430ad401141f1ad2..66d702e6b9ff3f7d6cc5a0b47a216171815e9fa4 100644 (file)
@@ -2572,6 +2572,7 @@ xfs_agi_write_verify(
 }
 
 const struct xfs_buf_ops xfs_agi_buf_ops = {
+       .name = "xfs_agi",
        .verify_read = xfs_agi_read_verify,
        .verify_write = xfs_agi_write_verify,
 };
index f39b285beb19f659ab5a6f0774c966134c0fdf58..6dd44f9ea7270fecf48ab9edfca83f183075bb3e 100644 (file)
@@ -304,6 +304,7 @@ xfs_inobt_write_verify(
 }
 
 const struct xfs_buf_ops xfs_inobt_buf_ops = {
+       .name = "xfs_inobt",
        .verify_read = xfs_inobt_read_verify,
        .verify_write = xfs_inobt_write_verify,
 };
index 268c00f4f83af9b5eb3fe492322323c7be2f5b42..1b8d98a915c42fa30da194bed0eebbf785cd6529 100644 (file)
@@ -132,11 +132,13 @@ xfs_inode_buf_write_verify(
 }
 
 const struct xfs_buf_ops xfs_inode_buf_ops = {
+       .name = "xfs_inode",
        .verify_read = xfs_inode_buf_read_verify,
        .verify_write = xfs_inode_buf_write_verify,
 };
 
 const struct xfs_buf_ops xfs_inode_buf_ra_ops = {
+       .name = "xxfs_inode_ra",
        .verify_read = xfs_inode_buf_readahead_verify,
        .verify_write = xfs_inode_buf_write_verify,
 };
index a0b071d881a02aa3d99b08e83aadb999b65270a4..8a53eaa349f44884354139fcde0a9c17b35e741a 100644 (file)
@@ -679,11 +679,13 @@ xfs_sb_write_verify(
 }
 
 const struct xfs_buf_ops xfs_sb_buf_ops = {
+       .name = "xfs_sb",
        .verify_read = xfs_sb_read_verify,
        .verify_write = xfs_sb_write_verify,
 };
 
 const struct xfs_buf_ops xfs_sb_quiet_buf_ops = {
+       .name = "xfs_sb_quiet",
        .verify_read = xfs_sb_quiet_read_verify,
        .verify_write = xfs_sb_write_verify,
 };
index cb6fd20a4d3d19b61ac5db3dde29345a18432845..2e2c6716b6239199c88708170ef0cd24d2a029cb 100644 (file)
@@ -168,6 +168,7 @@ xfs_symlink_write_verify(
 }
 
 const struct xfs_buf_ops xfs_symlink_buf_ops = {
+       .name = "xfs_symlink",
        .verify_read = xfs_symlink_read_verify,
        .verify_write = xfs_symlink_write_verify,
 };
index c79b717d9b882f5a84d1fe07dc1ead83acac8ba2..c75721acd8679687ae403d9eb5ee463a3cb0dc17 100644 (file)
@@ -132,6 +132,7 @@ struct xfs_buf_map {
        struct xfs_buf_map (map) = { .bm_bn = (blkno), .bm_len = (numblk) };
 
 struct xfs_buf_ops {
+       char *name;
        void (*verify_read)(struct xfs_buf *);
        void (*verify_write)(struct xfs_buf *);
 };
index 74d0e5966ebca70f2ba489532b9ebfaae693c288..88693a98fac5ed8261facecbd606cea0589c4d1f 100644 (file)
@@ -164,9 +164,9 @@ xfs_verifier_error(
 {
        struct xfs_mount *mp = bp->b_target->bt_mount;
 
-       xfs_alert(mp, "Metadata %s detected at %pF, block 0x%llx",
+       xfs_alert(mp, "Metadata %s detected at %pF, %s block 0x%llx",
                  bp->b_error == -EFSBADCRC ? "CRC error" : "corruption",
-                 __return_address, bp->b_bn);
+                 __return_address, bp->b_ops->name, bp->b_bn);
 
        xfs_alert(mp, "Unmount and run xfs_repair");