fix: detect mounts via /proc/self/mountinfo so stale FUSE works
Update PKGBUILD version / update-pkgver (push) Successful in 5s

mountinfo.Mounted lstats the path. When the sshfs link dies, every stat
on the mountpoint returns EIO, so -l filtered the dead mount out, mount
failed in MkdirAll, and -u failed before fusermount. Switch detection to
mountinfo.GetMounts (no stat) and add a fusermount -uz fallback so a
stale mount can actually be torn down.
This commit is contained in:
2026-05-04 10:08:13 +02:00
parent 8edddc5a28
commit e6a02e5bf7
3 changed files with 102 additions and 19 deletions
+22
View File
@@ -200,3 +200,25 @@ func TestUnmountNotMountedExistingDir(t *testing.T) {
t.Fatalf("want not-mounted error, got %v", err)
}
}
func TestIsMountedAtFalseOnPlainDir(t *testing.T) {
dir := t.TempDir()
ok, err := is_mounted_at(dir)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if ok {
t.Fatalf("plain tempdir should not be a mountpoint")
}
}
func TestIsMountedAtFalseOnMissingPath(t *testing.T) {
dir := t.TempDir()
ok, err := is_mounted_at(filepath.Join(dir, "nope"))
if err != nil {
t.Fatalf("unexpected error (no stat should happen): %v", err)
}
if ok {
t.Fatalf("missing path should not be a mountpoint")
}
}