To my understanding, when the write()
syscall is called, it writes the data to the OS buffer then returns.
My question, on LUKS partitions, are:
- Does
write()
encrypt data then write to OS buffer then returns? OR, it just writes the raw data then returns, and only when the OS flushes its buffer to disk is the data encrypted? - What if after calling
write()
,fsync()
is also called?
How can I verify the exact behavior? I have been searching on Google but no result thus far.