Uh oh!
There was an error while loading. Please reload this page.
fix: umount: delete the right metapath - #39
Conversation
We were deleting /run/atomfs/meta/ID/destpath/meta/ID/destpath. So doing atomfs mount oci:a dest atomfs umount dest atomfs mount oci:a dest would fail as /run/atomfs/meta/ID/destpath still existed. Signed-off-by: Serge Hallyn <serge@hallyn.com>
143ecf8 to
62af879Compare
mikemccracken
left a comment
There was a problem hiding this comment.
I don't really understand this issue. Maybe common.ReplacePathSeparators() has an issue with the path you're sending? I'll try to repro with a test.
In any case I don't think this is the right fix. The /run/atomfs/meta/$nsid is shared by everything you atomfs mount within the same mountNS. This change is doing os.RemoveAll('/run/atomfs/') , which will remove stuff from other mounts too.
| } | ||
| } | ||
| mountNSName, err := common.GetMountNSName() |
There was a problem hiding this comment.
I don't see how GetMountNSName() could be returning a string with duplicate path info like you mention in the summary.
GetMountNSName() just looks at the /proc/self/ns/mnt link and strips the result, it should only return a namespace ID number (as a string), like 4026531841.
There was a problem hiding this comment.
FWIW I just ran with a patch which prints out the values of mountNSName, common.ReplacePathSeparators(dest)), and common.RuntimeDir(metadir).
Please do that and let us know what you get. It's possible somethign in my context was weird, but what I did was: incus shell vm1; su - ubuntu; lxc-usernsexec -s -- bash; and inside that shell I did atomfs mount.
hallyn
commented
Jun 10, 2025
Hm, at the time I was 99% sure I was correct, and it did work on my |
hallyn
commented
Jul 4, 2025
Ah, finally, I get it. This patch is not quite right. There is a bug though. But your test in #41 manages to skirt around it! The bug is in RuntimeDir((metadir string). When the ATOMFS_TEST_RUN_DIR variable is set, then it does the right thing. It returns just that env variable, e.g. /tmp/meta. The bats tests always set that env variable, so the test passes. But if ATOMFS_TEST_RUN_DIR is not set, and metadir is passed in (which unmount always does), then it returns the passed-in metadir. Unmount passes in the destination-specific metadir, e.g. /tmp/meta/meta/MOUNTNSNUM/destdir. Then, as my patch description pointed out, UmountWithMetadir appends meta/MOUNTNSNUM/destdir to that variable again, giving us /tmp/meta/meta/MOUNTNSNUM/destdir/meta/MOUNTNSNUM/destdir. |
hallyn
commented
Jul 4, 2025
(if it helps, here is some debug output from manual run:) |
mikemccracken
commented
Jul 8, 2025
thanks for the extra detail - I will take a look soon, just wanted to ack that I saw this |
hallyn
commented
Jul 13, 2025
Replaced by PR #44 |
We were deleting /run/atomfs/meta/ID/destpath/meta/ID/destpath. So doing
atomfs mount oci:a dest
atomfs umount dest
atomfs mount oci:a dest
would fail as /run/atomfs/meta/ID/destpath still existed.