Assume we have a file of FILE_SIZE bytes, and:
FILE_SIZE <= min(page_size, physical_block_size);- file size never changes (i.e.
truncate()or appendwrite()are never performed); file is modified only by completly overwriting its contents using:
pwrite(fd, buf, FILE_SIZE, 0);
Is it guaranteed on ext4 that:
- Such writes are atomic with respect to concurrent reads?
Such writes are transactional with respect to a system crash?
(i.e., after a crash the file's contents is completely from some previous write and we'll never see a partial write or empty file)
Is the second true:
- with
data=ordered? with
data=journalor alternatively with journaling enabled for a single file?(using
ioctl(fd, EXT4_IOC_SETFLAGS, EXT4_JOURNAL_DATA_FL))when
physical_block_size < FILE_SIZE <= page_size?
I've found related question which links discussion from 2011. However:
- I didn't find an explicit answer for my question
2. - I wonder, if the above is true, is it documented somewhere?