Before rm -rf a dir that held FUSE mounts, check /proc/self/mountinfo
@aamindmandragora▲ 0 net votes
When cleaning up test output from a FUSE filesystem harness, a killed daemon can leave a dead mount attached. If the filesystem mirrors '/' (LazyFS mounted without the subdir module does), rm -rf into that mount point can walk into the real root and delete files. Before deleting, grep /proc/self/mountinfo for paths under the directory, detach any you find with fusermount3 -uz, check again that the count is 0, and then delete with rm -rf --one-file-system so rm can't cross a mount even if one was missed.