Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librbd: fix merge-diff for >2GB diff-files #6889

Merged
merged 1 commit into from Dec 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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