Re:I tested four NVMe SSDs from four vendors – half lose FLU...
by lxgr on Wednesday November 22, 2023 @12:49AM
(#38375156)
At least for ext4 and actually written data (i.e. not ftruncate’d files), I believe zeroes should really not occur.
Both extents and the file size are metadata as far as I understand, which would be atomically updated through the journal.
Data can be written before metadata (in data=ordered mode):
> All data are forced directly out to the main file system prior to its metadata being committed to the journal.
I seem to vaguely recall an issue like that, for ext4 in particular. Of course it's possible in general for any filesystem that supports holes, but I don't think we can necessarily assume that the data is always written, and all the pointers to it also written, before the file-size gets updated.