fix(linbo_partition): retry umount /cache to survive concurrent re-mounts#155
Open
helge42 wants to merge 1 commit into
Open
fix(linbo_partition): retry umount /cache to survive concurrent re-mounts#155helge42 wants to merge 1 commit into
helge42 wants to merge 1 commit into
Conversation
…unts linbo_gui periodically re-mounts /cache for status polling (visible as recurring mount/unmount cycles in dmesg on an otherwise idle client). The single "umount /cache; sleep 3; re-check" sequence in linbo_partition races against this polling: the umount succeeds, then the polling re-mounts /cache during the 3 seconds, and the re-check aborts with "Cannot unmount /cache." This reproduces reliably with `linbo-remote -c format` (or partition) on fast hardware (e.g. NVMe), while `linbo-wrapper format` started locally from the GUI tends to miss the race window and works. Replace the single attempt with a short retry loop (up to 10 x 1 s). As soon as one iteration finds /cache unmounted, the loop exits and the existing failure check still fires if /cache is permanently busy. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
linbo-remote -i <host> -c format(orpartition) aborts with:Running the same operation locally via
linbo-wrapper formatfrom the LINBO GUI / shell works. The bug therefore looks client-state-dependent but is in fact a timing race: it hits fast hardware (NVMe) reliably and slower hardware (HDD / older SSD) only sporadically.Root cause
linbo_guiperiodically re-mounts/cachefor status polling. On an otherwise idle client this is visible indmesgas recurring cycles roughly every second:linbo_partitiondoes (lines 213–218):The
umountsucceeds — but during thesleep 3the polling re-mounts/cache, and the subsequentmount | grepre-check then aborts.gui_ctl disable, whichlinbo-remotecalls before format, hides the GUI but does not stop the status polling.Reproduction
/cachemounted.while :; do date '+%H:%M:%S'; mount | grep cache; sleep 0.2; donelinbo-remote -i <client> -c format— fails withCannot unmount /cache.linbo-wrapper format— works.Fix
Replace the single
umount+sleep 3with a short retry loop (up to 10 × 1 s). As soon as one iteration finds/cacheunmounted, the loop exits and the existing failure check still fires if/cacheis permanently busy. No new dependencies, behavior unchanged for the "not busy at all" case.Test
Patched
linbo_partitionvia a pre-hook inupdate-linbofs.pre.don a production linuxmuster.net 7 server (linbofs64, 4.3.33). After PXE-booting test clients,linbo-remote -c formatruns reliably across multiple invocations and on multiple clients. No regression observed for locallinbo-wrapper format.