]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fix merge-diff for >2GB diff-files 6980/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2015 20:22:13 +0000 (15:22 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2015 20:22:13 +0000 (15:22 -0500)
Fixes: #14063
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/rbd.cc

index 6f5457d1461f94c9e6c942422d8e25b63d996679..b56a5587606b645c1c2508ddd0f82995af02b029 100644 (file)
@@ -8,6 +8,7 @@
  * LGPL2.  See file COPYING.
  *
  */
+#define _LARGEFILE64_SOURCE
 #include "include/int_types.h"
 
 #include "mon/MonClient.h"
@@ -42,6 +43,7 @@
 #include <sstream>
 #include <stdlib.h>
 #include <sys/types.h>
+#include <unistd.h>
 #include <time.h>
 #include "include/memory.h"
 #include <sys/ioctl.h>
@@ -2048,7 +2050,8 @@ static int do_merge_diff(const char *first, const char *second, const char *path
           if (r < 0)
             goto done;
         } else {
-          r = lseek(fd, delta, SEEK_CUR);
+          off64_t l = lseek64(fd, delta, SEEK_CUR);
+          r = l < 0 ? -errno : 0;
           if(r < 0)
             goto done;
         }