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>
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;