Re: why fscrypt_mergeable_bio use logical block number?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 15, 2022 at 08:18:11AM +0000, 常凤楠 wrote:
> Hi:
> 	When I dig into a problem, I found: bio merge may reduce a lot when
> 	enable inlinecrypt, the root cause is fscrypt_mergeable_bio use logical
> 	block number rather than physical block number. I had read the UFSHCI,
> 	but not see any description about why data unit number shoud use logical
> 	block number. I want to know why, Is the anyone can explain this?
> 
> Thanks.
> Fengnan Chang.

The main reason that fscrypt generates IVs using the file logical block number
instead of the sector number is because f2fs needs to move data blocks around
without the key.  That would be impossible with sector number based encryption.

There are other reasons too.  Always using the file logical block number keeps
the various fscrypt options consistent, it works well with per-file keys, it
doesn't break filesystem resizing, and it avoids having the interpretation of
the filesystem depend on its on-disk location which would be a layering
violation.  But the need to support f2fs is the main one.

Note that by default, fscrypt uses a different key for every file, and in that
case the only way that using the file logical block number instead of the sector
number would prevent merging is if data was being read/written from a file that
is physically but not logically contiguous.  That's not a very common case.

- Eric



[Index of Archives]     [linux Cryptography]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]

  Powered by Linux