From: Sage Weil Date: Thu, 2 Jun 2011 16:17:02 +0000 (-0700) Subject: filestore: fix fallback/slow do_clone_range X-Git-Tag: v0.29~2^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6ca168ed718f078dad86aeb02238cbb2e25521c4;p=ceph.git 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 --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 853ad431f33..bb500b2a4f3 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;