Skip to content

Commit 0a1ee76

Browse files
giuseppeclaude
andcommitted
linux: fallback to receiver-side device creation when fsopen fails
When fsopen() is not available (returns ENOSYS), the host-side device pre-creation in prepare_and_send_dev_mounts() cannot proceed since it relies on the new mount API to create a detached tmpfs. Instead of failing, send empty fds to the container process so that libcrun_create_dev() falls back to its existing legacy path (bind mounts or mknod) inside the container's mount namespace. Closes: #2104 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
1 parent 487c9f5 commit 0a1ee76

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/libcrun/linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5440,7 +5440,7 @@ prepare_and_send_dev_mounts (libcrun_container_t *container, int sync_socket_hos
54405440
devs_mountfd = fsopen_mount ("tmpfs", NULL, context_type, label, NULL);
54415441
if (UNLIKELY (devs_mountfd < 0))
54425442
{
5443-
ret = crun_make_error (err, errno, "fsopen_mount `tmpfs`");
5443+
ret = send_mounts (sync_socket_host, dev_fds, 0, def->linux->devices_len, err);
54445444
goto restore_mountns;
54455445
}
54465446

0 commit comments

Comments
 (0)