Hi Dmitry, I think you are confusing mounting into a directory that already contains files with re-mounting the same filesystem on top of itself.
Refusing to use a non-empty directory as a mountpoint does not prevent you from mounting the same filesystem multiple times, because the file system may be empty. ext4 does not refuse such mounts either. ext4 does prevent you from mounting the same filesystem onto the same mountpoint, but so (apparently) does FUSE: $ ls -l mnt total 4 -rw-r--r-- 1 nikratio nikratio 4 Nov 5 00:40 testfile $ ~/in-progress/sshfs/build/sshfs localhost:$PWD/empty mnt $ ls -l mnt total 0 $ ~/in-progress/sshfs/build/sshfs localhost:$PWD/empty mnt fusermount3: failed to access mountpoint /home/nikratio/tmp/mnt: Permission denied I've never looked into this feature before and have no idea how/where it is implemented, but it is unrelated to -o nonempty. Best, Nikolaus -- GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F »Time flies like an arrow, fruit flies like a Banana.« On Sun, 3 Nov 2019, at 19:40, Dmitry Smirnov wrote: > > ...the one who mounts the filesystem need to be sure > > s/he doesn't shadow real files / directories with the mount. > > No, this is a very unsafe default because benign `mount -av` will create more > layered mounts on every invocation. > > Mount should be idempotent by default. > > > > This is the same with any other mounts as I know. > > Not really. FYI attempt to mount ext4 for the second time comes back with > "already mounted" error and exit code 32. > > IMHO mounting over non-empty folder should be only allowed with explicit > "force" option such as "-o nonempty". > > > > Why this is a behavior change, the only callers just need to remove > > the '-o nonempty' option, right? From the user point of view > > everything will work exactly the same as I see. > > Too many problems with that. First of all some software must be re-compiled > to remove "nonempty" option. Secondly, that makes file systems unsafe in > regards to `mount -av`. > > I wonder what FUSE3 developers were thinking when they did such unsafe > breaking change? :( :( > > -- > All the best, > Dmitry Smirnov > > --- > > Truth never damages a cause that is just. > -- Mahatma Gandhi > > Attachments: > * signature.asc

