Re: [PATCH] xfs/013: fix ENOSPC handling
Christoph Hellwig <[email protected]>
| Newsgroups | org.kernel.vger.fstests,org.kernel.vger.linux-xfs |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jun 15, 2026 at 09:12:57PM +0900, Shin'ichiro Kawasaki wrote:
> Commit 000813899afb ("fstests: scale some tests for high CPU count
> sanity") replaced "touch" with "echo -n >" to speed up file creation by
> using a shell builtin redirection instead of forking and execing an
> external binary. However, this broke the ENOSPC filtering the test
> relies on.
>
> When the scratch filesystem fills up, the shell redirection "> $dir/$i"
> fails instead of the "touch" command. The shell applies redirections
> left-to-right, so "> $dir/$i" is attempted before "2>&1". Because
> opening the file fails immediately with ENOSPC, the command never runs
> and the shell writes the error message "No space left on device" to the
> stderr instead of the pipe. Then the error message is not passed to
> "filter_enospc" and leaks into the test output, causing the test case
> failure. The failure is recreated by running the test case with rather
> small size of block devices, such as 128MiB null_blk:
Ewww. I've seen the same errors sporadically too in zoned testing,
but never got to the ground of it. The fix looks good:
Reviewed-by: Christoph Hellwig <[email protected]>