From 38b22798cbac54b813b7495d9b9e9e06e48ac705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20M=C3=BCnnich?= Date: Thu, 25 Jun 2026 12:55:29 +0200 Subject: [PATCH] fix(linbo_partition): retry umount /cache to survive concurrent re-mounts 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 --- linbofs/usr/bin/linbo_partition | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/linbofs/usr/bin/linbo_partition b/linbofs/usr/bin/linbo_partition index ee900006..1b6df02a 100755 --- a/linbofs/usr/bin/linbo_partition +++ b/linbofs/usr/bin/linbo_partition @@ -211,7 +211,13 @@ fi killalltorrents cd / -mount | grep -q ' /cache ' && umount /cache &> /dev/null && sleep 3 +# Retry umount up to 10 times: linbo_gui periodically re-mounts /cache for +# status polling, racing against a single umount + sleep. +for _ in 1 2 3 4 5 6 7 8 9 10; do + mount | grep -q ' /cache ' || break + umount /cache &> /dev/null + sleep 1 +done if mount | grep -q ' /cache '; then echo "Cannot unmount /cache." >&2 exit 1