Skip to content

Commit

Permalink
Merge pull request #6889 from kylinstorage/wip-fix-merge-diff
Browse files Browse the repository at this point in the history
librbd: fix merge-diff for >2GB diff-files

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
jdurgin committed Dec 10, 2015
2 parents 019a93f + 68125dd commit 134c988
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tools/rbd/action/MergeDiff.cc
@@ -1,6 +1,10 @@
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab

#define _LARGEFILE64_SOURCE
#include <sys/types.h>
#include <unistd.h>

#include "tools/rbd/ArgumentTypes.h"
#include "tools/rbd/Shell.h"
#include "tools/rbd/Utils.h"
Expand Down Expand Up @@ -336,7 +340,8 @@ static int do_merge_diff(const char *first, const char *second,
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) {
std::cerr << "rbd: failed to skip first diff data" << std::endl;
Expand Down

0 comments on commit 134c988

Please sign in to comment.