]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: return errors when read_iterate fails during copy
authorJosh Durgin <josh.durgin@dreamhost.com>
Wed, 12 Oct 2011 20:35:08 +0000 (13:35 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Wed, 12 Oct 2011 23:26:18 +0000 (16:26 -0700)
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/librbd.cc

index 4d47af77dc152c262fed936fe7580df6b4aae29c..587ee54b50734f451ae4dff77dd67f873ee03c62 100644 (file)
@@ -1173,10 +1173,12 @@ int copy(ImageCtx& ictx, IoCtx& dest_md_ctx, const char *destname,
   r = read_iterate(&ictx, 0, src_size, do_copy_extent, &cp);
 
   if (r >= 0) {
+    // don't return total bytes read, which may not fit in an int
+    r = 0;
     prog_ctx.update_progress(cp.src_size, cp.src_size);
   }
   close_image(cp.destictx);
-  return 0;
+  return r;
 }
 
 int snap_set(ImageCtx *ictx, const char *snap_name)