From 502baeab980a476365ab134037c553f23765b4fa Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 2 Jun 2011 09:17:02 -0700 Subject: [PATCH] filestore: fix fallback/slow do_clone_range We need to seek to the appropriate offsets on the src and destination fd's for this to do the right thing. Signed-off-by: Sage Weil --- src/os/FileStore.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 33ebcef23455d..8aa1bafd4cfb6 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -2825,6 +2825,9 @@ int FileStore::_do_clone_range(int from, int to, uint64_t off, uint64_t len) return -errno; } + ::lseek64(from, off, SEEK_SET); + ::lseek64(to, off, SEEK_SET); + loff_t pos = off; loff_t end = off + len; int buflen = 4096*32; -- 2.39.5