]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: potential use of uninitialised value in ImageWatcher 14091/head
authorMykola Golub <mgolub@mirantis.com>
Wed, 22 Mar 2017 20:03:34 +0000 (21:03 +0100)
committerMykola Golub <mgolub@mirantis.com>
Wed, 22 Mar 2017 20:03:34 +0000 (21:03 +0100)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/librbd/ImageWatcher.cc

index 8219201d1d56b875c1d5816d224d402c2a379b66..18b55a0c070e5f30c4d9405bf6027069812ca5b3 100644 (file)
@@ -651,7 +651,7 @@ bool ImageWatcher<I>::handle_payload(const FlattenPayload &payload,
       ProgressContext *prog_ctx;
       r = prepare_async_request(payload.async_request_id, &new_request,
                                 &ctx, &prog_ctx);
-      if (new_request) {
+      if (r == 0 && new_request) {
         ldout(m_image_ctx.cct, 10) << this << " remote flatten request: "
                                   << payload.async_request_id << dendl;
         m_image_ctx.operations->execute_flatten(*prog_ctx, ctx);
@@ -677,7 +677,7 @@ bool ImageWatcher<I>::handle_payload(const ResizePayload &payload,
       ProgressContext *prog_ctx;
       r = prepare_async_request(payload.async_request_id, &new_request,
                                 &ctx, &prog_ctx);
-      if (new_request) {
+      if (r == 0 && new_request) {
         ldout(m_image_ctx.cct, 10) << this << " remote resize request: "
                                   << payload.async_request_id << " "
                                   << payload.size << " "
@@ -812,7 +812,7 @@ bool ImageWatcher<I>::handle_payload(const RebuildObjectMapPayload& payload,
       ProgressContext *prog_ctx;
       r = prepare_async_request(payload.async_request_id, &new_request,
                                 &ctx, &prog_ctx);
-      if (new_request) {
+      if (r == 0 && new_request) {
         ldout(m_image_ctx.cct, 10) << this
                                    << " remote rebuild object map request: "
                                    << payload.async_request_id << dendl;