xfs: test delalloc quota leak when chprojid fails
authorDarrick J. Wong <djwong@kernel.org>
Tue, 9 Mar 2021 04:40:58 +0000 (20:40 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 14 Mar 2021 17:51:35 +0000 (01:51 +0800)
commitf6ddaf130d5b0817278afe441fdde52f464f321b
tree454f578298f1fb33a4b8736f64b2823e99b6515d
parent01b30c9da97c41ceee38ff5bedc6841dcfd41c0e
xfs: test delalloc quota leak when chprojid fails

This is a regression test for a bug in the XFS implementation of
FSSETXATTR.  When we try to change a file's project id, the quota
reservation code will update the incore quota reservations for delayed
allocation blocks.  Unfortunately, it does this before we finish
validating all the FSSETXATTR parameters, which means that if we decide
to bail out, we also fail to undo the incore changes.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
.gitignore
src/Makefile
src/chprojid_fail.c [new file with mode: 0644]
tests/xfs/145 [new file with mode: 0755]
tests/xfs/145.out [new file with mode: 0644]
tests/xfs/group