diff options
author | Satya Tangirala <satyat@google.com> | 2021-02-01 05:10:16 +0000 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2021-02-11 09:45:24 -0500 |
commit | d3b17a243790a34bd63fcef3fde63e29e2744938 (patch) | |
tree | 8f2d666623c273acdf4c11a8434c8d689ffc4ae3 /drivers/md/dm.c | |
parent | 7bdcc48f4e80b01fd6057dfd382236a5b8123b61 (diff) |
block/keyslot-manager: Introduce functions for device mapper support
Introduce blk_ksm_update_capabilities() to update the capabilities of
a keyslot manager (ksm) in-place. The pointer to a ksm in a device's
request queue may not be easily replaced, because upper layers like
the filesystem might access it (e.g. for programming keys/checking
capabilities) at the same time the device wants to replace that
request queue's ksm (and free the old ksm's memory). This function
allows the device to update the capabilities of the ksm in its request
queue directly. Devices can safely update the ksm this way without any
synchronization with upper layers *only* if the updated (new) ksm
continues to support all the crypto capabilities that the old ksm did
(see description below for blk_ksm_is_superset() for why this is so).
Also introduce blk_ksm_is_superset() which checks whether one ksm's
capabilities are a (not necessarily strict) superset of another ksm's.
The blk-crypto framework requires that crypto capabilities that were
advertised when a bio was created continue to be supported by the
device until that bio is ended - in practice this probably means that
a device's advertised crypto capabilities can *never* "shrink" (since
there's no synchronization between bio creation and when a device may
want to change its advertised capabilities) - so a previously
advertised crypto capability must always continue to be supported.
This function can be used to check that a new ksm is a valid
replacement for an old ksm.
Signed-off-by: Satya Tangirala <satyat@google.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Acked-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
0 files changed, 0 insertions, 0 deletions