]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: group quota should return EDQUOT when prj quota enabled
authorEric Sandeen <sandeen@redhat.com>
Mon, 7 Nov 2022 04:03:25 +0000 (09:33 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2022 16:57:54 +0000 (17:57 +0100)
commit30082dc517f4a94002e5973ff5136abc90b420b9
tree34d9465f12e1ae7bfc5f43f38bbb1b03a8ff4560
parent405ae085f308a75d2cc37048372d5c9fe5998e30
xfs: group quota should return EDQUOT when prj quota enabled

commit 2e92bc4b2813478284d1afce8ec078c051f074ee upstream.

Long ago, group & project quota were mutually exclusive, and so
when we turned on XFS_QMOPT_ENOSPC ("return ENOSPC if project quota
is exceeded") when project quota was enabled, we only needed to
disable it again for user quota.

When group & project quota got separated, this got missed, and as a
result if project quota is enabled and group quota is exceeded, the
error code returned is incorrectly returned as ENOSPC not EDQUOT.

Fix this by stripping XFS_QMOPT_ENOSPC out of flags for group
quota when we try to reserve the space.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_trans_dquot.c