]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Returning when dst_ioctx.operate() returns error 17873/head
authoramitkuma <amitkuma@redhat.com>
Thu, 21 Sep 2017 12:54:40 +0000 (18:24 +0530)
committeramitkuma <amitkuma@redhat.com>
Mon, 18 Dec 2017 15:40:45 +0000 (21:10 +0530)
** 1396179 Unused value
CID 1396179 (#1 of 1): Unused value (UNUSED_VALUE)
returned_value: Assigning value from dst_ioctx->operate(dst_oid, &wop)
to ret here, but that stored value is overwritten before it can be used.

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/rgw/rgw_rados.cc

index 09d38c5111f4e62c2914d97d711540e28aedbe9e..214d9e36640324ca86cf2f1ec6a4e702b84570a3 100644 (file)
@@ -6386,6 +6386,9 @@ int RGWRados::move_rados_obj(librados::IoCtx& src_ioctx,
     }
     wop.write(ofs, data);
     ret = dst_ioctx.operate(dst_oid, &wop);
+    if (ret < 0) {
+      goto done_err;
+    }
     ofs += data.length();
     done = data.length() != chunk_size;
   } while (!done);
@@ -6402,6 +6405,7 @@ int RGWRados::move_rados_obj(librados::IoCtx& src_ioctx,
   return 0;
 
 done_err:
+  // TODO: clean up dst_oid if we created it
   lderr(cct) << "ERROR: failed to copy " << src_oid << " -> " << dst_oid << dendl;
   return ret;
 }