Messages in this thread | | | Date | Thu, 15 Apr 2021 12:33:02 -0700 | From | Eric Biggers <> | Subject | Re: [PATCH v2 3/8] block: blk-crypto: introduce blk_crypto_bio_sectors_alignment() |
| |
On Thu, Mar 25, 2021 at 09:26:04PM +0000, Satya Tangirala wrote: > The size of any bio must be aligned to the data unit size of the bio crypt > context (if it exists) of that bio. This must also be ensured whenever a > bio is split. Introduce blk_crypto_bio_sectors_alignment() that returns > the required alignment in sectors. The number of sectors passed to > any call of bio_split() should be aligned to > blk_crypto_bio_sectors_alignment().
"should be aligned" => "must be aligned"?
> +/* > + * Returns the alignment requirement for the number of sectors in this bio based > + * on its bi_crypt_context. Any bios split from this bio must follow this > + * alignment requirement as well. > + */
It would be helpful to expand this comment a bit to explictly mention that the size of the bio must be a multiple of the crypto data unit size that was selected by the submitter of the bio, which is the granularity of encryption/decryption. Keep in mind that people reading this code won't necessarily be familiar with inline encryption.
- Eric
| |