]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: fix fallback/slow do_clone_range
authorSage Weil <sage@newdream.net>
Thu, 2 Jun 2011 16:17:02 +0000 (09:17 -0700)
committerSage Weil <sage@newdream.net>
Thu, 2 Jun 2011 16:17:02 +0000 (09:17 -0700)
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 <sage@newdream.net>
src/os/FileStore.cc

index 853ad431f331487a31eea16f270c9da6c816fff1..bb500b2a4f3c8145f55ecba79548640fb4e49ebf 100644 (file)
@@ -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;