On Fri, May 05, 2017 at 01:52:53PM +0200, Gionatan Danti wrote: > > > On 05/05/2017 13:32, Carlos Maiolino wrote: > > > > This is not true, XFS can't identify mounts on different systems. It is not a > > shared or clustered filesystem. > > > > Ok, this confirm my finding. > > To reiterate: there is *no* method to prevent multiple mounts in XFS, right? As far as I know, don't, I can always be wrong, but, I re-checked xfs superblock, and could not find anything that actually protects it. > > > At the worst case, it would need to store something to disk saying the > > filesystem is already mounted, and the mount process would need to read it > > before actually mounting the filesystem. Nothing though would prevent a race > > between two systems, or even make the filesystem unmountable after a crash, > > needing something like xfs_repair to clean some "is_mounted" flag, which would > > trash one of the reasons why we have a journal (fast recovery without needing an > > fsck before mounting). > > > > EXT4 uses a "keepalive" approach: enabling the "mmp" feature (which require > kernel 3.10+), a specific on-disk structure is continuously (each 5 seconds, > by default) updated with a timestamp by the mounting machine. If another > machine tries to mount the filesystem, it sees the mmp structure changing > and it refuse to mount. > > It's not perfect, but better than nothing ;) Eh, I really don't know much about EXT4, but this only works if the clocks are properly adjusted (not really hard to achieve though), but still racy. cheers. -- Carlos -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html