]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_quota: allow users to truncate group and project quota files
authorDarrick J. Wong <djwong@kernel.org>
Wed, 28 Jul 2021 23:05:51 +0000 (19:05 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 28 Jul 2021 23:05:51 +0000 (19:05 -0400)
commit610ec2951ece36ec7e072b442e9fd0bb5be3d18a
tree42a2aaa06ee9473ee33a2bf405fcd700e0e70eca
parentf1ea06d0977600a65ace9debc8c56ac1e01aa9a0
xfs_quota: allow users to truncate group and project quota files

In commit 79ac1ae4, I /think/ xfsprogs gained the ability to deal with
project or group quotas.  For some reason, the quota remove command was
structured so that if the user passes both -g and -p, it will only ask
the kernel truncate the group quota file.  This is a strange behavior
since -ug results in truncation requests for both user and group quota
files, and the kernel is smart enough to return 0 if asked to truncate a
quota file that doesn't exist.

In other words, this is a seemingly arbitrary limitation of the command.
It's an unexpected behavior since we don't do any sort of parameter
validation to warn users when -p is silently ignored.  Modern V5
filesystems support both group and project quotas, so it's all the more
surprising that you can't do group and project all at once.  Remove this
pointless restriction.

Found while triaging xfs/007 regressions.

Fixes: 79ac1ae4 ("Fix xfs_quota disable, enable, off and remove commands Merge of master-melb:xfs-cmds:29395a by kenmcd.")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
quota/state.c