xfs_quota: display default limits for users with zero usage
PATCH 1/1 xfs_quota: display default limits for users with zero usage
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"
--- quota/quota.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
quota/quota.c +6 -3
@@ -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 ;
Signature · 1 line
2.49.0
Looks good:
Quoted 5 lines · Ravi Singh
When the kernel returns default quota limits for IDs without a dquot on disk,
xfs_quotasuppresses 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.
Quoted 7 lines
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 <[email protected]>
Looks good
Quoted 30 lines
--- quota/quota.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)quota/quota.c +6
-3@@ -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 ;Signature · 1 line
2.49.0