RFC fscrypt: add extent encryption
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest13 patches 3 repliesIn review
Changelog from the cover letter
RFC:
- Split fscrypt_info into a general fscrypt_common_info, an inode-specific fscrypt_info, and an extent-specific fscrypt_extent_info. All external interfaces use either an inode or extent specific structure; most internal functions handle the common structure.
- Tried to fix up more places to refer to infos instead of inodes and files.
- Changed to use lightweight extent contexts containing just a nonce, and then a following change to do heavyweight extent contexts identical to inode contexts, so they're easily comparable.
- Dropped factoring lock_master_key() and adding super block pointer to fscrypt_info changes, as they didn't seem necessary.
- Temporarily dropped optimization where leaf inodes with extents don't have on-disk fscrypt_contexts. It's a convenient optimization and affects btrfs disk format, but it's not very big and not strictly needed to check whether the new structural arrangement is better.
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | fscrypt: factor getting info for a specific blockfs/ fs/ fs/ | +37 | 0 replies | |
| 2/13 | fscrypt: adjust effective lblks based on extentsfs/ fs/ | +16 | 0 replies | |
| 3/13 | fscrypt: move function call warning of busy inodesfs/ | +12 | 0 replies | |
| 4/13 | fscrypt: split fscrypt_info into general and inode specific partsfs/ fs/ fs/ +6 more | +371 | 0 replies | |
| 5/13 | fscrypt: add creation/usage/freeing of per-extent infosfs/ fs/ fs/ +2 more | +204 | 0 replies | |
| 6/13 | fscrypt: allow load/save of extent contextsfs/ fs/ include/ | +80 | 0 replies | |
| 7/13 | fscrypt: store full fscrypt_contexts for each extentfs/ fs/ | +12 | 1 reply | |
| 8/13 | fscrypt: save session key credentials for extent infosfs/ fs/ | +28 | 0 replies | |
| 9/13 | fscrypt: revamp key removal for extent encryptionfs/ fs/ fs/ | +79 | 0 replies | |
| 10/13 | fscrypt: allow multiple extents to reference one infofs/ fs/ include/ | +24 | 0 replies | |
| 11/13 | fscrypt: cache list of inlinecrypt devicesfs/ fs/ fs/ | +21 | 0 replies | |
| 12/13 | fscrypt: allow asynchronous info freeingfs/ fs/ fs/ +1 more | +40 | 0 replies | |
| 13/13 | fscrypt: update documentation for per-extent keysDocumentation/ | +37 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 00/13] fscrypt: add extent encryption
This is a replacement for the former changeset (previously v3). This doesn't reflect all the smaller feedback on v3: it's an attempt to address the major points of giving extents and inodes different objects, and to clearly define lightweight and heavyweight extent contexts. Currently, with minor changes to the btrfs patchset building on it, it passes tests.
Hopefully I understood the proposed alternate design and this is indeed more elegant, reviewable, and maintainable.
This applies atop [3], which itself is based on kdave/misc-next.
Changelog:
RFC:
- Split fscrypt_info into a general fscrypt_common_info, an inode-specific fscrypt_info, and an extent-specific fscrypt_extent_info. All external interfaces use either an inode or extent specific structure; most internal functions handle the common structure.
- Tried to fix up more places to refer to infos instead of inodes and files.
- Changed to use lightweight extent contexts containing just a nonce, and then a following change to do heavyweight extent contexts identical to inode contexts, so they're easily comparable.
- Dropped factoring lock_master_key() and adding super block pointer to fscrypt_info changes, as they didn't seem necessary.
- Temporarily dropped optimization where leaf inodes with extents don't have on-disk fscrypt_contexts. It's a convenient optimization and affects btrfs disk format, but it's not very big and not strictly needed to check whether the new structural arrangement is better.
v3:
- Added four additional changes:
- soft-deleting keys that extent infos might later need to use, so
the behavior of an open file after key removal matches inode-based fscrypt.
- a set of changes to allow asynchronous info freeing for extents, necessary due to locking constraints in btrfs.
- https://lore.kernel.org/linux-fscrypt/[email protected]/
v2:
- https://lore.kernel.org/linux-fscrypt/[email protected]/T/#t
[3] https://lore.kernel.org/linux-fscrypt/[email protected]/
Sweet Tea Dorminy (13):
fscrypt: factor getting info for a specific block
fscrypt: adjust effective lblks based on extents
fscrypt: move function call warning of busy inodes
fscrypt: split fscrypt_info into general and inode specific parts
fscrypt: add creation/usage/freeing of per-extent infos
fscrypt: allow load/save of extent contexts
fscrypt: store full fscrypt_contexts for each extent
fscrypt: save session key credentials for extent infos
fscrypt: revamp key removal for extent encryption
fscrypt: allow multiple extents to reference one info
fscrypt: cache list of inlinecrypt devices
fscrypt: allow asynchronous info freeing
fscrypt: update documentation for per-extent keys
Documentation/filesystems/fscrypt.rst | 43 ++- fs/crypto/crypto.c | 48 ++- fs/crypto/fname.c | 13 +- fs/crypto/fscrypt_private.h | 245 +++++++++--- fs/crypto/hooks.c | 6 +- fs/crypto/inline_crypt.c | 93 +++-- fs/crypto/keyring.c | 110 +++--- fs/crypto/keysetup.c | 530 ++++++++++++++++++++------ fs/crypto/keysetup_v1.c | 77 ++-- fs/crypto/policy.c | 34 +- include/linux/fscrypt.h | 60 +++ 11 files changed, 919 insertions(+), 340 deletions(-)
base-commit: 764e1420e0806a3536b53b4c52c1b08ae8425f7e
Signature · 1 line
2.41.0