> It took me a while to find out how the block layer can ensure that a > snapshot is consistent on the filesystem level. The answer is Linux VFS > method super_operations.freeze_fs(). > https://www.kernel.org/doc/html/latest/filesystems/vfs.html > Without it a snapshot on block level would be similar to a filesystem > which was not properly unmounted before power-off.
But as I mentioned, higher-layers (the filesystem layer, and the applications running on top of that) *should* try and make sure that a hard failure (kernel crash, power failure, ... these and up taking a snapshot of your block device) can never result in an inconsistent state. That's the core of the ext3 improvement over ext2, for example. > So there might still filesystems in the Linux kernel which do not support > LVM snapshots in a safe way. Of course, just like there are still many applications which write files non-atomically. Stefan