From: Yehuda Sadeh Date: Mon, 4 Dec 2017 07:30:21 +0000 (-0800) Subject: cls/otp: preserve otp history when modifying it X-Git-Tag: v13.1.0~343^2~9 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=679913512b8ac458f33b211c249f6e8875664161;p=ceph-ci.git cls/otp: preserve otp history when modifying it Signed-off-by: Yehuda Sadeh --- diff --git a/src/cls/otp/cls_otp.cc b/src/cls/otp/cls_otp.cc index 9c3e54bfae4..0e887975db2 100644 --- a/src/cls/otp/cls_otp.cc +++ b/src/cls/otp/cls_otp.cc @@ -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);