Repository navigation
Description
Split out of #533, where the test that would have covered this could not assert a rule nobody has
decided.
What the scripts do today
scripts/preremove.sh's objectfs_mountpoints() and scripts/install.sh's live_mounts() decide
whether a /proc/mounts line is an ObjectFS mount with three case arms:
case "$fstype" in
fuse.objectfs | fuse.s3) ;;
fuse.*)
[ "$device" = "objectfs" ] || continue
;;
*) continue ;;
esacThe middle arm requires the device to be objectfs. The first arm does not — fuse.s3 matches
whatever the device is. So a mount created by some other program with -o subtype=s3 is treated as
ours.
Consequences, both in shipped code:
scripts/preremove.shwarns about it during package removal as if it were an ObjectFS mount left
behind.scripts/install.sh --uninstall(new in The release tarball and install.sh do not carry the mount helper #533) refuses to run while it exists, and tells the
operator toobjectfs unmounta path ObjectFS never mounted. That command will fail, leaving no
way to finish the uninstall except reading the script.
-o subtype=s3 is not reserved. s3fs, goofys, and anything else layered on libfuse can produce it.
Why the first arm has fuse.s3 at all
internal/fuse sets Subtype: "s3" alongside FSName: "objectfs", so the kernel records fstype
fuse.s3 with device objectfs — not fuse.objectfs. The arm was added so a real ObjectFS mount
would be recognized.
It is now redundant. internal/adapter.buildMountOptions hardcodes FSName: "objectfs"
(adapter.go:955); the operator-facing key that could change it was removed by #180 for lack of a
reader. So every mount ObjectFS can currently produce has device=objectfs and is already matched by
the middle arm. Verified by mutation in #533: deleting | fuse.s3 from either script changes no
test outcome, and no fixture row can be written that isolates it without asserting the claim above.
The decision this issue is for
Either:
- Narrow it — drop
| fuse.s3so the device check applies to everyfuse.*fstype. Correct for
every mount ObjectFS can produce today, and stops claiming strangers' mounts. The risk is a future
mount with a different FSName, which is the same hole Nine inert FUSE mount options were removed; plumb the four that name real go-fuse capabilities #180 left and would need a real fix anyway. - Keep the union and fix the remedy — still match
fuse.s3, but have--uninstalldistinguish
"ours" from "possibly ours" and offerumountrather thanobjectfs unmountfor the latter, or
degrade to a warning instead of a refusal.
(1) is the smaller change and the one the evidence supports; it is filed as its own issue only
because it is a behaviour change to a scriptlet already shipped in the .deb and .rpm, which is
not something to fold into a tarball-parity PR.
Whichever is chosen, the fixture in TestBothScriptsAgreeOnWhatAMountedObjectfsLooksLike
(internal/config/mount_helper_test.go) gains a somethingelse /mnt/stranger fuse.s3 row and the
comment recording the limitation comes out.
Activity