I understand that without use of any flags, there are two caches involved with loop-devices. Once a page cache when writing to the file-system within the loop-device, and then again to the page cache when writing to the file-system of the underlying file. Is that correct?
The documentation of direct-IO says
--direct-io[=on|off]Enable or disable direct I/O for the backing file. The optional argument can be either on or off. If the argument is omitted, it defaults to on.
Does this mean that with this option, there is only a single cache, namely the cache for the filesystem of the underlying file?
The documentation of
-o sync says
-o syncAll I/O to the filesystem should be done synchronously. In the case of media with a limited number of write cycles (e.g. some flash drives), sync may cause life-cycle shortening.
Since in the past I had serious performance problems with
sync filesystems on loop-mounts, and based on the warning about life-cycle shortening, I take this to mean that there's no cache anymore, not even for the underlying file. Data is written directly to the hardware.
Is this correct, or are matters more complicate?