On 6/11/25 11:15 AM, Eric Biggers wrote:
Well, again it needs to work on any block device. If the encryption might just not be done and plaintext ends up on-disk, then blk-crypto-fallback would be unsafe to use. It would be preferable to have blk-crypto-fallback continue to be handled in the block layer so that drivers don't need to worry about it.
This concern could be addressed by introducing a new flag in struct block_device_operations or struct queue_limits - a flag that indicates that bio_split_to_limits() will be called by the block driver. If that flag is set, blk_crypto_bio_prep() can be called from bio_submit_split(). If that flag is not set, blk_crypto_bio_prep() should be called from __submit_bio(). The latter behavior is is the current behavior for the upstream kernel. Thanks, Bart.