Skip to contentSkip to conversation

xfs_quota: display warning limits when printing quota type information

PATCH In review Darrick J. Wong 2 participants 3 messages Jul 9, 2020 – Jul 10, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_quota: display warning limits when printing quota type information

From: Darrick J. Wong <[email protected]>

We should dump the default warning limits when we're printing quota information.

---
 quota/state.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
quota/state.c +14 -0
index 8f9718f1..a90b0d9e 100644
@@ -130,6 +130,16 @@ state_timelimit(
 		time_to_string(timelimit, VERBOSE_FLAG | ABSOLUTE_FLAG));
 }
 
+static void
+state_warnlimit(
+	FILE		*fp,
+	uint		form,
+	uint16_t	warnlimit)
+{
+	fprintf(fp, _("%s max warnings: %u\n"),
+		form_to_string(form), warnlimit);
+}
+
 /*
  * fs_quota_stat holds a subset of fs_quota_statv; this copies
  * the smaller into the larger, leaving any not-present fields
@@ -218,7 +228,11 @@ state_quotafile_mount(
 				sv.qs_flags & XFS_QUOTA_PDQ_ENFD);
 
 	state_timelimit(fp, XFS_BLOCK_QUOTA, sv.qs_btimelimit);
+	state_warnlimit(fp, XFS_BLOCK_QUOTA, sv.qs_bwarnlimit);
+
 	state_timelimit(fp, XFS_INODE_QUOTA, sv.qs_itimelimit);
+	state_warnlimit(fp, XFS_INODE_QUOTA, sv.qs_iwarnlimit);
+
 	state_timelimit(fp, XFS_RTBLOCK_QUOTA, sv.qs_rtbtimelimit);
 }
 
#2 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 4 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

We should dump the default warning limits when we're printing quota information.

This looks sensible. Do we need any xfstests changes for thew new output, though?

Yep. I'll throw that series in at the end of the next round of the quota refactoring.

--D