]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/otp: preserve otp history when modifying it
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 4 Dec 2017 07:30:21 +0000 (23:30 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 9 Apr 2018 14:01:48 +0000 (07:01 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/cls/otp/cls_otp.cc

index 9c3e54bfae451d7b9624380fdc621e2d3f410473..0e887975db2e0a7584e29ae99dee43cb1bc9b6c4 100644 (file)
@@ -285,6 +285,11 @@ static int otp_set_op(cls_method_context_t hctx,
 
   for (auto entry : op.entries) {
     otp_instance instance;
+    r = get_otp_instance(hctx, entry.id, &instance);
+    if (r < 0 &&
+        r != -ENOENT) {
+      return r;
+    }
     instance.otp = entry;
 
     r = write_otp_instance(hctx, instance);