summaryrefslogtreecommitdiffstats
path: root/src/include/rbd
diff options
context:
space:
mode:
authorOr Ozeri <oro@il.ibm.com>2022-08-21 10:49:59 +0200
committerOr Ozeri <oro@il.ibm.com>2022-08-25 17:41:42 +0200
commite54bb7b6b1874e099a93af988d960d8774f32938 (patch)
tree9ab112f17717e4364ed773fb1f1e6163bf5c66fb /src/include/rbd
parentlibrbd: add crypto flattening to flattening operation (diff)
downloadceph-e54bb7b6b1874e099a93af988d960d8774f32938.tar.xz
ceph-e54bb7b6b1874e099a93af988d960d8774f32938.zip
librbd/crypto: auto detect plaintext parent
Encryption loading (i.e. rbd_encryption_load) gets a single passphrase and tries to applies it to all ancestor images. If it fails, the entire load fails. This commits extends encryption loading to assume ancestor is actually in plaintext format if no known encryption header magic is detected. Signed-off-by: Or Ozeri <oro@il.ibm.com>
Diffstat (limited to 'src/include/rbd')
-rw-r--r--src/include/rbd/librbd.h2
-rw-r--r--src/include/rbd/librbd.hpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/include/rbd/librbd.h b/src/include/rbd/librbd.h
index a717cc58ab7..e0da63dd822 100644
--- a/src/include/rbd/librbd.h
+++ b/src/include/rbd/librbd.h
@@ -827,6 +827,8 @@ CEPH_RBD_API int rbd_encryption_format(rbd_image_t image,
rbd_encryption_format_t format,
rbd_encryption_options_t opts,
size_t opts_size);
+/* encryption will be loaded on all ancestor images,
+ * until reaching an ancestor image which does not match any known format */
CEPH_RBD_API int rbd_encryption_load(rbd_image_t image,
rbd_encryption_format_t format,
rbd_encryption_options_t opts,
diff --git a/src/include/rbd/librbd.hpp b/src/include/rbd/librbd.hpp
index 1f6af1ebbe4..6e84a0a0f5c 100644
--- a/src/include/rbd/librbd.hpp
+++ b/src/include/rbd/librbd.hpp
@@ -597,6 +597,8 @@ public:
/* encryption */
int encryption_format(encryption_format_t format, encryption_options_t opts,
size_t opts_size);
+ /* encryption will be loaded on all ancestor images,
+ * until reaching an ancestor image which does not match any known format */
int encryption_load(encryption_format_t format, encryption_options_t opts,
size_t opts_size);