]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_quota: display default limits for users with zero usage
authorRavi Singh <ravising@redhat.com>
Tue, 14 Apr 2026 07:19:21 +0000 (15:19 +0800)
committerAndrey Albershteyn <aalbersh@kernel.org>
Fri, 17 Apr 2026 09:09:10 +0000 (11:09 +0200)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
quota/quota.c

index fea55f03b34257dfcbe1232612c577ecbd23fc25..08a07b2088817ba4c125b0b30692e4771a96b2b8 100644 (file)
@@ -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;