summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-10-10 20:04:30 +0200
committerSage Weil <sage@newdream.net>2011-10-10 20:04:30 +0200
commit9ec60b4dc48d11cd8a5540457ff454d72c3716ce (patch)
tree342d28922578b3f5c703e34380f9f634c97c651d
parentlibrbd: slightly cleaner (diff)
downloadceph-9ec60b4dc48d11cd8a5540457ff454d72c3716ce.tar.xz
ceph-9ec60b4dc48d11cd8a5540457ff454d72c3716ce.zip
librbd: fix overflow on large large image copy
Fixes: #1611 Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r--src/librbd.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librbd.cc b/src/librbd.cc
index 5e0c7321fea..0a4f4bc34e9 100644
--- a/src/librbd.cc
+++ b/src/librbd.cc
@@ -1152,11 +1152,11 @@ int copy(ImageCtx& ictx, IoCtx& dest_md_ctx, const char *destname,
{
CephContext *cct = dest_md_ctx.cct();
CopyProgressCtx cp(prog_ctx);
-
uint64_t src_size = ictx.get_image_size();
+ int64_t r;
int order = ictx.header.options.order;
- int r = create(dest_md_ctx, destname, src_size, &order);
+ r = create(dest_md_ctx, destname, src_size, &order);
if (r < 0) {
lderr(cct) << "header creation failed" << dendl;
return r;