]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
xfs/179: modify test to trigger refcount update bugs
authorDarrick J. Wong <djwong@kernel.org>
Wed, 21 Dec 2022 00:22:02 +0000 (16:22 -0800)
committerZorro Lang <zlang@kernel.org>
Sun, 25 Dec 2022 13:25:45 +0000 (21:25 +0800)
commit56c8f841407c29808d370d06929a3f58c7afeee3
tree03a8f9af8da0371b033a5c52a5916b02fb5d4348
parent5f291f3c9a846a14547444d9d71d0cfe5c2f9a71
xfs/179: modify test to trigger refcount update bugs

Upon enabling fsdax + reflink for XFS, this test began to report
refcount metadata corruptions after being run.  Specifically, xfs_repair
noticed single-block refcount records that could be combined but had not
been.

The root cause of this is improper MAXREFCOUNT edge case handling in
xfs_refcount_merge_extents.  When we're trying to find candidates for a
record merge, we compute the refcount of the merged record, but without
accounting for the fact that once a record hits rc_refcount ==
MAXREFCOUNT, it is pinned that way forever.

Adjust this test to use a sub-filesize write for one of the COW writes,
because this is how we force the extent merge code to run.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/179