aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/quota/xfs_dquot.c4
-rw-r--r--fs/xfs/quota/xfs_dquot_item.c5
-rw-r--r--fs/xfs/quota/xfs_qm.c13
-rw-r--r--fs/xfs/support/debug.c20
-rw-r--r--fs/xfs/support/debug.h2
-rw-r--r--fs/xfs/xfs_bmap.c2
-rw-r--r--fs/xfs/xfs_dfrag.c4
-rw-r--r--fs/xfs/xfs_dir2.c2
-rw-r--r--fs/xfs/xfs_fsops.c6
-rw-r--r--fs/xfs/xfs_ialloc.c39
-rw-r--r--fs/xfs/xfs_inode.c17
-rw-r--r--fs/xfs/xfs_mount.c16
-rw-r--r--fs/xfs/xfs_vnodeops.c8
13 files changed, 53 insertions, 85 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
index 773adc80d6b4..e1ff7e507670 100644
--- a/fs/xfs/quota/xfs_dquot.c
+++ b/fs/xfs/quota/xfs_dquot.c
@@ -1393,8 +1393,8 @@ xfs_qm_dqpurge(
1393 */ 1393 */
1394 error = xfs_qm_dqflush(dqp, SYNC_WAIT); 1394 error = xfs_qm_dqflush(dqp, SYNC_WAIT);
1395 if (error) 1395 if (error)
1396 xfs_fs_cmn_err(CE_WARN, mp, 1396 xfs_warn(mp, "%s: dquot %p flush failed",
1397 "xfs_qm_dqpurge: dquot %p flush failed", dqp); 1397 __func__, dqp);
1398 xfs_dqflock(dqp); 1398 xfs_dqflock(dqp);
1399 } 1399 }
1400 ASSERT(atomic_read(&dqp->q_pincount) == 0); 1400 ASSERT(atomic_read(&dqp->q_pincount) == 0);
diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c
index 2a1f3dc10a02..9e0e2fa3f2c8 100644
--- a/fs/xfs/quota/xfs_dquot_item.c
+++ b/fs/xfs/quota/xfs_dquot_item.c
@@ -136,9 +136,8 @@ xfs_qm_dquot_logitem_push(
136 */ 136 */
137 error = xfs_qm_dqflush(dqp, 0); 137 error = xfs_qm_dqflush(dqp, 0);
138 if (error) 138 if (error)
139 xfs_fs_cmn_err(CE_WARN, dqp->q_mount, 139 xfs_warn(dqp->q_mount, "%s: push error %d on dqp %p",
140 "xfs_qm_dquot_logitem_push: push error %d on dqp %p", 140 __func__, error, dqp);
141 error, dqp);
142 xfs_dqunlock(dqp); 141 xfs_dqunlock(dqp);
143} 142}
144 143
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index dd5cc5738a2c..e34dce1ce542 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -402,14 +402,13 @@ xfs_qm_mount_quotas(
402 * off, but the on disk superblock doesn't know that ! 402 * off, but the on disk superblock doesn't know that !
403 */ 403 */
404 ASSERT(!(XFS_IS_QUOTA_RUNNING(mp))); 404 ASSERT(!(XFS_IS_QUOTA_RUNNING(mp)));
405 xfs_fs_cmn_err(CE_ALERT, mp, 405 xfs_alert(mp, "%s: Superblock update failed!",
406 "XFS mount_quotas: Superblock update failed!"); 406 __func__);
407 } 407 }
408 } 408 }
409 409
410 if (error) { 410 if (error) {
411 xfs_fs_cmn_err(CE_WARN, mp, 411 xfs_warn(mp, "Failed to initialize disk quotas.");
412 "Failed to initialize disk quotas.");
413 return; 412 return;
414 } 413 }
415 414
@@ -1257,7 +1256,7 @@ xfs_qm_qino_alloc(
1257 xfs_mod_sb(tp, sbfields); 1256 xfs_mod_sb(tp, sbfields);
1258 1257
1259 if ((error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES))) { 1258 if ((error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES))) {
1260 xfs_fs_cmn_err(CE_ALERT, mp, "XFS qino_alloc failed!"); 1259 xfs_alert(mp, "%s failed (error %d)!", __func__, error);
1261 return error; 1260 return error;
1262 } 1261 }
1263 return 0; 1262 return 0;
@@ -1930,8 +1929,8 @@ again:
1930 */ 1929 */
1931 error = xfs_qm_dqflush(dqp, 0); 1930 error = xfs_qm_dqflush(dqp, 0);
1932 if (error) { 1931 if (error) {
1933 xfs_fs_cmn_err(CE_WARN, mp, 1932 xfs_warn(mp, "%s: dquot %p flush failed",
1934 "xfs_qm_dqreclaim: dquot %p flush failed", dqp); 1933 __func__, dqp);
1935 } 1934 }
1936 goto dqunlock; 1935 goto dqunlock;
1937 } 1936 }
diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c
index feaca739d5cc..a1c7141af481 100644
--- a/fs/xfs/support/debug.c
+++ b/fs/xfs/support/debug.c
@@ -45,26 +45,6 @@ cmn_err(
45} 45}
46 46
47void 47void
48xfs_fs_cmn_err(
49 const char *lvl,
50 struct xfs_mount *mp,
51 const char *fmt,
52 ...)
53{
54 struct va_format vaf;
55 va_list args;
56
57 va_start(args, fmt);
58 vaf.fmt = fmt;
59 vaf.va = &args;
60
61 printk("%sFilesystem %s: %pV", lvl, mp->m_fsname, &vaf);
62 va_end(args);
63
64 BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0);
65}
66
67void
68assfail(char *expr, char *file, int line) 48assfail(char *expr, char *file, int line)
69{ 49{
70 printk(KERN_CRIT "Assertion failed: %s, file: %s, line: %d\n", expr, 50 printk(KERN_CRIT "Assertion failed: %s, file: %s, line: %d\n", expr,
diff --git a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h
index eaeaa17ef4b8..4a082b9a1161 100644
--- a/fs/xfs/support/debug.h
+++ b/fs/xfs/support/debug.h
@@ -31,8 +31,6 @@ struct xfs_mount;
31 31
32void cmn_err(const char *lvl, const char *fmt, ...) 32void cmn_err(const char *lvl, const char *fmt, ...)
33 __attribute__ ((format (printf, 2, 3))); 33 __attribute__ ((format (printf, 2, 3)));
34void xfs_fs_cmn_err( const char *lvl, struct xfs_mount *mp,
35 const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
36 34
37extern void assfail(char *expr, char *f, int l); 35extern void assfail(char *expr, char *f, int l);
38 36
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index ded532dc0699..92612f6b4b3e 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -6150,7 +6150,7 @@ xfs_bmap_punch_delalloc_range(
6150 if (error) { 6150 if (error) {
6151 /* something screwed, just bail */ 6151 /* something screwed, just bail */
6152 if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { 6152 if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
6153 xfs_fs_cmn_err(CE_ALERT, ip->i_mount, 6153 xfs_alert(ip->i_mount,
6154 "Failed delalloc mapping lookup ino %lld fsb %lld.", 6154 "Failed delalloc mapping lookup ino %lld fsb %lld.",
6155 ip->i_ino, start_fsb); 6155 ip->i_ino, start_fsb);
6156 } 6156 }
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c
index e60490bc00a6..be628677c288 100644
--- a/fs/xfs/xfs_dfrag.c
+++ b/fs/xfs/xfs_dfrag.c
@@ -270,9 +270,9 @@ xfs_swap_extents(
270 /* check inode formats now that data is flushed */ 270 /* check inode formats now that data is flushed */
271 error = xfs_swap_extents_check_format(ip, tip); 271 error = xfs_swap_extents_check_format(ip, tip);
272 if (error) { 272 if (error) {
273 xfs_fs_cmn_err(CE_NOTE, mp, 273 xfs_notice(mp,
274 "%s: inode 0x%llx format is incompatible for exchanging.", 274 "%s: inode 0x%llx format is incompatible for exchanging.",
275 __FILE__, ip->i_ino); 275 __func__, ip->i_ino);
276 goto out_unlock; 276 goto out_unlock;
277 } 277 }
278 278
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index a1321bc7f192..dba7a71cedf3 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -159,7 +159,7 @@ xfs_dir_ino_validate(
159 XFS_AGINO_TO_INO(mp, agno, agino) == ino; 159 XFS_AGINO_TO_INO(mp, agno, agino) == ino;
160 if (unlikely(XFS_TEST_ERROR(!ino_ok, mp, XFS_ERRTAG_DIR_INO_VALIDATE, 160 if (unlikely(XFS_TEST_ERROR(!ino_ok, mp, XFS_ERRTAG_DIR_INO_VALIDATE,
161 XFS_RANDOM_DIR_INO_VALIDATE))) { 161 XFS_RANDOM_DIR_INO_VALIDATE))) {
162 xfs_fs_cmn_err(CE_WARN, mp, "Invalid inode number 0x%Lx", 162 xfs_warn(mp, "Invalid inode number 0x%Lx",
163 (unsigned long long) ino); 163 (unsigned long long) ino);
164 XFS_ERROR_REPORT("xfs_dir_ino_validate", XFS_ERRLEVEL_LOW, mp); 164 XFS_ERROR_REPORT("xfs_dir_ino_validate", XFS_ERRLEVEL_LOW, mp);
165 return XFS_ERROR(EFSCORRUPTED); 165 return XFS_ERROR(EFSCORRUPTED);
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 85668efb3e3e..9153d2c77caf 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -385,8 +385,8 @@ xfs_growfs_data_private(
385 XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)), 385 XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)),
386 XFS_FSS_TO_BB(mp, 1), 0, &bp); 386 XFS_FSS_TO_BB(mp, 1), 0, &bp);
387 if (error) { 387 if (error) {
388 xfs_fs_cmn_err(CE_WARN, mp, 388 xfs_warn(mp,
389 "error %d reading secondary superblock for ag %d", 389 "error %d reading secondary superblock for ag %d",
390 error, agno); 390 error, agno);
391 break; 391 break;
392 } 392 }
@@ -399,7 +399,7 @@ xfs_growfs_data_private(
399 if (!(error = xfs_bwrite(mp, bp))) { 399 if (!(error = xfs_bwrite(mp, bp))) {
400 continue; 400 continue;
401 } else { 401 } else {
402 xfs_fs_cmn_err(CE_WARN, mp, 402 xfs_warn(mp,
403 "write error %d updating secondary superblock for ag %d", 403 "write error %d updating secondary superblock for ag %d",
404 error, agno); 404 error, agno);
405 break; /* no point in continuing */ 405 break; /* no point in continuing */
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index 0626a32c3447..fc3a2cb2c075 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -1218,10 +1218,9 @@ xfs_imap_lookup(
1218 1218
1219 error = xfs_ialloc_read_agi(mp, tp, agno, &agbp); 1219 error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
1220 if (error) { 1220 if (error) {
1221 xfs_fs_cmn_err(CE_ALERT, mp, "xfs_imap: " 1221 xfs_alert(mp,
1222 "xfs_ialloc_read_agi() returned " 1222 "%s: xfs_ialloc_read_agi() returned error %d, agno %d",
1223 "error %d, agno %d", 1223 __func__, error, agno);
1224 error, agno);
1225 return error; 1224 return error;
1226 } 1225 }
1227 1226
@@ -1299,24 +1298,21 @@ xfs_imap(
1299 if (flags & XFS_IGET_UNTRUSTED) 1298 if (flags & XFS_IGET_UNTRUSTED)
1300 return XFS_ERROR(EINVAL); 1299 return XFS_ERROR(EINVAL);
1301 if (agno >= mp->m_sb.sb_agcount) { 1300 if (agno >= mp->m_sb.sb_agcount) {
1302 xfs_fs_cmn_err(CE_ALERT, mp, 1301 xfs_alert(mp,
1303 "xfs_imap: agno (%d) >= " 1302 "%s: agno (%d) >= mp->m_sb.sb_agcount (%d)",
1304 "mp->m_sb.sb_agcount (%d)", 1303 __func__, agno, mp->m_sb.sb_agcount);
1305 agno, mp->m_sb.sb_agcount);
1306 } 1304 }
1307 if (agbno >= mp->m_sb.sb_agblocks) { 1305 if (agbno >= mp->m_sb.sb_agblocks) {
1308 xfs_fs_cmn_err(CE_ALERT, mp, 1306 xfs_alert(mp,
1309 "xfs_imap: agbno (0x%llx) >= " 1307 "%s: agbno (0x%llx) >= mp->m_sb.sb_agblocks (0x%lx)",
1310 "mp->m_sb.sb_agblocks (0x%lx)", 1308 __func__, (unsigned long long)agbno,
1311 (unsigned long long) agbno, 1309 (unsigned long)mp->m_sb.sb_agblocks);
1312 (unsigned long) mp->m_sb.sb_agblocks);
1313 } 1310 }
1314 if (ino != XFS_AGINO_TO_INO(mp, agno, agino)) { 1311 if (ino != XFS_AGINO_TO_INO(mp, agno, agino)) {
1315 xfs_fs_cmn_err(CE_ALERT, mp, 1312 xfs_alert(mp,
1316 "xfs_imap: ino (0x%llx) != " 1313 "%s: ino (0x%llx) != XFS_AGINO_TO_INO() (0x%llx)",
1317 "XFS_AGINO_TO_INO(mp, agno, agino) " 1314 __func__, ino,
1318 "(0x%llx)", 1315 XFS_AGINO_TO_INO(mp, agno, agino));
1319 ino, XFS_AGINO_TO_INO(mp, agno, agino));
1320 } 1316 }
1321 xfs_stack_trace(); 1317 xfs_stack_trace();
1322#endif /* DEBUG */ 1318#endif /* DEBUG */
@@ -1388,10 +1384,9 @@ out_map:
1388 */ 1384 */
1389 if ((imap->im_blkno + imap->im_len) > 1385 if ((imap->im_blkno + imap->im_len) >
1390 XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) { 1386 XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) {
1391 xfs_fs_cmn_err(CE_ALERT, mp, "xfs_imap: " 1387 xfs_alert(mp,
1392 "(imap->im_blkno (0x%llx) + imap->im_len (0x%llx)) > " 1388 "%s: (im_blkno (0x%llx) + im_len (0x%llx)) > sb_dblocks (0x%llx)",
1393 " XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks) (0x%llx)", 1389 __func__, (unsigned long long) imap->im_blkno,
1394 (unsigned long long) imap->im_blkno,
1395 (unsigned long long) imap->im_len, 1390 (unsigned long long) imap->im_len,
1396 XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)); 1391 XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks));
1397 return XFS_ERROR(EINVAL); 1392 return XFS_ERROR(EINVAL);
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 55169bbfc820..d820ada49b18 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -110,8 +110,8 @@ xfs_inobp_check(
110 dip = (xfs_dinode_t *)xfs_buf_offset(bp, 110 dip = (xfs_dinode_t *)xfs_buf_offset(bp,
111 i * mp->m_sb.sb_inodesize); 111 i * mp->m_sb.sb_inodesize);
112 if (!dip->di_next_unlinked) { 112 if (!dip->di_next_unlinked) {
113 xfs_fs_cmn_err(CE_ALERT, mp, 113 xfs_alert(mp,
114 "Detected a bogus zero next_unlinked field in incore inode buffer 0x%p. About to pop an ASSERT.", 114 "Detected bogus zero next_unlinked field in incore inode buffer 0x%p.",
115 bp); 115 bp);
116 ASSERT(dip->di_next_unlinked); 116 ASSERT(dip->di_next_unlinked);
117 } 117 }
@@ -806,11 +806,9 @@ xfs_iread(
806 */ 806 */
807 if (be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC) { 807 if (be16_to_cpu(dip->di_magic) != XFS_DINODE_MAGIC) {
808#ifdef DEBUG 808#ifdef DEBUG
809 xfs_fs_cmn_err(CE_ALERT, mp, "xfs_iread: " 809 xfs_alert(mp,
810 "dip->di_magic (0x%x) != " 810 "%s: dip->di_magic (0x%x) != XFS_DINODE_MAGIC (0x%x)",
811 "XFS_DINODE_MAGIC (0x%x)", 811 __func__, be16_to_cpu(dip->di_magic), XFS_DINODE_MAGIC);
812 be16_to_cpu(dip->di_magic),
813 XFS_DINODE_MAGIC);
814#endif /* DEBUG */ 812#endif /* DEBUG */
815 error = XFS_ERROR(EINVAL); 813 error = XFS_ERROR(EINVAL);
816 goto out_brelse; 814 goto out_brelse;
@@ -828,9 +826,8 @@ xfs_iread(
828 error = xfs_iformat(ip, dip); 826 error = xfs_iformat(ip, dip);
829 if (error) { 827 if (error) {
830#ifdef DEBUG 828#ifdef DEBUG
831 xfs_fs_cmn_err(CE_ALERT, mp, "xfs_iread: " 829 xfs_alert(mp, "%s: xfs_iformat() returned error %d",
832 "xfs_iformat() returned error %d", 830 __func__, error);
833 error);
834#endif /* DEBUG */ 831#endif /* DEBUG */
835 goto out_brelse; 832 goto out_brelse;
836 } 833 }
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 1b43ad3d6ddb..e39b082eb049 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -881,8 +881,9 @@ xfs_update_alignment(xfs_mount_t *mp)
881 if (mp->m_flags & XFS_MOUNT_RETERR) { 881 if (mp->m_flags & XFS_MOUNT_RETERR) {
882 return XFS_ERROR(EINVAL); 882 return XFS_ERROR(EINVAL);
883 } 883 }
884 xfs_fs_cmn_err(CE_WARN, mp, 884 xfs_warn(mp,
885"stripe alignment turned off: sunit(%d)/swidth(%d) incompatible with agsize(%d)", 885 "stripe alignment turned off: sunit(%d)/swidth(%d) "
886 "incompatible with agsize(%d)",
886 mp->m_dalign, mp->m_swidth, 887 mp->m_dalign, mp->m_swidth,
887 sbp->sb_agblocks); 888 sbp->sb_agblocks);
888 889
@@ -892,9 +893,9 @@ xfs_update_alignment(xfs_mount_t *mp)
892 mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth); 893 mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth);
893 } else { 894 } else {
894 if (mp->m_flags & XFS_MOUNT_RETERR) { 895 if (mp->m_flags & XFS_MOUNT_RETERR) {
895 xfs_fs_cmn_err(CE_WARN, mp, 896 xfs_warn(mp,
896"stripe alignment turned off: sunit(%d) less than bsize(%d)", 897 "stripe alignment turned off: sunit(%d) less than bsize(%d)",
897 mp->m_dalign, 898 mp->m_dalign,
898 mp->m_blockmask +1); 899 mp->m_blockmask +1);
899 return XFS_ERROR(EINVAL); 900 return XFS_ERROR(EINVAL);
900 } 901 }
@@ -1100,7 +1101,7 @@ xfs_mount_reset_sbqflags(
1100 return 0; 1101 return 0;
1101 1102
1102#ifdef QUOTADEBUG 1103#ifdef QUOTADEBUG
1103 xfs_fs_cmn_err(CE_NOTE, mp, "Writing superblock quota changes"); 1104 xfs_notice(mp, "Writing superblock quota changes");
1104#endif 1105#endif
1105 1106
1106 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE); 1107 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE);
@@ -1108,8 +1109,7 @@ xfs_mount_reset_sbqflags(
1108 XFS_DEFAULT_LOG_COUNT); 1109 XFS_DEFAULT_LOG_COUNT);
1109 if (error) { 1110 if (error) {
1110 xfs_trans_cancel(tp, 0); 1111 xfs_trans_cancel(tp, 0);
1111 xfs_fs_cmn_err(CE_ALERT, mp, 1112 xfs_alert(mp, "%s: Superblock update failed!", __func__);
1112 "xfs_mount_reset_sbqflags: Superblock update failed!");
1113 return error; 1113 return error;
1114 } 1114 }
1115 1115
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 258d4f98eb9b..e919ae1e9c65 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1208,12 +1208,12 @@ xfs_inactive(
1208 */ 1208 */
1209 error = xfs_bmap_finish(&tp, &free_list, &committed); 1209 error = xfs_bmap_finish(&tp, &free_list, &committed);
1210 if (error) 1210 if (error)
1211 xfs_fs_cmn_err(CE_NOTE, mp, "xfs_inactive: " 1211 xfs_notice(mp, "%s: xfs_bmap_finish returned error %d",
1212 "xfs_bmap_finish() returned error %d", error); 1212 __func__, error);
1213 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); 1213 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
1214 if (error) 1214 if (error)
1215 xfs_fs_cmn_err(CE_NOTE, mp, "xfs_inactive: " 1215 xfs_notice(mp, "%s: xfs_trans_commit returned error %d",
1216 "xfs_trans_commit() returned error %d", error); 1216 __func__, error);
1217 } 1217 }
1218 1218
1219 /* 1219 /*