Re:Ext4 encryption
by Dylan16807 on Wednesday May 27, 2015 @03:35PM
(#9613769)
Well if you use atomic 4K writes to the drive, and expose each one as 7 512-byte blocks to the next layer...
That's exactly what I was thinking.
SSDs have fairly large page sizes and erase block sizes, so you're often reading and writing a lot more than necessary, anyway. A clever implementation might be able to take advantage of that to scatter the MAC throughout the drive without too much impact on performance or longevity.
...the other issue is that you need a way to atomically update the data block and authenticator together. This is a similar problem to the "RAID write hole", and doing this at the block layer requires even more overhead - something equivalent to RAID write intent bitmaps.
The filesystem, on the other hand, already tends to have a journal, log-structure or COW rules that allows some form of atomic transactional updates. The encryption authenticator can piggy-back on this.