Skip to contentSkip to conversation

e2fsck: fix type mismatches in quota warning message

PATCH Applied Eric Whitney 2 participants 2 messages Mar 31, 2017 – Apr 1, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e2fsck: fix type mismatches in quota warning message

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.

---
 lib/support/mkquota.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
lib/support/mkquota.c +7 -7
index 8629266..1bb43a7 100644
@@ -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) {
Signature · 1 line
2.1.4
#1 lore raw
Quoted 10 lines · Eric Whitney

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.

Thanks, applied.

- Ted