write() syscall on LUKS partition

31 views Asked by At

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:

  1. 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?
  2. 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.

0

There are 0 answers