Re: [PATCH] xfs: test that zone_gc_low_space writes start gc for rw fses
Christoph Hellwig <[email protected]>
| Newsgroups | org.kernel.vger.fstests,org.kernel.vger.linux-xfs |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Mar 25, 2026 at 01:50:13PM +0100, Hans Holmberg wrote:
> Test that writes to the systfs attribute zone_gc_low_space triggers
s/systfs/sysfs/
> +get_scratch_mountstat() {
> + awk -v mount="$SCRATCH_MNT" -v stat="$1" \
> + '$0~"mounted on "mount" with fstype xfs"{f=1} f&&index($0,stat){print $NF;exit}' \
> + /proc/self/mountstats
> +}
> +
> +get_user_available_rt_blocks() {
> + get_scratch_mountstat "user available RT blocks:"
> +}
> +
> +gc_required() {
> + get_scratch_mountstat "RT GC required:"
> +}
Should these go to common/xfs ?
> +
> +# figure out if the rt section is internal or not
> +if [ -z "$SCRATCH_RTDEV" ]; then
> + zdev=$SCRATCH_DEV
> +else
> + zdev=$SCRATCH_RTDEV
> +fi
Same for this asa new helper?
> +[ "$rt_available_post" -gt "$rt_available_pre" ] && _fail "gc should not run while read only"
Split up either using \ or a real if statement to avoid the overly long
line.
> +[ "$rt_available_pre" -ge "$rt_available_post" ] && _fail "gc did not free up space"
Same here.
Otherwise this looks good.