]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fix merge-diff for >2GB diff-files 6981/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 18 Dec 2015 20:22:13 +0000 (15:22 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 11 Feb 2016 14:39:24 +0000 (09:39 -0500)
Fixes: #14062
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(derived from commit 68125dd01349edf93cfa1af5028c2d438b5ae089)

src/rbd.cc

index 540579fbc7d4a1b56bcb9b61a636069f334143a1..30285ebe688abecd969cb304e187efb996c039a0 100755 (executable)
@@ -8,6 +8,7 @@
  * LGPL2.  See file COPYING.
  *
  */
+#define _LARGEFILE64_SOURCE
 #include "include/int_types.h"
 
 #include "mon/MonClient.h"
@@ -43,6 +44,7 @@
 #include <sstream>
 #include <stdlib.h>
 #include <sys/types.h>
+#include <unistd.h>
 #include <time.h>
 #include "include/memory.h"
 #include <sys/ioctl.h>
@@ -2206,7 +2208,8 @@ static int do_merge_diff(const char *first, const char *second, const char *path
           bufferptr bp = buffer::create(delta);
           r = safe_read_exact(fd, bp.c_str(), delta);
         } else {
-          r = lseek(fd, delta, SEEK_CUR);
+          off64_t l = lseek64(fd, delta, SEEK_CUR);
+          r = l < 0 ? -errno : 0;
         }
         if (r < 0) {
           cerr << "rbd: failed to skip first diff data" << std::endl;