xfs: test regression in shrink when the new EOFS splits a sparse inode cluster
This is a targeted regression test for commit
da062d16a897 ("xfs:
check for sparse inode clusters that cross new EOAG when shrinking"),
which was found by running the random-loopy shrink stresser xfs/168.
The original shrink implementation assumed that if we could allocate
the last free extent in the filesystem, it was ok to proceed with
the fs shrink. Unfortunately, this isn't quite the case -- if
there's a sparse inode cluster such that the blocks at the end of
the cluster are free, it is not ok to shrink the fs to the point
that part of the cluster hangs off the end of the filesystem. Doing
so results in repair and scrub marking the filesystem corrupt, so we
must not.
(EOFS == "end of filesystem"; EOAG == "end of allocation group")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>