aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-07-28 21:52:04 -0400
committerDave Chinner <david@fromorbit.com>2015-07-28 21:52:04 -0400
commitf41febd2eb5bdaa1c5685fe8a9b09276645013bc (patch)
treef6206ae8ed114a4db4118a9dc7efbec90b2025ce
parent89cebc8477290b152618ffa110bbeae340d50900 (diff)
xfs: Use consistent logging message prefixes
The second and subsequent lines of multi-line logging messages are not prefixed with the same information as the first line. Separate messages with newlines into multiple calls to ensure consistent prefixing and allow easier grep use. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r--fs/xfs/libxfs/xfs_dir2_node.c3
-rw-r--r--fs/xfs/libxfs/xfs_sb.c14
-rw-r--r--fs/xfs/xfs_buf.c5
-rw-r--r--fs/xfs/xfs_log.c50
-rw-r--r--fs/xfs/xfs_log_recover.c8
5 files changed, 43 insertions, 37 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c
index 41b80d3d3877..d68326a0d51c 100644
--- a/fs/xfs/libxfs/xfs_dir2_node.c
+++ b/fs/xfs/libxfs/xfs_dir2_node.c
@@ -1845,8 +1845,7 @@ xfs_dir2_node_addname_int(
1845 1845
1846 if (dp->d_ops->db_to_fdb(args->geo, dbno) != fbno) { 1846 if (dp->d_ops->db_to_fdb(args->geo, dbno) != fbno) {
1847 xfs_alert(mp, 1847 xfs_alert(mp,
1848 "%s: dir ino %llu needed freesp block %lld for\n" 1848"%s: dir ino %llu needed freesp block %lld for data block %lld, got %lld ifbno %llu lastfbno %d",
1849 " data block %lld, got %lld ifbno %llu lastfbno %d",
1850 __func__, (unsigned long long)dp->i_ino, 1849 __func__, (unsigned long long)dp->i_ino,
1851 (long long)dp->d_ops->db_to_fdb( 1850 (long long)dp->d_ops->db_to_fdb(
1852 args->geo, dbno), 1851 args->geo, dbno),
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index df9851c46b5c..a3f4504b1f1e 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -131,10 +131,11 @@ xfs_mount_validate_sb(
131 if (xfs_sb_has_compat_feature(sbp, 131 if (xfs_sb_has_compat_feature(sbp,
132 XFS_SB_FEAT_COMPAT_UNKNOWN)) { 132 XFS_SB_FEAT_COMPAT_UNKNOWN)) {
133 xfs_warn(mp, 133 xfs_warn(mp,
134"Superblock has unknown compatible features (0x%x) enabled.\n" 134"Superblock has unknown compatible features (0x%x) enabled.",
135"Using a more recent kernel is recommended.",
136 (sbp->sb_features_compat & 135 (sbp->sb_features_compat &
137 XFS_SB_FEAT_COMPAT_UNKNOWN)); 136 XFS_SB_FEAT_COMPAT_UNKNOWN));
137 xfs_warn(mp,
138"Using a more recent kernel is recommended.");
138 } 139 }
139 140
140 if (xfs_sb_has_ro_compat_feature(sbp, 141 if (xfs_sb_has_ro_compat_feature(sbp,
@@ -145,18 +146,21 @@ xfs_mount_validate_sb(
145 XFS_SB_FEAT_RO_COMPAT_UNKNOWN)); 146 XFS_SB_FEAT_RO_COMPAT_UNKNOWN));
146 if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { 147 if (!(mp->m_flags & XFS_MOUNT_RDONLY)) {
147 xfs_warn(mp, 148 xfs_warn(mp,
148"Attempted to mount read-only compatible filesystem read-write.\n" 149"Attempted to mount read-only compatible filesystem read-write.");
150 xfs_warn(mp,
149"Filesystem can only be safely mounted read only."); 151"Filesystem can only be safely mounted read only.");
152
150 return -EINVAL; 153 return -EINVAL;
151 } 154 }
152 } 155 }
153 if (xfs_sb_has_incompat_feature(sbp, 156 if (xfs_sb_has_incompat_feature(sbp,
154 XFS_SB_FEAT_INCOMPAT_UNKNOWN)) { 157 XFS_SB_FEAT_INCOMPAT_UNKNOWN)) {
155 xfs_warn(mp, 158 xfs_warn(mp,
156"Superblock has unknown incompatible features (0x%x) enabled.\n" 159"Superblock has unknown incompatible features (0x%x) enabled.",
157"Filesystem can not be safely mounted by this kernel.",
158 (sbp->sb_features_incompat & 160 (sbp->sb_features_incompat &
159 XFS_SB_FEAT_INCOMPAT_UNKNOWN)); 161 XFS_SB_FEAT_INCOMPAT_UNKNOWN));
162 xfs_warn(mp,
163"Filesystem can not be safely mounted by this kernel.");
160 return -EINVAL; 164 return -EINVAL;
161 } 165 }
162 } 166 }
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index a4b7d92e946c..d7dbd8120aaa 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1533,9 +1533,10 @@ xfs_wait_buftarg(
1533 list_del_init(&bp->b_lru); 1533 list_del_init(&bp->b_lru);
1534 if (bp->b_flags & XBF_WRITE_FAIL) { 1534 if (bp->b_flags & XBF_WRITE_FAIL) {
1535 xfs_alert(btp->bt_mount, 1535 xfs_alert(btp->bt_mount,
1536"Corruption Alert: Buffer at block 0x%llx had permanent write failures!\n" 1536"Corruption Alert: Buffer at block 0x%llx had permanent write failures!",
1537"Please run xfs_repair to determine the extent of the problem.",
1538 (long long)bp->b_bn); 1537 (long long)bp->b_bn);
1538 xfs_alert(btp->bt_mount,
1539"Please run xfs_repair to determine the extent of the problem.");
1539 } 1540 }
1540 xfs_buf_rele(bp); 1541 xfs_buf_rele(bp);
1541 } 1542 }
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 08d4fe46f0fa..6b5a84a05340 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -668,9 +668,9 @@ xfs_log_mount(
668 ASSERT(0); 668 ASSERT(0);
669 goto out_free_log; 669 goto out_free_log;
670 } 670 }
671 xfs_crit(mp, "Log size out of supported range.");
671 xfs_crit(mp, 672 xfs_crit(mp,
672"Log size out of supported range. Continuing onwards, but if log hangs are\n" 673"Continuing onwards, but if log hangs are experienced then please report this message in the bug report.");
673"experienced then please report this message in the bug report.");
674 } 674 }
675 675
676 /* 676 /*
@@ -1142,11 +1142,13 @@ xlog_space_left(
1142 * In this case we just want to return the size of the 1142 * In this case we just want to return the size of the
1143 * log as the amount of space left. 1143 * log as the amount of space left.
1144 */ 1144 */
1145 xfs_alert(log->l_mp, "xlog_space_left: head behind tail");
1145 xfs_alert(log->l_mp, 1146 xfs_alert(log->l_mp,
1146 "xlog_space_left: head behind tail\n" 1147 " tail_cycle = %d, tail_bytes = %d",
1147 " tail_cycle = %d, tail_bytes = %d\n" 1148 tail_cycle, tail_bytes);
1148 " GH cycle = %d, GH bytes = %d", 1149 xfs_alert(log->l_mp,
1149 tail_cycle, tail_bytes, head_cycle, head_bytes); 1150 " GH cycle = %d, GH bytes = %d",
1151 head_cycle, head_bytes);
1150 ASSERT(0); 1152 ASSERT(0);
1151 free_bytes = log->l_logsize; 1153 free_bytes = log->l_logsize;
1152 } 1154 }
@@ -2028,26 +2030,24 @@ xlog_print_tic_res(
2028 "SWAPEXT" 2030 "SWAPEXT"
2029 }; 2031 };
2030 2032
2031 xfs_warn(mp, 2033 xfs_warn(mp, "xlog_write: reservation summary:");
2032 "xlog_write: reservation summary:\n" 2034 xfs_warn(mp, " trans type = %s (%u)",
2033 " trans type = %s (%u)\n" 2035 ((ticket->t_trans_type <= 0 ||
2034 " unit res = %d bytes\n" 2036 ticket->t_trans_type > XFS_TRANS_TYPE_MAX) ?
2035 " current res = %d bytes\n"
2036 " total reg = %u bytes (o/flow = %u bytes)\n"
2037 " ophdrs = %u (ophdr space = %u bytes)\n"
2038 " ophdr + reg = %u bytes\n"
2039 " num regions = %u",
2040 ((ticket->t_trans_type <= 0 ||
2041 ticket->t_trans_type > XFS_TRANS_TYPE_MAX) ?
2042 "bad-trans-type" : trans_type_str[ticket->t_trans_type-1]), 2037 "bad-trans-type" : trans_type_str[ticket->t_trans_type-1]),
2043 ticket->t_trans_type, 2038 ticket->t_trans_type);
2044 ticket->t_unit_res, 2039 xfs_warn(mp, " unit res = %d bytes",
2045 ticket->t_curr_res, 2040 ticket->t_unit_res);
2046 ticket->t_res_arr_sum, ticket->t_res_o_flow, 2041 xfs_warn(mp, " current res = %d bytes",
2047 ticket->t_res_num_ophdrs, ophdr_spc, 2042 ticket->t_curr_res);
2048 ticket->t_res_arr_sum + 2043 xfs_warn(mp, " total reg = %u bytes (o/flow = %u bytes)",
2049 ticket->t_res_o_flow + ophdr_spc, 2044 ticket->t_res_arr_sum, ticket->t_res_o_flow);
2050 ticket->t_res_num); 2045 xfs_warn(mp, " ophdrs = %u (ophdr space = %u bytes)",
2046 ticket->t_res_num_ophdrs, ophdr_spc);
2047 xfs_warn(mp, " ophdr + reg = %u bytes",
2048 ticket->t_res_arr_sum + ticket->t_res_o_flow + ophdr_spc);
2049 xfs_warn(mp, " num regions = %u",
2050 ticket->t_res_num);
2051 2051
2052 for (i = 0; i < ticket->t_res_num; i++) { 2052 for (i = 0; i < ticket->t_res_num; i++) {
2053 uint r_type = ticket->t_res_arr[i].r_type; 2053 uint r_type = ticket->t_res_arr[i].r_type;
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 493a8ef146fc..8b00730344ba 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -4549,11 +4549,13 @@ xlog_recover(
4549 xfs_sb_has_incompat_log_feature(&log->l_mp->m_sb, 4549 xfs_sb_has_incompat_log_feature(&log->l_mp->m_sb,
4550 XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN)) { 4550 XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN)) {
4551 xfs_warn(log->l_mp, 4551 xfs_warn(log->l_mp,
4552"Superblock has unknown incompatible log features (0x%x) enabled.\n" 4552"Superblock has unknown incompatible log features (0x%x) enabled.",
4553"The log can not be fully and/or safely recovered by this kernel.\n"
4554"Please recover the log on a kernel that supports the unknown features.",
4555 (log->l_mp->m_sb.sb_features_log_incompat & 4553 (log->l_mp->m_sb.sb_features_log_incompat &
4556 XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN)); 4554 XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN));
4555 xfs_warn(log->l_mp,
4556"The log can not be fully and/or safely recovered by this kernel.");
4557 xfs_warn(log->l_mp,
4558"Please recover the log on a kernel that supports the unknown features.");
4557 return -EINVAL; 4559 return -EINVAL;
4558 } 4560 }
4559 4561