All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e2fsck: fix type mismatches in quota warning message
@ 2017-03-31 23:21 Eric Whitney
  2017-04-01 16:16 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Whitney @ 2017-03-31 23:21 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso

The conversion operations in the format control strings found in the
fprintf call used to print the quota warning message do not match the
types of their corresponding arguments.  Although this probably hasn't
generally been a problem, it obfuscates a bigalloc quota accounting bug
where the reported actual quota goes negative.

Clean up the mismatches and some unnecessary casts.  While we're at it,
fix a spelling nit in a related comment.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
---
 lib/support/mkquota.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c
index 8629266..1bb43a7 100644
--- a/lib/support/mkquota.c
+++ b/lib/support/mkquota.c
@@ -518,16 +518,16 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
 	print_dquot("mem", dq);
 	print_dquot("dsk", dquot);
 
-	/* Check if there is inconsistancy. */
+	/* Check if there is inconsistency */
 	if (dq->dq_dqb.dqb_curspace != dquot->dq_dqb.dqb_curspace ||
 	    dq->dq_dqb.dqb_curinodes != dquot->dq_dqb.dqb_curinodes) {
 		scan_data->usage_is_inconsistent = 1;
-		fprintf(stderr, "[QUOTA WARNING] Usage inconsistent for ID %d:"
-			"actual (%llu, %llu) != expected (%llu, %llu)\n",
-			dq->dq_id, (long long)dq->dq_dqb.dqb_curspace,
-			(long long)dq->dq_dqb.dqb_curinodes,
-			(long long)dquot->dq_dqb.dqb_curspace,
-			(long long)dquot->dq_dqb.dqb_curinodes);
+		fprintf(stderr, "[QUOTA WARNING] Usage inconsistent for ID %u:"
+			"actual (%lld, %lld) != expected (%lld, %lld)\n",
+			dq->dq_id, dq->dq_dqb.dqb_curspace,
+			dq->dq_dqb.dqb_curinodes,
+			dquot->dq_dqb.dqb_curspace,
+			dquot->dq_dqb.dqb_curinodes);
 	}
 
 	if (scan_data->update_limits) {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-01 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 23:21 [PATCH] e2fsck: fix type mismatches in quota warning message Eric Whitney
2017-04-01 16:16 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.