[dm-crypt] luks header on initramfs img fails due to no O_DIRECT support in tmpfs
gmazyland at gmail.com
Fri Aug 8 15:38:49 CEST 2014
On 08/08/2014 09:22 AM, Natanael Copa wrote:
> I found this posting while looking at an issue with cryptsetup-1.6.5 in initramfs:
> I believe this is same thing as reported here:
> Seems like the problem is that open(2) does not support O_DIRECT when on tmpfs.
> I don't subscribe to your mailing list but wanted to share anyways.
BTW I see patch removing O_DIRECT completely in your distro.
As you already mentioned in comment in link above, please do not do this.
You are risking data corruption in some situations.
Using direct-io should ensure that block device is really updated
(And also we really do not want to cache keyslot content in memory.)
I know it is not 100% solution but the best way is to report the problem
here and then backport upstream fix.
(Just use existing device_open() which tries to open device twice, also no need
to patch old code which do not fail. See upstream commit, I also added
test for tmpfs to not repeat the problem again in future.)
More information about the dm-crypt