Skip to content

ufat: fix the rename tests on aarch64 - #31

Merged
brauner merged 1 commit into
mainfrom
renameat
Nov 21, 2026
Merged

brauner merged 1 commit into
mainfrom
renameat

Conversation

@brauner

@brauner brauner commented Nov 21, 2026

Copy link
Copy Markdown
Member

a_failure_after_the_image_got_its_name_syncs_its_directory() fails on
the aarch64 runners:

/tmp/ufat-named-4319/a.img is complete and has its name, but
syncing its directory failed: Input/output error (os error 5)

The test makes the rename of the file written next to the image fail
with a seccomp filter, so the filter has to refuse the system call that
glibc renames with. glibc uses renameat() wherever the kernel has it. I
assumed aarch64 doesn't have it but it does. It's system call 38 there
and glibc's renameat() and rename() both use it. It's riscv64 and
loongarch64 that only have renameat2().

So on aarch64 we refused renameat2(), the rename went through
renameat() and succeeded, and the only failure left was the sync of the
image's directory.

Refuse renameat() on aarch64 too. While at it, let
an_output_that_cannot_replace_leaves_no_temporary_name() run on aarch64
as well. It was limited to x86_64 and x86 for the same reason.

Making the test refuse renameat2() instead of renameat() on x86_64
gives the same failure at the same line every time.

Note that cargo test stops at the first test binary that fails. So the
test binaries that run after ufat's unit tests haven't run on aarch64
with #19's code yet, and this is the first time they do.

a_failure_after_the_image_got_its_name_syncs_its_directory() fails on
the aarch64 runners:

    /tmp/ufat-named-4319/a.img is complete and has its name, but
    syncing its directory failed: Input/output error (os error 5)

The test makes the rename of the file written next to the image fail
with a seccomp filter, so the filter has to refuse the system call that
glibc renames with. glibc uses renameat() wherever the kernel has it. I
assumed aarch64 doesn't have it but it does. It's system call 38 there
and glibc's renameat() and rename() both use it. It's riscv64 and
loongarch64 that only have renameat2().

So on aarch64 we refused renameat2(), the rename went through
renameat() and succeeded, and the only failure left was the sync of the
image's directory.

Refuse renameat() on aarch64 too. While at it, let
an_output_that_cannot_replace_leaves_no_temporary_name() run on aarch64
as well. It was limited to x86_64 and x86 for the same reason.

Fixes: 3882d91 ("ufat: create new images with O_TMPFILE")
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
@brauner
brauner merged commit 51e69a1 into main Nov 21, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant