aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/quota/xfs_qm_syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/quota/xfs_qm_syscalls.c')
-rw-r--r--fs/xfs/quota/xfs_qm_syscalls.c58
1 files changed, 31 insertions, 27 deletions
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}
964STATIC void 965STATIC void
965xfs_qm_dqtest_print( 966xfs_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
978STATIC void 980STATIC 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);