Is it possible to change what device is mounted to a mount point atomically, so at no moment of time mount point can be observed empty? Here is what I am trying to do:
$ mkdir /point
$ mkdir /device1 /device2
$ echo 1 > /device1/text
$ echo 2 > /device2/text
$ mount --bind /device1 /point
$ # do some kind of magic to get /device2 mounted at /point and /device1 unmounted
Technically, I can ignore previous mount and mount new device on top, but kernel will keep keep record of both now, so it feels like "mount leak".