Comment by viraptor
4 years ago
Slightly related: if a drive runs with a properly journaled, fully checksummed filesystem, for example zfs or btrfs - does the write-through mode guarantee that you can only lose new data and not corrupt the old?
4 years ago
Slightly related: if a drive runs with a properly journaled, fully checksummed filesystem, for example zfs or btrfs - does the write-through mode guarantee that you can only lose new data and not corrupt the old?
ZFS is not journaled. CoW eliminates the need for anything like a journal with the exception of synchronous IO, where an intent log is used that can be replayed after a power loss event.
In any case, ZFS should be fine as long as REQ_PREFLUSH is working properly. You can read a little about that here:
https://github.com/openzfs/zfs/blob/453c63e9b74cea42d45e0bd3...
https://elixir.bootlin.com/linux/v4.18/source/include/linux/...
Found it kind of answered in the side thread: https://mobile.twitter.com/marcan42/status/14942278033275985...
In short - no, you'll still see corruption.
No, you won't see corruption on ZFS. Cutting power to the drive is always safe, you can slice a SATA cable with a guillotine if you want, you'll always see a consistent state of the filesystem. ZFS transactions are entirely atomic.
ZFS (and btrfs) is not "journaled", it's copy-on-write.
You won't see corruption of the filesystem itself, but you'll see data corruption as described in the thread. If the writes are delayed, the write ordering can get messed up. + Zfs has ZIL, which is basically journal equivalent.
1 reply →
Filesystem corruption on ZFS would indicate that REQ_PREFLUSH is not being implemented correctly by either the hardware or the device driver.