Skip to content

squashfs, overlay: unmount the rom once nothing is holding it - #16093

Open
aderumier wants to merge 1 commit into
batocera-linux:masterfrom
aderumier:squashfs-umount-fix
Open

squashfs, overlay: unmount the rom once nothing is holding it#16093
aderumier wants to merge 1 commit into
batocera-linux:masterfrom
aderumier:squashfs-umount-fix

Conversation

@aderumier

Copy link
Copy Markdown
Contributor

configgen chdirs into the game's directory to run it and stays there, so with a rom on a squashfs it was still sitting in the mount at unmount time, and umount could only fail with EBUSY: a process cannot unmount its own working directory. Restore the directory on the way out.

Processes that were killed rather than closed also take a moment to let go of the mount, so retry for a few seconds, then detach lazily: the kernel drops the mount once the last one lets go, which beats leaking it until the next reboot.

Comment thread package/batocera/core/batocera-configgen/configgen/configgen/utils/mounts.py Outdated
configgen chdirs into the game's directory to run it and stays there, so
with a rom on a squashfs it was still sitting in the mount at unmount
time, and umount could only fail with EBUSY: a process cannot unmount
its own working directory. Restore the directory on the way out.

A game that was killed rather than closed could still leave a process
holding the mount while it dies, so fall back to detaching it lazily.
@aderumier
aderumier force-pushed the squashfs-umount-fix branch from d5e3b6a to 0479546 Compare July 26, 2026 05:57
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.

2 participants