]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: return default quota limits for IDs without a dquot
authorRavi Singh <ravising@redhat.com>
Mon, 30 Mar 2026 06:14:14 +0000 (14:14 +0800)
committerCarlos Maiolino <cem@kernel.org>
Tue, 31 Mar 2026 10:51:41 +0000 (12:51 +0200)
commit7338419a5e4454cc7a2c9df6af712d6f5ab471e9
treeb94d490297dde199d8b769a5980864a80d3b7d20
parent181ea4e2de422aa0a66f355bd59bccccdd169826
xfs: return default quota limits for IDs without a dquot

When an ID has no dquot on disk, Q_XGETQUOTA returns -ENOENT even
though default quota limits are configured and enforced against that
ID.  This means unprivileged users who have never used any resources
cannot see the limits that apply to them.

When xfs_qm_dqget() returns -ENOENT for a non-zero ID, return a
zero-usage response with the default limits filled in from
m_quotainfo rather than propagating the error.  This is consistent
with the enforcement behavior in xfs_qm_adjust_dqlimits(), which
pushes the same default limits into a dquot when it is first
allocated.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ravi Singh <ravising@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_qm_syscalls.c