]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
common/quota: fix to wait for all inodes been evicted in _check_quota_usage()
authorChao Yu <chao@kernel.org>
Tue, 9 Dec 2025 07:50:28 +0000 (15:50 +0800)
committerZorro Lang <zlang@kernel.org>
Thu, 1 Jan 2026 13:14:26 +0000 (21:14 +0800)
commit71131073bc76e4559b9689625687e063c4704ba9
treeef407fee5048ff9cc250b6788e97c24b3da77ac5
parent4c7968b86932ad2e8ae6fa480896ec7174dec9df
common/quota: fix to wait for all inodes been evicted in _check_quota_usage()

generic/233  3s ... - output mismatch (see /share/git/fstests/results//generic/233.out.bad)
    --- tests/generic/233.out   2025-01-12 21:57:40.259440359 +0800
    +++ /share/git/fstests/results//generic/233.out.bad 2025-12-04 03:02:26.000000000 +0800
    @@ -4,4 +4,12 @@

     seed = S
     Comparing user usage
    +4c4
    +< #1000     --   31476   32000   32000            994  1000  1000
    +---
    +> #1000     --   31476   32000   32000            944  1000  1000
    ...
    (Run 'diff -u /share/git/fstests/tests/generic/233.out /share/git/fstests/results//generic/233.out.bad'  to see the entire diff)
Ran: generic/233
Failures: generic/233
Failed 1 of 1 tests

Sometimes, generic/233 will fail due to it founds inode count is mismatched
in between quota system and filesystem.

The reason is cgroup v2 implementation will increase inode reference first,
and then, attach it to thread related cgroup writeback structure, once it
needs to switch write owner of target inode, a kernel thread will process
it, and finally release inode reference via evict_inode().

So, sync & drop_cache may not guarantee all inodes being evicted, as cgroup
has one more referenece on inodes during the time.

If inode has not been evicted, dquot inode reference will not be release, it
will lead to inode count mismatch.

Let's add a delay to wait for cgroup switching completion before quota check.

Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/quota