diff options
author | Dave Chinner <dchinner@redhat.com> | 2011-03-06 18:08:35 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2011-03-06 18:08:35 -0500 |
commit | 0b932cccbdc09a72aa370456a59b40ecd6b10baf (patch) | |
tree | e13910b0589804e7e56e765e931c781829bafe8c /fs/xfs | |
parent | 8221112b4377a3b69f2016b5cc3c550d51dd3139 (diff) |
xfs: Convert remaining cmn_err() callers to new API
Once converted, kill the remainder of the cmn_err() interface.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/quota/xfs_dquot.c | 34 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 27 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm_bhv.c | 3 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm_syscalls.c | 58 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_trans_dquot.c | 5 | ||||
-rw-r--r-- | fs/xfs/support/debug.c | 26 | ||||
-rw-r--r-- | fs/xfs/support/debug.h | 12 | ||||
-rw-r--r-- | fs/xfs/xfs_bmap.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 15 | ||||
-rw-r--r-- | fs/xfs/xfs_da_btree.c | 9 | ||||
-rw-r--r-- | fs/xfs/xfs_dir2_node.c | 25 | ||||
-rw-r--r-- | fs/xfs/xfs_error.c | 16 | ||||
-rw-r--r-- | fs/xfs/xfs_ialloc.c | 43 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 30 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.c | 60 | ||||
-rw-r--r-- | fs/xfs/xfs_rtalloc.c | 8 | ||||
-rw-r--r-- | fs/xfs/xfs_rtalloc.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_rw.c | 17 | ||||
-rw-r--r-- | fs/xfs/xfs_trans_buf.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 5 |
20 files changed, 169 insertions, 238 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index e1ff7e507670..7e2416478503 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c | |||
@@ -828,7 +828,7 @@ xfs_qm_dqget( | |||
828 | if (xfs_do_dqerror) { | 828 | if (xfs_do_dqerror) { |
829 | if ((xfs_dqerror_target == mp->m_ddev_targp) && | 829 | if ((xfs_dqerror_target == mp->m_ddev_targp) && |
830 | (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) { | 830 | (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) { |
831 | cmn_err(CE_DEBUG, "Returning error in dqget"); | 831 | xfs_debug(mp, "Returning error in dqget"); |
832 | return (EIO); | 832 | return (EIO); |
833 | } | 833 | } |
834 | } | 834 | } |
@@ -1427,36 +1427,38 @@ xfs_qm_dqpurge( | |||
1427 | void | 1427 | void |
1428 | xfs_qm_dqprint(xfs_dquot_t *dqp) | 1428 | xfs_qm_dqprint(xfs_dquot_t *dqp) |
1429 | { | 1429 | { |
1430 | cmn_err(CE_DEBUG, "-----------KERNEL DQUOT----------------"); | 1430 | struct xfs_mount *mp = dqp->q_mount; |
1431 | cmn_err(CE_DEBUG, "---- dquotID = %d", | 1431 | |
1432 | xfs_debug(mp, "-----------KERNEL DQUOT----------------"); | ||
1433 | xfs_debug(mp, "---- dquotID = %d", | ||
1432 | (int)be32_to_cpu(dqp->q_core.d_id)); | 1434 | (int)be32_to_cpu(dqp->q_core.d_id)); |
1433 | cmn_err(CE_DEBUG, "---- type = %s", DQFLAGTO_TYPESTR(dqp)); | 1435 | xfs_debug(mp, "---- type = %s", DQFLAGTO_TYPESTR(dqp)); |
1434 | cmn_err(CE_DEBUG, "---- fs = 0x%p", dqp->q_mount); | 1436 | xfs_debug(mp, "---- fs = 0x%p", dqp->q_mount); |
1435 | cmn_err(CE_DEBUG, "---- blkno = 0x%x", (int) dqp->q_blkno); | 1437 | xfs_debug(mp, "---- blkno = 0x%x", (int) dqp->q_blkno); |
1436 | cmn_err(CE_DEBUG, "---- boffset = 0x%x", (int) dqp->q_bufoffset); | 1438 | xfs_debug(mp, "---- boffset = 0x%x", (int) dqp->q_bufoffset); |
1437 | cmn_err(CE_DEBUG, "---- blkhlimit = %Lu (0x%x)", | 1439 | xfs_debug(mp, "---- blkhlimit = %Lu (0x%x)", |
1438 | be64_to_cpu(dqp->q_core.d_blk_hardlimit), | 1440 | be64_to_cpu(dqp->q_core.d_blk_hardlimit), |
1439 | (int)be64_to_cpu(dqp->q_core.d_blk_hardlimit)); | 1441 | (int)be64_to_cpu(dqp->q_core.d_blk_hardlimit)); |
1440 | cmn_err(CE_DEBUG, "---- blkslimit = %Lu (0x%x)", | 1442 | xfs_debug(mp, "---- blkslimit = %Lu (0x%x)", |
1441 | be64_to_cpu(dqp->q_core.d_blk_softlimit), | 1443 | be64_to_cpu(dqp->q_core.d_blk_softlimit), |
1442 | (int)be64_to_cpu(dqp->q_core.d_blk_softlimit)); | 1444 | (int)be64_to_cpu(dqp->q_core.d_blk_softlimit)); |
1443 | cmn_err(CE_DEBUG, "---- inohlimit = %Lu (0x%x)", | 1445 | xfs_debug(mp, "---- inohlimit = %Lu (0x%x)", |
1444 | be64_to_cpu(dqp->q_core.d_ino_hardlimit), | 1446 | be64_to_cpu(dqp->q_core.d_ino_hardlimit), |
1445 | (int)be64_to_cpu(dqp->q_core.d_ino_hardlimit)); | 1447 | (int)be64_to_cpu(dqp->q_core.d_ino_hardlimit)); |
1446 | cmn_err(CE_DEBUG, "---- inoslimit = %Lu (0x%x)", | 1448 | xfs_debug(mp, "---- inoslimit = %Lu (0x%x)", |
1447 | be64_to_cpu(dqp->q_core.d_ino_softlimit), | 1449 | be64_to_cpu(dqp->q_core.d_ino_softlimit), |
1448 | (int)be64_to_cpu(dqp->q_core.d_ino_softlimit)); | 1450 | (int)be64_to_cpu(dqp->q_core.d_ino_softlimit)); |
1449 | cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)", | 1451 | xfs_debug(mp, "---- bcount = %Lu (0x%x)", |
1450 | be64_to_cpu(dqp->q_core.d_bcount), | 1452 | be64_to_cpu(dqp->q_core.d_bcount), |
1451 | (int)be64_to_cpu(dqp->q_core.d_bcount)); | 1453 | (int)be64_to_cpu(dqp->q_core.d_bcount)); |
1452 | cmn_err(CE_DEBUG, "---- icount = %Lu (0x%x)", | 1454 | xfs_debug(mp, "---- icount = %Lu (0x%x)", |
1453 | be64_to_cpu(dqp->q_core.d_icount), | 1455 | be64_to_cpu(dqp->q_core.d_icount), |
1454 | (int)be64_to_cpu(dqp->q_core.d_icount)); | 1456 | (int)be64_to_cpu(dqp->q_core.d_icount)); |
1455 | cmn_err(CE_DEBUG, "---- btimer = %d", | 1457 | xfs_debug(mp, "---- btimer = %d", |
1456 | (int)be32_to_cpu(dqp->q_core.d_btimer)); | 1458 | (int)be32_to_cpu(dqp->q_core.d_btimer)); |
1457 | cmn_err(CE_DEBUG, "---- itimer = %d", | 1459 | xfs_debug(mp, "---- itimer = %d", |
1458 | (int)be32_to_cpu(dqp->q_core.d_itimer)); | 1460 | (int)be32_to_cpu(dqp->q_core.d_itimer)); |
1459 | cmn_err(CE_DEBUG, "---------------------------"); | 1461 | xfs_debug(mp, "---------------------------"); |
1460 | } | 1462 | } |
1461 | #endif | 1463 | #endif |
1462 | 1464 | ||
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index e34dce1ce542..254ee062bd7d 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -80,7 +80,7 @@ xfs_qm_dquot_list_print( | |||
80 | int i = 0; | 80 | int i = 0; |
81 | 81 | ||
82 | list_for_each_entry(dqp, &mp->m_quotainfo->qi_dqlist_lock, qi_mplist) { | 82 | list_for_each_entry(dqp, &mp->m_quotainfo->qi_dqlist_lock, qi_mplist) { |
83 | cmn_err(CE_DEBUG, " %d. \"%d (%s)\" " | 83 | xfs_debug(mp, " %d. \"%d (%s)\" " |
84 | "bcnt = %lld, icnt = %lld, refs = %d", | 84 | "bcnt = %lld, icnt = %lld, refs = %d", |
85 | i++, be32_to_cpu(dqp->q_core.d_id), | 85 | i++, be32_to_cpu(dqp->q_core.d_id), |
86 | DQFLAGTO_TYPESTR(dqp), | 86 | DQFLAGTO_TYPESTR(dqp), |
@@ -205,7 +205,7 @@ xfs_qm_destroy( | |||
205 | list_for_each_entry_safe(dqp, n, &xqm->qm_dqfrlist, q_freelist) { | 205 | list_for_each_entry_safe(dqp, n, &xqm->qm_dqfrlist, q_freelist) { |
206 | xfs_dqlock(dqp); | 206 | xfs_dqlock(dqp); |
207 | #ifdef QUOTADEBUG | 207 | #ifdef QUOTADEBUG |
208 | cmn_err(CE_DEBUG, "FREELIST destroy 0x%p", dqp); | 208 | xfs_debug(dqp->q_mount, "FREELIST destroy 0x%p", dqp); |
209 | #endif | 209 | #endif |
210 | list_del_init(&dqp->q_freelist); | 210 | list_del_init(&dqp->q_freelist); |
211 | xfs_Gqm->qm_dqfrlist_cnt--; | 211 | xfs_Gqm->qm_dqfrlist_cnt--; |
@@ -341,9 +341,7 @@ xfs_qm_mount_quotas( | |||
341 | * quotas immediately. | 341 | * quotas immediately. |
342 | */ | 342 | */ |
343 | if (mp->m_sb.sb_rextents) { | 343 | if (mp->m_sb.sb_rextents) { |
344 | cmn_err(CE_NOTE, | 344 | xfs_notice(mp, "Cannot turn on quotas for realtime filesystem"); |
345 | "Cannot turn on quotas for realtime filesystem %s", | ||
346 | mp->m_fsname); | ||
347 | mp->m_qflags = 0; | 345 | mp->m_qflags = 0; |
348 | goto write_changes; | 346 | goto write_changes; |
349 | } | 347 | } |
@@ -1668,7 +1666,7 @@ xfs_qm_quotacheck( | |||
1668 | */ | 1666 | */ |
1669 | ASSERT(list_empty(&mp->m_quotainfo->qi_dqlist)); | 1667 | ASSERT(list_empty(&mp->m_quotainfo->qi_dqlist)); |
1670 | 1668 | ||
1671 | cmn_err(CE_NOTE, "XFS quotacheck %s: Please wait.", mp->m_fsname); | 1669 | xfs_notice(mp, "Quotacheck needed: Please wait."); |
1672 | 1670 | ||
1673 | /* | 1671 | /* |
1674 | * First we go thru all the dquots on disk, USR and GRP/PRJ, and reset | 1672 | * First we go thru all the dquots on disk, USR and GRP/PRJ, and reset |
@@ -1746,9 +1744,9 @@ xfs_qm_quotacheck( | |||
1746 | 1744 | ||
1747 | error_return: | 1745 | error_return: |
1748 | if (error) { | 1746 | if (error) { |
1749 | cmn_err(CE_WARN, "XFS quotacheck %s: Unsuccessful (Error %d): " | 1747 | xfs_warn(mp, |
1750 | "Disabling quotas.", | 1748 | "Quotacheck: Unsuccessful (Error %d): Disabling quotas.", |
1751 | mp->m_fsname, error); | 1749 | error); |
1752 | /* | 1750 | /* |
1753 | * We must turn off quotas. | 1751 | * We must turn off quotas. |
1754 | */ | 1752 | */ |
@@ -1756,12 +1754,11 @@ xfs_qm_quotacheck( | |||
1756 | ASSERT(xfs_Gqm != NULL); | 1754 | ASSERT(xfs_Gqm != NULL); |
1757 | xfs_qm_destroy_quotainfo(mp); | 1755 | xfs_qm_destroy_quotainfo(mp); |
1758 | if (xfs_mount_reset_sbqflags(mp)) { | 1756 | if (xfs_mount_reset_sbqflags(mp)) { |
1759 | cmn_err(CE_WARN, "XFS quotacheck %s: " | 1757 | xfs_warn(mp, |
1760 | "Failed to reset quota flags.", mp->m_fsname); | 1758 | "Quotacheck: Failed to reset quota flags."); |
1761 | } | 1759 | } |
1762 | } else { | 1760 | } else |
1763 | cmn_err(CE_NOTE, "XFS quotacheck %s: Done.", mp->m_fsname); | 1761 | xfs_notice(mp, "Quotacheck: Done."); |
1764 | } | ||
1765 | return (error); | 1762 | return (error); |
1766 | } | 1763 | } |
1767 | 1764 | ||
@@ -2107,7 +2104,7 @@ xfs_qm_write_sb_changes( | |||
2107 | int error; | 2104 | int error; |
2108 | 2105 | ||
2109 | #ifdef QUOTADEBUG | 2106 | #ifdef QUOTADEBUG |
2110 | cmn_err(CE_NOTE, "Writing superblock quota changes :%s", mp->m_fsname); | 2107 | xfs_notice(mp, "Writing superblock quota changes"); |
2111 | #endif | 2108 | #endif |
2112 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE); | 2109 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE); |
2113 | if ((error = xfs_trans_reserve(tp, 0, | 2110 | if ((error = xfs_trans_reserve(tp, 0, |
diff --git a/fs/xfs/quota/xfs_qm_bhv.c b/fs/xfs/quota/xfs_qm_bhv.c index 45b5cb1788ab..774d7ec6df8e 100644 --- a/fs/xfs/quota/xfs_qm_bhv.c +++ b/fs/xfs/quota/xfs_qm_bhv.c | |||
@@ -119,8 +119,7 @@ xfs_qm_newmount( | |||
119 | (gquotaondisk && !XFS_IS_GQUOTA_ON(mp)) || | 119 | (gquotaondisk && !XFS_IS_GQUOTA_ON(mp)) || |
120 | (!gquotaondisk && XFS_IS_OQUOTA_ON(mp))) && | 120 | (!gquotaondisk && XFS_IS_OQUOTA_ON(mp))) && |
121 | xfs_dev_is_read_only(mp, "changing quota state")) { | 121 | xfs_dev_is_read_only(mp, "changing quota state")) { |
122 | cmn_err(CE_WARN, | 122 | xfs_warn(mp, "please mount with%s%s%s%s.", |
123 | "XFS: please mount with%s%s%s%s.", | ||
124 | (!quotaondisk ? "out quota" : ""), | 123 | (!quotaondisk ? "out quota" : ""), |
125 | (uquotaondisk ? " usrquota" : ""), | 124 | (uquotaondisk ? " usrquota" : ""), |
126 | (pquotaondisk ? " prjquota" : ""), | 125 | (pquotaondisk ? " prjquota" : ""), |
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 603ab867259e..c82f06778a27 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c | |||
@@ -936,10 +936,11 @@ struct mutex qcheck_lock; | |||
936 | #define DQTEST_LIST_PRINT(l, NXT, title) \ | 936 | #define DQTEST_LIST_PRINT(l, NXT, title) \ |
937 | { \ | 937 | { \ |
938 | xfs_dqtest_t *dqp; int i = 0;\ | 938 | xfs_dqtest_t *dqp; int i = 0;\ |
939 | cmn_err(CE_DEBUG, "%s (#%d)", title, (int) (l)->qh_nelems); \ | 939 | xfs_debug(NULL, "%s (#%d)", title, (int) (l)->qh_nelems); \ |
940 | for (dqp = (xfs_dqtest_t *)(l)->qh_next; dqp != NULL; \ | 940 | for (dqp = (xfs_dqtest_t *)(l)->qh_next; dqp != NULL; \ |
941 | dqp = (xfs_dqtest_t *)dqp->NXT) { \ | 941 | dqp = (xfs_dqtest_t *)dqp->NXT) { \ |
942 | cmn_err(CE_DEBUG, " %d. \"%d (%s)\" bcnt = %d, icnt = %d", \ | 942 | xfs_debug(dqp->q_mount, \ |
943 | " %d. \"%d (%s)\" bcnt = %d, icnt = %d", \ | ||
943 | ++i, dqp->d_id, DQFLAGTO_TYPESTR(dqp), \ | 944 | ++i, dqp->d_id, DQFLAGTO_TYPESTR(dqp), \ |
944 | dqp->d_bcount, dqp->d_icount); } \ | 945 | dqp->d_bcount, dqp->d_icount); } \ |
945 | } | 946 | } |
@@ -963,16 +964,17 @@ xfs_qm_hashinsert(xfs_dqhash_t *h, xfs_dqtest_t *dqp) | |||
963 | } | 964 | } |
964 | STATIC void | 965 | STATIC void |
965 | xfs_qm_dqtest_print( | 966 | xfs_qm_dqtest_print( |
966 | xfs_dqtest_t *d) | 967 | struct xfs_mount *mp, |
968 | struct dqtest *d) | ||
967 | { | 969 | { |
968 | cmn_err(CE_DEBUG, "-----------DQTEST DQUOT----------------"); | 970 | xfs_debug(mp, "-----------DQTEST DQUOT----------------"); |
969 | cmn_err(CE_DEBUG, "---- dquot ID = %d", d->d_id); | 971 | xfs_debug(mp, "---- dquot ID = %d", d->d_id); |
970 | cmn_err(CE_DEBUG, "---- fs = 0x%p", d->q_mount); | 972 | xfs_debug(mp, "---- fs = 0x%p", d->q_mount); |
971 | cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)", | 973 | xfs_debug(mp, "---- bcount = %Lu (0x%x)", |
972 | d->d_bcount, (int)d->d_bcount); | 974 | d->d_bcount, (int)d->d_bcount); |
973 | cmn_err(CE_DEBUG, "---- icount = %Lu (0x%x)", | 975 | xfs_debug(mp, "---- icount = %Lu (0x%x)", |
974 | d->d_icount, (int)d->d_icount); | 976 | d->d_icount, (int)d->d_icount); |
975 | cmn_err(CE_DEBUG, "---------------------------"); | 977 | xfs_debug(mp, "---------------------------"); |
976 | } | 978 | } |
977 | 979 | ||
978 | STATIC void | 980 | STATIC void |
@@ -986,12 +988,14 @@ xfs_qm_dqtest_failed( | |||
986 | { | 988 | { |
987 | qmtest_nfails++; | 989 | qmtest_nfails++; |
988 | if (error) | 990 | if (error) |
989 | cmn_err(CE_DEBUG, "quotacheck failed id=%d, err=%d\nreason: %s", | 991 | xfs_debug(dqp->q_mount, |
990 | d->d_id, error, reason); | 992 | "quotacheck failed id=%d, err=%d\nreason: %s", |
993 | d->d_id, error, reason); | ||
991 | else | 994 | else |
992 | cmn_err(CE_DEBUG, "quotacheck failed id=%d (%s) [%d != %d]", | 995 | xfs_debug(dqp->q_mount, |
993 | d->d_id, reason, (int)a, (int)b); | 996 | "quotacheck failed id=%d (%s) [%d != %d]", |
994 | xfs_qm_dqtest_print(d); | 997 | d->d_id, reason, (int)a, (int)b); |
998 | xfs_qm_dqtest_print(dqp->q_mount, d); | ||
995 | if (dqp) | 999 | if (dqp) |
996 | xfs_qm_dqprint(dqp); | 1000 | xfs_qm_dqprint(dqp); |
997 | } | 1001 | } |
@@ -1018,9 +1022,9 @@ xfs_dqtest_cmp2( | |||
1018 | be64_to_cpu(dqp->q_core.d_bcount) >= | 1022 | be64_to_cpu(dqp->q_core.d_bcount) >= |
1019 | be64_to_cpu(dqp->q_core.d_blk_softlimit)) { | 1023 | be64_to_cpu(dqp->q_core.d_blk_softlimit)) { |
1020 | if (!dqp->q_core.d_btimer && dqp->q_core.d_id) { | 1024 | if (!dqp->q_core.d_btimer && dqp->q_core.d_id) { |
1021 | cmn_err(CE_DEBUG, | 1025 | xfs_debug(dqp->q_mount, |
1022 | "%d [%s] [0x%p] BLK TIMER NOT STARTED", | 1026 | "%d [%s] BLK TIMER NOT STARTED", |
1023 | d->d_id, DQFLAGTO_TYPESTR(d), d->q_mount); | 1027 | d->d_id, DQFLAGTO_TYPESTR(d)); |
1024 | err++; | 1028 | err++; |
1025 | } | 1029 | } |
1026 | } | 1030 | } |
@@ -1028,16 +1032,16 @@ xfs_dqtest_cmp2( | |||
1028 | be64_to_cpu(dqp->q_core.d_icount) >= | 1032 | be64_to_cpu(dqp->q_core.d_icount) >= |
1029 | be64_to_cpu(dqp->q_core.d_ino_softlimit)) { | 1033 | be64_to_cpu(dqp->q_core.d_ino_softlimit)) { |
1030 | if (!dqp->q_core.d_itimer && dqp->q_core.d_id) { | 1034 | if (!dqp->q_core.d_itimer && dqp->q_core.d_id) { |
1031 | cmn_err(CE_DEBUG, | 1035 | xfs_debug(dqp->q_mount, |
1032 | "%d [%s] [0x%p] INO TIMER NOT STARTED", | 1036 | "%d [%s] INO TIMER NOT STARTED", |
1033 | d->d_id, DQFLAGTO_TYPESTR(d), d->q_mount); | 1037 | d->d_id, DQFLAGTO_TYPESTR(d)); |
1034 | err++; | 1038 | err++; |
1035 | } | 1039 | } |
1036 | } | 1040 | } |
1037 | #ifdef QUOTADEBUG | 1041 | #ifdef QUOTADEBUG |
1038 | if (!err) { | 1042 | if (!err) { |
1039 | cmn_err(CE_DEBUG, "%d [%s] [0x%p] qchecked", | 1043 | xfs_debug(dqp->q_mount, "%d [%s] qchecked", |
1040 | d->d_id, DQFLAGTO_TYPESTR(d), d->q_mount); | 1044 | d->d_id, DQFLAGTO_TYPESTR(d)); |
1041 | } | 1045 | } |
1042 | #endif | 1046 | #endif |
1043 | return (err); | 1047 | return (err); |
@@ -1220,12 +1224,12 @@ xfs_qm_internalqcheck( | |||
1220 | xfs_qm_internalqcheck_adjust, | 1224 | xfs_qm_internalqcheck_adjust, |
1221 | 0, NULL, &done); | 1225 | 0, NULL, &done); |
1222 | if (error) { | 1226 | if (error) { |
1223 | cmn_err(CE_DEBUG, "Bulkstat returned error 0x%x", error); | 1227 | xfs_debug(mp, "Bulkstat returned error 0x%x", error); |
1224 | break; | 1228 | break; |
1225 | } | 1229 | } |
1226 | } while (!done); | 1230 | } while (!done); |
1227 | 1231 | ||
1228 | cmn_err(CE_DEBUG, "Checking results against system dquots"); | 1232 | xfs_debug(mp, "Checking results against system dquots"); |
1229 | for (i = 0; i < qmtest_hashmask; i++) { | 1233 | for (i = 0; i < qmtest_hashmask; i++) { |
1230 | xfs_dqtest_t *d, *n; | 1234 | xfs_dqtest_t *d, *n; |
1231 | xfs_dqhash_t *h; | 1235 | xfs_dqhash_t *h; |
@@ -1243,10 +1247,10 @@ xfs_qm_internalqcheck( | |||
1243 | } | 1247 | } |
1244 | 1248 | ||
1245 | if (qmtest_nfails) { | 1249 | if (qmtest_nfails) { |
1246 | cmn_err(CE_DEBUG, "******** quotacheck failed ********"); | 1250 | xfs_debug(mp, "******** quotacheck failed ********"); |
1247 | cmn_err(CE_DEBUG, "failures = %d", qmtest_nfails); | 1251 | xfs_debug(mp, "failures = %d", qmtest_nfails); |
1248 | } else { | 1252 | } else { |
1249 | cmn_err(CE_DEBUG, "******** quotacheck successful! ********"); | 1253 | xfs_debug(mp, "******** quotacheck successful! ********"); |
1250 | } | 1254 | } |
1251 | kmem_free(qmtest_udqtab); | 1255 | kmem_free(qmtest_udqtab); |
1252 | kmem_free(qmtest_gdqtab); | 1256 | kmem_free(qmtest_gdqtab); |
diff --git a/fs/xfs/quota/xfs_trans_dquot.c b/fs/xfs/quota/xfs_trans_dquot.c index 7de91d1b75c0..2a3648731331 100644 --- a/fs/xfs/quota/xfs_trans_dquot.c +++ b/fs/xfs/quota/xfs_trans_dquot.c | |||
@@ -643,8 +643,9 @@ xfs_trans_dqresv( | |||
643 | (XFS_IS_OQUOTA_ENFORCED(dqp->q_mount) && | 643 | (XFS_IS_OQUOTA_ENFORCED(dqp->q_mount) && |
644 | (XFS_QM_ISPDQ(dqp) || XFS_QM_ISGDQ(dqp))))) { | 644 | (XFS_QM_ISPDQ(dqp) || XFS_QM_ISGDQ(dqp))))) { |
645 | #ifdef QUOTADEBUG | 645 | #ifdef QUOTADEBUG |
646 | cmn_err(CE_DEBUG, "BLK Res: nblks=%ld + resbcount=%Ld" | 646 | xfs_debug(mp, |
647 | " > hardlimit=%Ld?", nblks, *resbcountp, hardlimit); | 647 | "BLK Res: nblks=%ld + resbcount=%Ld > hardlimit=%Ld?", |
648 | nblks, *resbcountp, hardlimit); | ||
648 | #endif | 649 | #endif |
649 | if (nblks > 0) { | 650 | if (nblks > 0) { |
650 | /* | 651 | /* |
diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c index a1c7141af481..79fae3b33bdd 100644 --- a/fs/xfs/support/debug.c +++ b/fs/xfs/support/debug.c | |||
@@ -18,32 +18,6 @@ | |||
18 | #include <xfs.h> | 18 | #include <xfs.h> |
19 | #include "debug.h" | 19 | #include "debug.h" |
20 | 20 | ||
21 | /* xfs_mount.h drags a lot of crap in, sorry.. */ | ||
22 | #include "xfs_sb.h" | ||
23 | #include "xfs_inum.h" | ||
24 | #include "xfs_ag.h" | ||
25 | #include "xfs_mount.h" | ||
26 | #include "xfs_error.h" | ||
27 | |||
28 | void | ||
29 | cmn_err( | ||
30 | const char *lvl, | ||
31 | const char *fmt, | ||
32 | ...) | ||
33 | { | ||
34 | struct va_format vaf; | ||
35 | va_list args; | ||
36 | |||
37 | va_start(args, fmt); | ||
38 | vaf.fmt = fmt; | ||
39 | vaf.va = &args; | ||
40 | |||
41 | printk("%s%pV", lvl, &vaf); | ||
42 | va_end(args); | ||
43 | |||
44 | BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0); | ||
45 | } | ||
46 | |||
47 | void | 21 | void |
48 | assfail(char *expr, char *file, int line) | 22 | assfail(char *expr, char *file, int line) |
49 | { | 23 | { |
diff --git a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h index 4a082b9a1161..db36be48a43e 100644 --- a/fs/xfs/support/debug.h +++ b/fs/xfs/support/debug.h | |||
@@ -20,18 +20,6 @@ | |||
20 | 20 | ||
21 | #include <stdarg.h> | 21 | #include <stdarg.h> |
22 | 22 | ||
23 | struct xfs_mount; | ||
24 | |||
25 | #define CE_DEBUG KERN_DEBUG | ||
26 | #define CE_CONT KERN_INFO | ||
27 | #define CE_NOTE KERN_NOTICE | ||
28 | #define CE_WARN KERN_WARNING | ||
29 | #define CE_ALERT KERN_ALERT | ||
30 | #define CE_PANIC KERN_EMERG | ||
31 | |||
32 | void cmn_err(const char *lvl, const char *fmt, ...) | ||
33 | __attribute__ ((format (printf, 2, 3))); | ||
34 | |||
35 | extern void assfail(char *expr, char *f, int l); | 23 | extern void assfail(char *expr, char *f, int l); |
36 | 24 | ||
37 | #define ASSERT_ALWAYS(expr) \ | 25 | #define ASSERT_ALWAYS(expr) \ |
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 92612f6b4b3e..fa00788de2f5 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -5778,7 +5778,7 @@ xfs_check_block( | |||
5778 | else | 5778 | else |
5779 | thispa = XFS_BMBT_PTR_ADDR(mp, block, j, dmxr); | 5779 | thispa = XFS_BMBT_PTR_ADDR(mp, block, j, dmxr); |
5780 | if (*thispa == *pp) { | 5780 | if (*thispa == *pp) { |
5781 | cmn_err(CE_WARN, "%s: thispa(%d) == pp(%d) %Ld", | 5781 | xfs_warn(mp, "%s: thispa(%d) == pp(%d) %Ld", |
5782 | __func__, j, i, | 5782 | __func__, j, i, |
5783 | (unsigned long long)be64_to_cpu(*thispa)); | 5783 | (unsigned long long)be64_to_cpu(*thispa)); |
5784 | panic("%s: ptrs are equal in node\n", | 5784 | panic("%s: ptrs are equal in node\n", |
@@ -5943,11 +5943,11 @@ xfs_bmap_check_leaf_extents( | |||
5943 | return; | 5943 | return; |
5944 | 5944 | ||
5945 | error0: | 5945 | error0: |
5946 | cmn_err(CE_WARN, "%s: at error0", __func__); | 5946 | xfs_warn(mp, "%s: at error0", __func__); |
5947 | if (bp_release) | 5947 | if (bp_release) |
5948 | xfs_trans_brelse(NULL, bp); | 5948 | xfs_trans_brelse(NULL, bp); |
5949 | error_norelse: | 5949 | error_norelse: |
5950 | cmn_err(CE_WARN, "%s: BAD after btree leaves for %d extents", | 5950 | xfs_warn(mp, "%s: BAD after btree leaves for %d extents", |
5951 | __func__, i); | 5951 | __func__, i); |
5952 | panic("%s: CORRUPTED BTREE OR SOMETHING", __func__); | 5952 | panic("%s: CORRUPTED BTREE OR SOMETHING", __func__); |
5953 | return; | 5953 | return; |
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 6f8c21ce0d6d..e5413d96f1af 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -130,10 +130,12 @@ xfs_buf_item_log_check( | |||
130 | orig = bip->bli_orig; | 130 | orig = bip->bli_orig; |
131 | buffer = XFS_BUF_PTR(bp); | 131 | buffer = XFS_BUF_PTR(bp); |
132 | for (x = 0; x < XFS_BUF_COUNT(bp); x++) { | 132 | for (x = 0; x < XFS_BUF_COUNT(bp); x++) { |
133 | if (orig[x] != buffer[x] && !btst(bip->bli_logged, x)) | 133 | if (orig[x] != buffer[x] && !btst(bip->bli_logged, x)) { |
134 | cmn_err(CE_PANIC, | 134 | xfs_emerg(bp->b_mount, |
135 | "xfs_buf_item_log_check bip %x buffer %x orig %x index %d", | 135 | "%s: bip %x buffer %x orig %x index %d", |
136 | bip, bp, orig, x); | 136 | __func__, bip, bp, orig, x); |
137 | ASSERT(0); | ||
138 | } | ||
137 | } | 139 | } |
138 | } | 140 | } |
139 | #else | 141 | #else |
@@ -983,10 +985,9 @@ xfs_buf_iodone_callbacks( | |||
983 | if (XFS_BUF_TARGET(bp) != lasttarg || | 985 | if (XFS_BUF_TARGET(bp) != lasttarg || |
984 | time_after(jiffies, (lasttime + 5*HZ))) { | 986 | time_after(jiffies, (lasttime + 5*HZ))) { |
985 | lasttime = jiffies; | 987 | lasttime = jiffies; |
986 | cmn_err(CE_ALERT, "Device %s, XFS metadata write error" | 988 | xfs_alert(mp, "Device %s: metadata write error block 0x%llx", |
987 | " block 0x%llx in %s", | ||
988 | XFS_BUFTARG_NAME(XFS_BUF_TARGET(bp)), | 989 | XFS_BUFTARG_NAME(XFS_BUF_TARGET(bp)), |
989 | (__uint64_t)XFS_BUF_ADDR(bp), mp->m_fsname); | 990 | (__uint64_t)XFS_BUF_ADDR(bp)); |
990 | } | 991 | } |
991 | lasttarg = XFS_BUF_TARGET(bp); | 992 | lasttarg = XFS_BUF_TARGET(bp); |
992 | 993 | ||
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index 1c00bedb3175..6102ac6d1dff 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c | |||
@@ -1995,13 +1995,12 @@ xfs_da_do_buf( | |||
1995 | error = mappedbno == -2 ? 0 : XFS_ERROR(EFSCORRUPTED); | 1995 | error = mappedbno == -2 ? 0 : XFS_ERROR(EFSCORRUPTED); |
1996 | if (unlikely(error == EFSCORRUPTED)) { | 1996 | if (unlikely(error == EFSCORRUPTED)) { |
1997 | if (xfs_error_level >= XFS_ERRLEVEL_LOW) { | 1997 | if (xfs_error_level >= XFS_ERRLEVEL_LOW) { |
1998 | cmn_err(CE_ALERT, "xfs_da_do_buf: bno %lld\n", | 1998 | xfs_alert(mp, "%s: bno %lld dir: inode %lld", |
1999 | (long long)bno); | 1999 | __func__, (long long)bno, |
2000 | cmn_err(CE_ALERT, "dir: inode %lld\n", | ||
2001 | (long long)dp->i_ino); | 2000 | (long long)dp->i_ino); |
2002 | for (i = 0; i < nmap; i++) { | 2001 | for (i = 0; i < nmap; i++) { |
2003 | cmn_err(CE_ALERT, | 2002 | xfs_alert(mp, |
2004 | "[%02d] br_startoff %lld br_startblock %lld br_blockcount %lld br_state %d\n", | 2003 | "[%02d] br_startoff %lld br_startblock %lld br_blockcount %lld br_state %d", |
2005 | i, | 2004 | i, |
2006 | (long long)mapp[i].br_startoff, | 2005 | (long long)mapp[i].br_startoff, |
2007 | (long long)mapp[i].br_startblock, | 2006 | (long long)mapp[i].br_startblock, |
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c index f9a0864b696a..a0aab7d3294f 100644 --- a/fs/xfs/xfs_dir2_node.c +++ b/fs/xfs/xfs_dir2_node.c | |||
@@ -899,10 +899,9 @@ xfs_dir2_leafn_rebalance( | |||
899 | if(blk2->index < 0) { | 899 | if(blk2->index < 0) { |
900 | state->inleaf = 1; | 900 | state->inleaf = 1; |
901 | blk2->index = 0; | 901 | blk2->index = 0; |
902 | cmn_err(CE_ALERT, | 902 | xfs_alert(args->dp->i_mount, |
903 | "xfs_dir2_leafn_rebalance: picked the wrong leaf? reverting original leaf: " | 903 | "%s: picked the wrong leaf? reverting original leaf: blk1->index %d\n", |
904 | "blk1->index %d\n", | 904 | __func__, blk1->index); |
905 | blk1->index); | ||
906 | } | 905 | } |
907 | } | 906 | } |
908 | 907 | ||
@@ -1641,26 +1640,22 @@ xfs_dir2_node_addname_int( | |||
1641 | } | 1640 | } |
1642 | 1641 | ||
1643 | if (unlikely(xfs_dir2_db_to_fdb(mp, dbno) != fbno)) { | 1642 | if (unlikely(xfs_dir2_db_to_fdb(mp, dbno) != fbno)) { |
1644 | cmn_err(CE_ALERT, | 1643 | xfs_alert(mp, |
1645 | "xfs_dir2_node_addname_int: dir ino " | 1644 | "%s: dir ino " "%llu needed freesp block %lld for\n" |
1646 | "%llu needed freesp block %lld for\n" | 1645 | " data block %lld, got %lld ifbno %llu lastfbno %d", |
1647 | " data block %lld, got %lld\n" | 1646 | __func__, (unsigned long long)dp->i_ino, |
1648 | " ifbno %llu lastfbno %d\n", | ||
1649 | (unsigned long long)dp->i_ino, | ||
1650 | (long long)xfs_dir2_db_to_fdb(mp, dbno), | 1647 | (long long)xfs_dir2_db_to_fdb(mp, dbno), |
1651 | (long long)dbno, (long long)fbno, | 1648 | (long long)dbno, (long long)fbno, |
1652 | (unsigned long long)ifbno, lastfbno); | 1649 | (unsigned long long)ifbno, lastfbno); |
1653 | if (fblk) { | 1650 | if (fblk) { |
1654 | cmn_err(CE_ALERT, | 1651 | xfs_alert(mp, |
1655 | " fblk 0x%p blkno %llu " | 1652 | " fblk 0x%p blkno %llu index %d magic 0x%x", |
1656 | "index %d magic 0x%x\n", | ||
1657 | fblk, | 1653 | fblk, |
1658 | (unsigned long long)fblk->blkno, | 1654 | (unsigned long long)fblk->blkno, |
1659 | fblk->index, | 1655 | fblk->index, |
1660 | fblk->magic); | 1656 | fblk->magic); |
1661 | } else { | 1657 | } else { |
1662 | cmn_err(CE_ALERT, | 1658 | xfs_alert(mp, " ... fblk is NULL"); |
1663 | " ... fblk is NULL\n"); | ||
1664 | } | 1659 | } |
1665 | XFS_ERROR_REPORT("xfs_dir2_node_addname_int", | 1660 | XFS_ERROR_REPORT("xfs_dir2_node_addname_int", |
1666 | XFS_ERRLEVEL_LOW, mp); | 1661 | XFS_ERRLEVEL_LOW, mp); |
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c index 03028906f00e..39f06336b99d 100644 --- a/fs/xfs/xfs_error.c +++ b/fs/xfs/xfs_error.c | |||
@@ -48,7 +48,7 @@ xfs_error_trap(int e) | |||
48 | break; | 48 | break; |
49 | if (e != xfs_etrap[i]) | 49 | if (e != xfs_etrap[i]) |
50 | continue; | 50 | continue; |
51 | cmn_err(CE_NOTE, "xfs_error_trap: error %d", e); | 51 | xfs_notice(NULL, "%s: error %d", __func__, e); |
52 | BUG(); | 52 | BUG(); |
53 | break; | 53 | break; |
54 | } | 54 | } |
@@ -74,7 +74,7 @@ xfs_error_test(int error_tag, int *fsidp, char *expression, | |||
74 | 74 | ||
75 | for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) { | 75 | for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) { |
76 | if (xfs_etest[i] == error_tag && xfs_etest_fsid[i] == fsid) { | 76 | if (xfs_etest[i] == error_tag && xfs_etest_fsid[i] == fsid) { |
77 | cmn_err(CE_WARN, | 77 | xfs_warn(NULL, |
78 | "Injecting error (%s) at file %s, line %d, on filesystem \"%s\"", | 78 | "Injecting error (%s) at file %s, line %d, on filesystem \"%s\"", |
79 | expression, file, line, xfs_etest_fsname[i]); | 79 | expression, file, line, xfs_etest_fsname[i]); |
80 | return 1; | 80 | return 1; |
@@ -95,14 +95,14 @@ xfs_errortag_add(int error_tag, xfs_mount_t *mp) | |||
95 | 95 | ||
96 | for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) { | 96 | for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) { |
97 | if (xfs_etest_fsid[i] == fsid && xfs_etest[i] == error_tag) { | 97 | if (xfs_etest_fsid[i] == fsid && xfs_etest[i] == error_tag) { |
98 | cmn_err(CE_WARN, "XFS error tag #%d on", error_tag); | 98 | xfs_warn(mp, "error tag #%d on", error_tag); |
99 | return 0; | 99 | return 0; |
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) { | 103 | for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) { |
104 | if (xfs_etest[i] == 0) { | 104 | if (xfs_etest[i] == 0) { |
105 | cmn_err(CE_WARN, "Turned on XFS error tag #%d", | 105 | xfs_warn(mp, "Turned on XFS error tag #%d", |
106 | error_tag); | 106 | error_tag); |
107 | xfs_etest[i] = error_tag; | 107 | xfs_etest[i] = error_tag; |
108 | xfs_etest_fsid[i] = fsid; | 108 | xfs_etest_fsid[i] = fsid; |
@@ -114,7 +114,7 @@ xfs_errortag_add(int error_tag, xfs_mount_t *mp) | |||
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | cmn_err(CE_WARN, "error tag overflow, too many turned on"); | 117 | xfs_warn(mp, "error tag overflow, too many turned on"); |
118 | 118 | ||
119 | return 1; | 119 | return 1; |
120 | } | 120 | } |
@@ -133,7 +133,7 @@ xfs_errortag_clearall(xfs_mount_t *mp, int loud) | |||
133 | if ((fsid == 0LL || xfs_etest_fsid[i] == fsid) && | 133 | if ((fsid == 0LL || xfs_etest_fsid[i] == fsid) && |
134 | xfs_etest[i] != 0) { | 134 | xfs_etest[i] != 0) { |
135 | cleared = 1; | 135 | cleared = 1; |
136 | cmn_err(CE_WARN, "Clearing XFS error tag #%d", | 136 | xfs_warn(mp, "Clearing XFS error tag #%d", |
137 | xfs_etest[i]); | 137 | xfs_etest[i]); |
138 | xfs_etest[i] = 0; | 138 | xfs_etest[i] = 0; |
139 | xfs_etest_fsid[i] = 0LL; | 139 | xfs_etest_fsid[i] = 0LL; |
@@ -144,9 +144,7 @@ xfs_errortag_clearall(xfs_mount_t *mp, int loud) | |||
144 | } | 144 | } |
145 | 145 | ||
146 | if (loud || cleared) | 146 | if (loud || cleared) |
147 | cmn_err(CE_WARN, | 147 | xfs_warn(mp, "Cleared all XFS error tags for filesystem"); |
148 | "Cleared all XFS error tags for filesystem \"%s\"", | ||
149 | mp->m_fsname); | ||
150 | 148 | ||
151 | return 0; | 149 | return 0; |
152 | } | 150 | } |
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index fc3a2cb2c075..84ebeec16642 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c | |||
@@ -1055,28 +1055,23 @@ xfs_difree( | |||
1055 | */ | 1055 | */ |
1056 | agno = XFS_INO_TO_AGNO(mp, inode); | 1056 | agno = XFS_INO_TO_AGNO(mp, inode); |
1057 | if (agno >= mp->m_sb.sb_agcount) { | 1057 | if (agno >= mp->m_sb.sb_agcount) { |
1058 | cmn_err(CE_WARN, | 1058 | xfs_warn(mp, "%s: agno >= mp->m_sb.sb_agcount (%d >= %d).", |
1059 | "xfs_difree: agno >= mp->m_sb.sb_agcount (%d >= %d) on %s. Returning EINVAL.", | 1059 | __func__, agno, mp->m_sb.sb_agcount); |
1060 | agno, mp->m_sb.sb_agcount, mp->m_fsname); | ||
1061 | ASSERT(0); | 1060 | ASSERT(0); |
1062 | return XFS_ERROR(EINVAL); | 1061 | return XFS_ERROR(EINVAL); |
1063 | } | 1062 | } |
1064 | agino = XFS_INO_TO_AGINO(mp, inode); | 1063 | agino = XFS_INO_TO_AGINO(mp, inode); |
1065 | if (inode != XFS_AGINO_TO_INO(mp, agno, agino)) { | 1064 | if (inode != XFS_AGINO_TO_INO(mp, agno, agino)) { |
1066 | cmn_err(CE_WARN, | 1065 | xfs_warn(mp, "%s: inode != XFS_AGINO_TO_INO() (%llu != %llu).", |
1067 | "xfs_difree: inode != XFS_AGINO_TO_INO() " | 1066 | __func__, (unsigned long long)inode, |
1068 | "(%llu != %llu) on %s. Returning EINVAL.", | 1067 | (unsigned long long)XFS_AGINO_TO_INO(mp, agno, agino)); |
1069 | (unsigned long long)inode, | ||
1070 | (unsigned long long)XFS_AGINO_TO_INO(mp, agno, agino), | ||
1071 | mp->m_fsname); | ||
1072 | ASSERT(0); | 1068 | ASSERT(0); |
1073 | return XFS_ERROR(EINVAL); | 1069 | return XFS_ERROR(EINVAL); |
1074 | } | 1070 | } |
1075 | agbno = XFS_AGINO_TO_AGBNO(mp, agino); | 1071 | agbno = XFS_AGINO_TO_AGBNO(mp, agino); |
1076 | if (agbno >= mp->m_sb.sb_agblocks) { | 1072 | if (agbno >= mp->m_sb.sb_agblocks) { |
1077 | cmn_err(CE_WARN, | 1073 | xfs_warn(mp, "%s: agbno >= mp->m_sb.sb_agblocks (%d >= %d).", |
1078 | "xfs_difree: agbno >= mp->m_sb.sb_agblocks (%d >= %d) on %s. Returning EINVAL.", | 1074 | __func__, agbno, mp->m_sb.sb_agblocks); |
1079 | agbno, mp->m_sb.sb_agblocks, mp->m_fsname); | ||
1080 | ASSERT(0); | 1075 | ASSERT(0); |
1081 | return XFS_ERROR(EINVAL); | 1076 | return XFS_ERROR(EINVAL); |
1082 | } | 1077 | } |
@@ -1085,9 +1080,8 @@ xfs_difree( | |||
1085 | */ | 1080 | */ |
1086 | error = xfs_ialloc_read_agi(mp, tp, agno, &agbp); | 1081 | error = xfs_ialloc_read_agi(mp, tp, agno, &agbp); |
1087 | if (error) { | 1082 | if (error) { |
1088 | cmn_err(CE_WARN, | 1083 | xfs_warn(mp, "%s: xfs_ialloc_read_agi() returned error %d.", |
1089 | "xfs_difree: xfs_ialloc_read_agi() returned an error %d on %s. Returning error.", | 1084 | __func__, error); |
1090 | error, mp->m_fsname); | ||
1091 | return error; | 1085 | return error; |
1092 | } | 1086 | } |
1093 | agi = XFS_BUF_TO_AGI(agbp); | 1087 | agi = XFS_BUF_TO_AGI(agbp); |
@@ -1106,17 +1100,15 @@ xfs_difree( | |||
1106 | * Look for the entry describing this inode. | 1100 | * Look for the entry describing this inode. |
1107 | */ | 1101 | */ |
1108 | if ((error = xfs_inobt_lookup(cur, agino, XFS_LOOKUP_LE, &i))) { | 1102 | if ((error = xfs_inobt_lookup(cur, agino, XFS_LOOKUP_LE, &i))) { |
1109 | cmn_err(CE_WARN, | 1103 | xfs_warn(mp, "%s: xfs_inobt_lookup() returned error %d.", |
1110 | "xfs_difree: xfs_inobt_lookup returned() an error %d on %s. Returning error.", | 1104 | __func__, error); |
1111 | error, mp->m_fsname); | ||
1112 | goto error0; | 1105 | goto error0; |
1113 | } | 1106 | } |
1114 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); | 1107 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); |
1115 | error = xfs_inobt_get_rec(cur, &rec, &i); | 1108 | error = xfs_inobt_get_rec(cur, &rec, &i); |
1116 | if (error) { | 1109 | if (error) { |
1117 | cmn_err(CE_WARN, | 1110 | xfs_warn(mp, "%s: xfs_inobt_get_rec() returned error %d.", |
1118 | "xfs_difree: xfs_inobt_get_rec() returned an error %d on %s. Returning error.", | 1111 | __func__, error); |
1119 | error, mp->m_fsname); | ||
1120 | goto error0; | 1112 | goto error0; |
1121 | } | 1113 | } |
1122 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); | 1114 | XFS_WANT_CORRUPTED_GOTO(i == 1, error0); |
@@ -1157,8 +1149,8 @@ xfs_difree( | |||
1157 | xfs_trans_mod_sb(tp, XFS_TRANS_SB_IFREE, -(ilen - 1)); | 1149 | xfs_trans_mod_sb(tp, XFS_TRANS_SB_IFREE, -(ilen - 1)); |
1158 | 1150 | ||
1159 | if ((error = xfs_btree_delete(cur, &i))) { | 1151 | if ((error = xfs_btree_delete(cur, &i))) { |
1160 | cmn_err(CE_WARN, "xfs_difree: xfs_btree_delete returned an error %d on %s.\n", | 1152 | xfs_warn(mp, "%s: xfs_btree_delete returned error %d.", |
1161 | error, mp->m_fsname); | 1153 | __func__, error); |
1162 | goto error0; | 1154 | goto error0; |
1163 | } | 1155 | } |
1164 | 1156 | ||
@@ -1170,9 +1162,8 @@ xfs_difree( | |||
1170 | 1162 | ||
1171 | error = xfs_inobt_update(cur, &rec); | 1163 | error = xfs_inobt_update(cur, &rec); |
1172 | if (error) { | 1164 | if (error) { |
1173 | cmn_err(CE_WARN, | 1165 | xfs_warn(mp, "%s: xfs_inobt_update returned error %d.", |
1174 | "xfs_difree: xfs_inobt_update returned an error %d on %s.", | 1166 | __func__, error); |
1175 | error, mp->m_fsname); | ||
1176 | goto error0; | 1167 | goto error0; |
1177 | } | 1168 | } |
1178 | 1169 | ||
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index d820ada49b18..da871f532236 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -142,10 +142,9 @@ xfs_imap_to_bp( | |||
142 | (int)imap->im_len, buf_flags, &bp); | 142 | (int)imap->im_len, buf_flags, &bp); |
143 | if (error) { | 143 | if (error) { |
144 | if (error != EAGAIN) { | 144 | if (error != EAGAIN) { |
145 | cmn_err(CE_WARN, | 145 | xfs_warn(mp, |
146 | "xfs_imap_to_bp: xfs_trans_read_buf()returned " | 146 | "%s: xfs_trans_read_buf() returned error %d.", |
147 | "an error %d on %s. Returning error.", | 147 | __func__, error); |
148 | error, mp->m_fsname); | ||
149 | } else { | 148 | } else { |
150 | ASSERT(buf_flags & XBF_TRYLOCK); | 149 | ASSERT(buf_flags & XBF_TRYLOCK); |
151 | } | 150 | } |
@@ -180,12 +179,11 @@ xfs_imap_to_bp( | |||
180 | XFS_CORRUPTION_ERROR("xfs_imap_to_bp", | 179 | XFS_CORRUPTION_ERROR("xfs_imap_to_bp", |
181 | XFS_ERRLEVEL_HIGH, mp, dip); | 180 | XFS_ERRLEVEL_HIGH, mp, dip); |
182 | #ifdef DEBUG | 181 | #ifdef DEBUG |
183 | cmn_err(CE_PANIC, | 182 | xfs_emerg(mp, |
184 | "Device %s - bad inode magic/vsn " | 183 | "bad inode magic/vsn daddr %lld #%d (magic=%x)", |
185 | "daddr %lld #%d (magic=%x)", | ||
186 | XFS_BUFTARG_NAME(mp->m_ddev_targp), | ||
187 | (unsigned long long)imap->im_blkno, i, | 184 | (unsigned long long)imap->im_blkno, i, |
188 | be16_to_cpu(dip->di_magic)); | 185 | be16_to_cpu(dip->di_magic)); |
186 | ASSERT(0); | ||
189 | #endif | 187 | #endif |
190 | xfs_trans_brelse(tp, bp); | 188 | xfs_trans_brelse(tp, bp); |
191 | return XFS_ERROR(EFSCORRUPTED); | 189 | return XFS_ERROR(EFSCORRUPTED); |
@@ -1811,9 +1809,8 @@ xfs_iunlink_remove( | |||
1811 | */ | 1809 | */ |
1812 | error = xfs_itobp(mp, tp, ip, &dip, &ibp, XBF_LOCK); | 1810 | error = xfs_itobp(mp, tp, ip, &dip, &ibp, XBF_LOCK); |
1813 | if (error) { | 1811 | if (error) { |
1814 | cmn_err(CE_WARN, | 1812 | xfs_warn(mp, "%s: xfs_itobp() returned error %d.", |
1815 | "xfs_iunlink_remove: xfs_itobp() returned an error %d on %s. Returning error.", | 1813 | __func__, error); |
1816 | error, mp->m_fsname); | ||
1817 | return error; | 1814 | return error; |
1818 | } | 1815 | } |
1819 | next_agino = be32_to_cpu(dip->di_next_unlinked); | 1816 | next_agino = be32_to_cpu(dip->di_next_unlinked); |
@@ -1858,9 +1855,9 @@ xfs_iunlink_remove( | |||
1858 | error = xfs_inotobp(mp, tp, next_ino, &last_dip, | 1855 | error = xfs_inotobp(mp, tp, next_ino, &last_dip, |
1859 | &last_ibp, &last_offset, 0); | 1856 | &last_ibp, &last_offset, 0); |
1860 | if (error) { | 1857 | if (error) { |
1861 | cmn_err(CE_WARN, | 1858 | xfs_warn(mp, |
1862 | "xfs_iunlink_remove: xfs_inotobp() returned an error %d on %s. Returning error.", | 1859 | "%s: xfs_inotobp() returned error %d.", |
1863 | error, mp->m_fsname); | 1860 | __func__, error); |
1864 | return error; | 1861 | return error; |
1865 | } | 1862 | } |
1866 | next_agino = be32_to_cpu(last_dip->di_next_unlinked); | 1863 | next_agino = be32_to_cpu(last_dip->di_next_unlinked); |
@@ -1873,9 +1870,8 @@ xfs_iunlink_remove( | |||
1873 | */ | 1870 | */ |
1874 | error = xfs_itobp(mp, tp, ip, &dip, &ibp, XBF_LOCK); | 1871 | error = xfs_itobp(mp, tp, ip, &dip, &ibp, XBF_LOCK); |
1875 | if (error) { | 1872 | if (error) { |
1876 | cmn_err(CE_WARN, | 1873 | xfs_warn(mp, "%s: xfs_itobp(2) returned error %d.", |
1877 | "xfs_iunlink_remove: xfs_itobp() returned an error %d on %s. Returning error.", | 1874 | __func__, error); |
1878 | error, mp->m_fsname); | ||
1879 | return error; | 1875 | return error; |
1880 | } | 1876 | } |
1881 | next_agino = be32_to_cpu(dip->di_next_unlinked); | 1877 | next_agino = be32_to_cpu(dip->di_next_unlinked); |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index e39b082eb049..bb3f9a7b24ed 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -133,9 +133,7 @@ xfs_uuid_mount( | |||
133 | return 0; | 133 | return 0; |
134 | 134 | ||
135 | if (uuid_is_nil(uuid)) { | 135 | if (uuid_is_nil(uuid)) { |
136 | cmn_err(CE_WARN, | 136 | xfs_warn(mp, "Filesystem has nil UUID - can't mount"); |
137 | "XFS: Filesystem %s has nil UUID - can't mount", | ||
138 | mp->m_fsname); | ||
139 | return XFS_ERROR(EINVAL); | 137 | return XFS_ERROR(EINVAL); |
140 | } | 138 | } |
141 | 139 | ||
@@ -163,8 +161,7 @@ xfs_uuid_mount( | |||
163 | 161 | ||
164 | out_duplicate: | 162 | out_duplicate: |
165 | mutex_unlock(&xfs_uuid_table_mutex); | 163 | mutex_unlock(&xfs_uuid_table_mutex); |
166 | cmn_err(CE_WARN, "XFS: Filesystem %s has duplicate UUID - can't mount", | 164 | xfs_warn(mp, "Filesystem has duplicate UUID - can't mount"); |
167 | mp->m_fsname); | ||
168 | return XFS_ERROR(EINVAL); | 165 | return XFS_ERROR(EINVAL); |
169 | } | 166 | } |
170 | 167 | ||
@@ -867,8 +864,7 @@ xfs_update_alignment(xfs_mount_t *mp) | |||
867 | if ((BBTOB(mp->m_dalign) & mp->m_blockmask) || | 864 | if ((BBTOB(mp->m_dalign) & mp->m_blockmask) || |
868 | (BBTOB(mp->m_swidth) & mp->m_blockmask)) { | 865 | (BBTOB(mp->m_swidth) & mp->m_blockmask)) { |
869 | if (mp->m_flags & XFS_MOUNT_RETERR) { | 866 | if (mp->m_flags & XFS_MOUNT_RETERR) { |
870 | cmn_err(CE_WARN, | 867 | xfs_warn(mp, "alignment check 1 failed"); |
871 | "XFS: alignment check 1 failed"); | ||
872 | return XFS_ERROR(EINVAL); | 868 | return XFS_ERROR(EINVAL); |
873 | } | 869 | } |
874 | mp->m_dalign = mp->m_swidth = 0; | 870 | mp->m_dalign = mp->m_swidth = 0; |
@@ -1041,14 +1037,14 @@ xfs_check_sizes(xfs_mount_t *mp) | |||
1041 | 1037 | ||
1042 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); | 1038 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); |
1043 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) { | 1039 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) { |
1044 | cmn_err(CE_WARN, "XFS: filesystem size mismatch detected"); | 1040 | xfs_warn(mp, "filesystem size mismatch detected"); |
1045 | return XFS_ERROR(EFBIG); | 1041 | return XFS_ERROR(EFBIG); |
1046 | } | 1042 | } |
1047 | bp = xfs_buf_read_uncached(mp, mp->m_ddev_targp, | 1043 | bp = xfs_buf_read_uncached(mp, mp->m_ddev_targp, |
1048 | d - XFS_FSS_TO_BB(mp, 1), | 1044 | d - XFS_FSS_TO_BB(mp, 1), |
1049 | BBTOB(XFS_FSS_TO_BB(mp, 1)), 0); | 1045 | BBTOB(XFS_FSS_TO_BB(mp, 1)), 0); |
1050 | if (!bp) { | 1046 | if (!bp) { |
1051 | cmn_err(CE_WARN, "XFS: last sector read failed"); | 1047 | xfs_warn(mp, "last sector read failed"); |
1052 | return EIO; | 1048 | return EIO; |
1053 | } | 1049 | } |
1054 | xfs_buf_relse(bp); | 1050 | xfs_buf_relse(bp); |
@@ -1056,14 +1052,14 @@ xfs_check_sizes(xfs_mount_t *mp) | |||
1056 | if (mp->m_logdev_targp != mp->m_ddev_targp) { | 1052 | if (mp->m_logdev_targp != mp->m_ddev_targp) { |
1057 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); | 1053 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); |
1058 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { | 1054 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { |
1059 | cmn_err(CE_WARN, "XFS: log size mismatch detected"); | 1055 | xfs_warn(mp, "log size mismatch detected"); |
1060 | return XFS_ERROR(EFBIG); | 1056 | return XFS_ERROR(EFBIG); |
1061 | } | 1057 | } |
1062 | bp = xfs_buf_read_uncached(mp, mp->m_logdev_targp, | 1058 | bp = xfs_buf_read_uncached(mp, mp->m_logdev_targp, |
1063 | d - XFS_FSB_TO_BB(mp, 1), | 1059 | d - XFS_FSB_TO_BB(mp, 1), |
1064 | XFS_FSB_TO_B(mp, 1), 0); | 1060 | XFS_FSB_TO_B(mp, 1), 0); |
1065 | if (!bp) { | 1061 | if (!bp) { |
1066 | cmn_err(CE_WARN, "XFS: log device read failed"); | 1062 | xfs_warn(mp, "log device read failed"); |
1067 | return EIO; | 1063 | return EIO; |
1068 | } | 1064 | } |
1069 | xfs_buf_relse(bp); | 1065 | xfs_buf_relse(bp); |
@@ -1175,8 +1171,7 @@ xfs_mountfs( | |||
1175 | * transaction subsystem is online. | 1171 | * transaction subsystem is online. |
1176 | */ | 1172 | */ |
1177 | if (xfs_sb_has_mismatched_features2(sbp)) { | 1173 | if (xfs_sb_has_mismatched_features2(sbp)) { |
1178 | cmn_err(CE_WARN, | 1174 | xfs_warn(mp, "correcting sb_features alignment problem"); |
1179 | "XFS: correcting sb_features alignment problem"); | ||
1180 | sbp->sb_features2 |= sbp->sb_bad_features2; | 1175 | sbp->sb_features2 |= sbp->sb_bad_features2; |
1181 | sbp->sb_bad_features2 = sbp->sb_features2; | 1176 | sbp->sb_bad_features2 = sbp->sb_features2; |
1182 | mp->m_update_flags |= XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2; | 1177 | mp->m_update_flags |= XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2; |
@@ -1255,7 +1250,7 @@ xfs_mountfs( | |||
1255 | */ | 1250 | */ |
1256 | error = xfs_rtmount_init(mp); | 1251 | error = xfs_rtmount_init(mp); |
1257 | if (error) { | 1252 | if (error) { |
1258 | cmn_err(CE_WARN, "XFS: RT mount failed"); | 1253 | xfs_warn(mp, "RT mount failed"); |
1259 | goto out_remove_uuid; | 1254 | goto out_remove_uuid; |
1260 | } | 1255 | } |
1261 | 1256 | ||
@@ -1286,12 +1281,12 @@ xfs_mountfs( | |||
1286 | INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); | 1281 | INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); |
1287 | error = xfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi); | 1282 | error = xfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi); |
1288 | if (error) { | 1283 | if (error) { |
1289 | cmn_err(CE_WARN, "XFS: Failed per-ag init: %d", error); | 1284 | xfs_warn(mp, "Failed per-ag init: %d", error); |
1290 | goto out_remove_uuid; | 1285 | goto out_remove_uuid; |
1291 | } | 1286 | } |
1292 | 1287 | ||
1293 | if (!sbp->sb_logblocks) { | 1288 | if (!sbp->sb_logblocks) { |
1294 | cmn_err(CE_WARN, "XFS: no log defined"); | 1289 | xfs_warn(mp, "no log defined"); |
1295 | XFS_ERROR_REPORT("xfs_mountfs", XFS_ERRLEVEL_LOW, mp); | 1290 | XFS_ERROR_REPORT("xfs_mountfs", XFS_ERRLEVEL_LOW, mp); |
1296 | error = XFS_ERROR(EFSCORRUPTED); | 1291 | error = XFS_ERROR(EFSCORRUPTED); |
1297 | goto out_free_perag; | 1292 | goto out_free_perag; |
@@ -1304,7 +1299,7 @@ xfs_mountfs( | |||
1304 | XFS_FSB_TO_DADDR(mp, sbp->sb_logstart), | 1299 | XFS_FSB_TO_DADDR(mp, sbp->sb_logstart), |
1305 | XFS_FSB_TO_BB(mp, sbp->sb_logblocks)); | 1300 | XFS_FSB_TO_BB(mp, sbp->sb_logblocks)); |
1306 | if (error) { | 1301 | if (error) { |
1307 | cmn_err(CE_WARN, "XFS: log mount failed"); | 1302 | xfs_warn(mp, "log mount failed"); |
1308 | goto out_free_perag; | 1303 | goto out_free_perag; |
1309 | } | 1304 | } |
1310 | 1305 | ||
@@ -1341,16 +1336,14 @@ xfs_mountfs( | |||
1341 | */ | 1336 | */ |
1342 | error = xfs_iget(mp, NULL, sbp->sb_rootino, 0, XFS_ILOCK_EXCL, &rip); | 1337 | error = xfs_iget(mp, NULL, sbp->sb_rootino, 0, XFS_ILOCK_EXCL, &rip); |
1343 | if (error) { | 1338 | if (error) { |
1344 | cmn_err(CE_WARN, "XFS: failed to read root inode"); | 1339 | xfs_warn(mp, "failed to read root inode"); |
1345 | goto out_log_dealloc; | 1340 | goto out_log_dealloc; |
1346 | } | 1341 | } |
1347 | 1342 | ||
1348 | ASSERT(rip != NULL); | 1343 | ASSERT(rip != NULL); |
1349 | 1344 | ||
1350 | if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) { | 1345 | if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) { |
1351 | cmn_err(CE_WARN, "XFS: corrupted root inode"); | 1346 | xfs_warn(mp, "corrupted root inode %llu: not a directory", |
1352 | cmn_err(CE_WARN, "Device %s - root %llu is not a directory", | ||
1353 | XFS_BUFTARG_NAME(mp->m_ddev_targp), | ||
1354 | (unsigned long long)rip->i_ino); | 1347 | (unsigned long long)rip->i_ino); |
1355 | xfs_iunlock(rip, XFS_ILOCK_EXCL); | 1348 | xfs_iunlock(rip, XFS_ILOCK_EXCL); |
1356 | XFS_ERROR_REPORT("xfs_mountfs_int(2)", XFS_ERRLEVEL_LOW, | 1349 | XFS_ERROR_REPORT("xfs_mountfs_int(2)", XFS_ERRLEVEL_LOW, |
@@ -1370,7 +1363,7 @@ xfs_mountfs( | |||
1370 | /* | 1363 | /* |
1371 | * Free up the root inode. | 1364 | * Free up the root inode. |
1372 | */ | 1365 | */ |
1373 | cmn_err(CE_WARN, "XFS: failed to read RT inodes"); | 1366 | xfs_warn(mp, "failed to read RT inodes"); |
1374 | goto out_rele_rip; | 1367 | goto out_rele_rip; |
1375 | } | 1368 | } |
1376 | 1369 | ||
@@ -1382,7 +1375,7 @@ xfs_mountfs( | |||
1382 | if (mp->m_update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY)) { | 1375 | if (mp->m_update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY)) { |
1383 | error = xfs_mount_log_sb(mp, mp->m_update_flags); | 1376 | error = xfs_mount_log_sb(mp, mp->m_update_flags); |
1384 | if (error) { | 1377 | if (error) { |
1385 | cmn_err(CE_WARN, "XFS: failed to write sb changes"); | 1378 | xfs_warn(mp, "failed to write sb changes"); |
1386 | goto out_rtunmount; | 1379 | goto out_rtunmount; |
1387 | } | 1380 | } |
1388 | } | 1381 | } |
@@ -1403,10 +1396,7 @@ xfs_mountfs( | |||
1403 | * quotachecked license. | 1396 | * quotachecked license. |
1404 | */ | 1397 | */ |
1405 | if (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT) { | 1398 | if (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT) { |
1406 | cmn_err(CE_NOTE, | 1399 | xfs_notice(mp, "resetting quota flags"); |
1407 | "XFS: resetting qflags for filesystem %s", | ||
1408 | mp->m_fsname); | ||
1409 | |||
1410 | error = xfs_mount_reset_sbqflags(mp); | 1400 | error = xfs_mount_reset_sbqflags(mp); |
1411 | if (error) | 1401 | if (error) |
1412 | return error; | 1402 | return error; |
@@ -1420,7 +1410,7 @@ xfs_mountfs( | |||
1420 | */ | 1410 | */ |
1421 | error = xfs_log_mount_finish(mp); | 1411 | error = xfs_log_mount_finish(mp); |
1422 | if (error) { | 1412 | if (error) { |
1423 | cmn_err(CE_WARN, "XFS: log mount finish failed"); | 1413 | xfs_warn(mp, "log mount finish failed"); |
1424 | goto out_rtunmount; | 1414 | goto out_rtunmount; |
1425 | } | 1415 | } |
1426 | 1416 | ||
@@ -1449,8 +1439,8 @@ xfs_mountfs( | |||
1449 | resblks = xfs_default_resblks(mp); | 1439 | resblks = xfs_default_resblks(mp); |
1450 | error = xfs_reserve_blocks(mp, &resblks, NULL); | 1440 | error = xfs_reserve_blocks(mp, &resblks, NULL); |
1451 | if (error) | 1441 | if (error) |
1452 | cmn_err(CE_WARN, "XFS: Unable to allocate reserve " | 1442 | xfs_warn(mp, |
1453 | "blocks. Continuing without a reserve pool."); | 1443 | "Unable to allocate reserve blocks. Continuing without reserve pool."); |
1454 | } | 1444 | } |
1455 | 1445 | ||
1456 | return 0; | 1446 | return 0; |
@@ -1539,12 +1529,12 @@ xfs_unmountfs( | |||
1539 | resblks = 0; | 1529 | resblks = 0; |
1540 | error = xfs_reserve_blocks(mp, &resblks, NULL); | 1530 | error = xfs_reserve_blocks(mp, &resblks, NULL); |
1541 | if (error) | 1531 | if (error) |
1542 | cmn_err(CE_WARN, "XFS: Unable to free reserved block pool. " | 1532 | xfs_warn(mp, "Unable to free reserved block pool. " |
1543 | "Freespace may not be correct on next mount."); | 1533 | "Freespace may not be correct on next mount."); |
1544 | 1534 | ||
1545 | error = xfs_log_sbcount(mp, 1); | 1535 | error = xfs_log_sbcount(mp, 1); |
1546 | if (error) | 1536 | if (error) |
1547 | cmn_err(CE_WARN, "XFS: Unable to update superblock counters. " | 1537 | xfs_warn(mp, "Unable to update superblock counters. " |
1548 | "Freespace may not be correct on next mount."); | 1538 | "Freespace may not be correct on next mount."); |
1549 | xfs_unmountfs_writesb(mp); | 1539 | xfs_unmountfs_writesb(mp); |
1550 | xfs_unmountfs_wait(mp); /* wait for async bufs */ | 1540 | xfs_unmountfs_wait(mp); /* wait for async bufs */ |
@@ -2027,10 +2017,8 @@ xfs_dev_is_read_only( | |||
2027 | if (xfs_readonly_buftarg(mp->m_ddev_targp) || | 2017 | if (xfs_readonly_buftarg(mp->m_ddev_targp) || |
2028 | xfs_readonly_buftarg(mp->m_logdev_targp) || | 2018 | xfs_readonly_buftarg(mp->m_logdev_targp) || |
2029 | (mp->m_rtdev_targp && xfs_readonly_buftarg(mp->m_rtdev_targp))) { | 2019 | (mp->m_rtdev_targp && xfs_readonly_buftarg(mp->m_rtdev_targp))) { |
2030 | cmn_err(CE_NOTE, | 2020 | xfs_notice(mp, "%s required on read-only device.", message); |
2031 | "XFS: %s required on read-only device.", message); | 2021 | xfs_notice(mp, "write access unavailable, cannot proceed."); |
2032 | cmn_err(CE_NOTE, | ||
2033 | "XFS: write access unavailable, cannot proceed."); | ||
2034 | return EROFS; | 2022 | return EROFS; |
2035 | } | 2023 | } |
2036 | return 0; | 2024 | return 0; |
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index fbff89344bad..8f76fdff4f46 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c | |||
@@ -2210,8 +2210,8 @@ xfs_rtmount_init( | |||
2210 | if (sbp->sb_rblocks == 0) | 2210 | if (sbp->sb_rblocks == 0) |
2211 | return 0; | 2211 | return 0; |
2212 | if (mp->m_rtdev_targp == NULL) { | 2212 | if (mp->m_rtdev_targp == NULL) { |
2213 | cmn_err(CE_WARN, | 2213 | xfs_warn(mp, |
2214 | "XFS: This filesystem has a realtime volume, use rtdev=device option"); | 2214 | "Filesystem has a realtime volume, use rtdev=device option"); |
2215 | return XFS_ERROR(ENODEV); | 2215 | return XFS_ERROR(ENODEV); |
2216 | } | 2216 | } |
2217 | mp->m_rsumlevels = sbp->sb_rextslog + 1; | 2217 | mp->m_rsumlevels = sbp->sb_rextslog + 1; |
@@ -2225,7 +2225,7 @@ xfs_rtmount_init( | |||
2225 | */ | 2225 | */ |
2226 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_rblocks); | 2226 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_rblocks); |
2227 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_rblocks) { | 2227 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_rblocks) { |
2228 | cmn_err(CE_WARN, "XFS: realtime mount -- %llu != %llu", | 2228 | xfs_warn(mp, "realtime mount -- %llu != %llu", |
2229 | (unsigned long long) XFS_BB_TO_FSB(mp, d), | 2229 | (unsigned long long) XFS_BB_TO_FSB(mp, d), |
2230 | (unsigned long long) mp->m_sb.sb_rblocks); | 2230 | (unsigned long long) mp->m_sb.sb_rblocks); |
2231 | return XFS_ERROR(EFBIG); | 2231 | return XFS_ERROR(EFBIG); |
@@ -2234,7 +2234,7 @@ xfs_rtmount_init( | |||
2234 | d - XFS_FSB_TO_BB(mp, 1), | 2234 | d - XFS_FSB_TO_BB(mp, 1), |
2235 | XFS_FSB_TO_B(mp, 1), 0); | 2235 | XFS_FSB_TO_B(mp, 1), 0); |
2236 | if (!bp) { | 2236 | if (!bp) { |
2237 | cmn_err(CE_WARN, "XFS: realtime device size check failed"); | 2237 | xfs_warn(mp, "realtime device size check failed"); |
2238 | return EIO; | 2238 | return EIO; |
2239 | } | 2239 | } |
2240 | xfs_buf_relse(bp); | 2240 | xfs_buf_relse(bp); |
diff --git a/fs/xfs/xfs_rtalloc.h b/fs/xfs/xfs_rtalloc.h index ff614c29b441..09e1f4f35e97 100644 --- a/fs/xfs/xfs_rtalloc.h +++ b/fs/xfs/xfs_rtalloc.h | |||
@@ -154,7 +154,7 @@ xfs_rtmount_init( | |||
154 | if (mp->m_sb.sb_rblocks == 0) | 154 | if (mp->m_sb.sb_rblocks == 0) |
155 | return 0; | 155 | return 0; |
156 | 156 | ||
157 | cmn_err(CE_WARN, "XFS: Not built with CONFIG_XFS_RT"); | 157 | xfs_warn(mp, "Not built with CONFIG_XFS_RT"); |
158 | return ENOSYS; | 158 | return ENOSYS; |
159 | } | 159 | } |
160 | # define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS)) | 160 | # define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS)) |
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c index ae6f49613412..d6d6fdfe9422 100644 --- a/fs/xfs/xfs_rw.c +++ b/fs/xfs/xfs_rw.c | |||
@@ -49,9 +49,9 @@ xfs_do_force_shutdown( | |||
49 | logerror = flags & SHUTDOWN_LOG_IO_ERROR; | 49 | logerror = flags & SHUTDOWN_LOG_IO_ERROR; |
50 | 50 | ||
51 | if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { | 51 | if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { |
52 | cmn_err(CE_NOTE, "xfs_force_shutdown(%s,0x%x) called from " | 52 | xfs_notice(mp, |
53 | "line %d of file %s. Return address = 0x%p", | 53 | "%s(0x%x) called from line %d of file %s. Return address = 0x%p", |
54 | mp->m_fsname, flags, lnnum, fname, __return_address); | 54 | __func__, flags, lnnum, fname, __return_address); |
55 | } | 55 | } |
56 | /* | 56 | /* |
57 | * No need to duplicate efforts. | 57 | * No need to duplicate efforts. |
@@ -86,8 +86,8 @@ xfs_do_force_shutdown( | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { | 88 | if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { |
89 | cmn_err(CE_ALERT, "Please umount the filesystem, " | 89 | xfs_alert(mp, |
90 | "and rectify the problem(s)"); | 90 | "Please umount the filesystem and rectify the problem(s)"); |
91 | } | 91 | } |
92 | } | 92 | } |
93 | 93 | ||
@@ -101,10 +101,9 @@ xfs_ioerror_alert( | |||
101 | xfs_buf_t *bp, | 101 | xfs_buf_t *bp, |
102 | xfs_daddr_t blkno) | 102 | xfs_daddr_t blkno) |
103 | { | 103 | { |
104 | cmn_err(CE_ALERT, | 104 | xfs_alert(mp, |
105 | "I/O error in filesystem (\"%s\") meta-data dev %s block 0x%llx" | 105 | "I/O error occurred: meta-data dev %s block 0x%llx" |
106 | " (\"%s\") error %d buf count %zd", | 106 | " (\"%s\") error %d buf count %zd", |
107 | (!mp || !mp->m_fsname) ? "(fs name not set)" : mp->m_fsname, | ||
108 | XFS_BUFTARG_NAME(XFS_BUF_TARGET(bp)), | 107 | XFS_BUFTARG_NAME(XFS_BUF_TARGET(bp)), |
109 | (__uint64_t)blkno, func, | 108 | (__uint64_t)blkno, func, |
110 | XFS_BUF_GETERROR(bp), XFS_BUF_COUNT(bp)); | 109 | XFS_BUF_GETERROR(bp), XFS_BUF_COUNT(bp)); |
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index c47918c302a5..3bea66132334 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c | |||
@@ -305,7 +305,7 @@ xfs_trans_read_buf( | |||
305 | if (xfs_error_target == target) { | 305 | if (xfs_error_target == target) { |
306 | if (((xfs_req_num++) % xfs_error_mod) == 0) { | 306 | if (((xfs_req_num++) % xfs_error_mod) == 0) { |
307 | xfs_buf_relse(bp); | 307 | xfs_buf_relse(bp); |
308 | cmn_err(CE_DEBUG, "Returning error!\n"); | 308 | xfs_debug(mp, "Returning error!"); |
309 | return XFS_ERROR(EIO); | 309 | return XFS_ERROR(EIO); |
310 | } | 310 | } |
311 | } | 311 | } |
@@ -403,7 +403,7 @@ xfs_trans_read_buf( | |||
403 | xfs_force_shutdown(tp->t_mountp, | 403 | xfs_force_shutdown(tp->t_mountp, |
404 | SHUTDOWN_META_IO_ERROR); | 404 | SHUTDOWN_META_IO_ERROR); |
405 | xfs_buf_relse(bp); | 405 | xfs_buf_relse(bp); |
406 | cmn_err(CE_DEBUG, "Returning trans error!\n"); | 406 | xfs_debug(mp, "Returning trans error!"); |
407 | return XFS_ERROR(EIO); | 407 | return XFS_ERROR(EIO); |
408 | } | 408 | } |
409 | } | 409 | } |
@@ -427,7 +427,7 @@ shutdown_abort: | |||
427 | */ | 427 | */ |
428 | #if defined(DEBUG) | 428 | #if defined(DEBUG) |
429 | if (XFS_BUF_ISSTALE(bp) && XFS_BUF_ISDELAYWRITE(bp)) | 429 | if (XFS_BUF_ISSTALE(bp) && XFS_BUF_ISDELAYWRITE(bp)) |
430 | cmn_err(CE_NOTE, "about to pop assert, bp == 0x%p", bp); | 430 | xfs_notice(mp, "about to pop assert, bp == 0x%p", bp); |
431 | #endif | 431 | #endif |
432 | ASSERT((XFS_BUF_BFLAGS(bp) & (XBF_STALE|XBF_DELWRI)) != | 432 | ASSERT((XFS_BUF_BFLAGS(bp) & (XBF_STALE|XBF_DELWRI)) != |
433 | (XBF_STALE|XBF_DELWRI)); | 433 | (XBF_STALE|XBF_DELWRI)); |
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index e919ae1e9c65..37d8146ee15b 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -1189,9 +1189,8 @@ xfs_inactive( | |||
1189 | * inode might be lost for a long time or forever. | 1189 | * inode might be lost for a long time or forever. |
1190 | */ | 1190 | */ |
1191 | if (!XFS_FORCED_SHUTDOWN(mp)) { | 1191 | if (!XFS_FORCED_SHUTDOWN(mp)) { |
1192 | cmn_err(CE_NOTE, | 1192 | xfs_notice(mp, "%s: xfs_ifree returned error %d", |
1193 | "xfs_inactive: xfs_ifree() returned an error = %d on %s", | 1193 | __func__, error); |
1194 | error, mp->m_fsname); | ||
1195 | xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR); | 1194 | xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR); |
1196 | } | 1195 | } |
1197 | xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); | 1196 | xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); |