From: Ravi Singh <ravising@redhat.com>
To: linux-xfs@vger.kernel.org
Cc: cem@kernel.org, djwong@kernel.org, hch@infradead.org,
aalbersh@redhat.com
Subject: [PATCH] xfs_quota: display default limits for users with zero usage
Date: Tue, 14 Apr 2026 15:19:21 +0800 [thread overview]
Message-ID: <20260414071921.1226575-1-ravising@redhat.com> (raw)
When the kernel returns default quota limits for IDs without a dquot
on disk, xfs_quota suppresses the output because it only checks
usage counters (d_bcount, d_icount, d_rtbcount). If all counters
are zero the line is skipped even though non-zero limits apply.
Also check the soft/hard limit fields so that quota output is
displayed whenever limits are configured, even if usage is zero.
This is the userspace companion to the kernel commit:
"xfs: return default quota limits for IDs without a dquot"
Signed-off-by: Ravi Singh <ravising@redhat.com>
---
quota/quota.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/quota/quota.c b/quota/quota.c
index fea55f03..08a07b20 100644
--- a/quota/quota.c
+++ b/quota/quota.c
@@ -62,11 +62,14 @@ quota_mount(
if (!(flags & VERBOSE_FLAG)) {
count = 0;
- if ((form & XFS_BLOCK_QUOTA) && d.d_bcount)
+ if ((form & XFS_BLOCK_QUOTA) &&
+ (d.d_bcount || d.d_blk_softlimit || d.d_blk_hardlimit))
count++;
- if ((form & XFS_INODE_QUOTA) && d.d_icount)
+ if ((form & XFS_INODE_QUOTA) &&
+ (d.d_icount || d.d_ino_softlimit || d.d_ino_hardlimit))
count++;
- if ((form & XFS_RTBLOCK_QUOTA) && d.d_rtbcount)
+ if ((form & XFS_RTBLOCK_QUOTA) &&
+ (d.d_rtbcount || d.d_rtb_softlimit || d.d_rtb_hardlimit))
count++;
if (!count)
return 0;
--
2.49.0
next reply other threads:[~2026-04-14 7:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 7:19 Ravi Singh [this message]
2026-04-14 8:02 ` [PATCH] xfs_quota: display default limits for users with zero usage Christoph Hellwig
2026-04-14 9:40 ` Carlos Maiolino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260414071921.1226575-1-ravising@redhat.com \
--to=ravising@redhat.com \
--cc=aalbersh@redhat.com \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox