]> git.apps.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:22 +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 33ebcef23455d3f6ad7fef27c41a1485167ebc8c..8aa1bafd4cfb6bfe9e2cf7e92e77469a168bf18d 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;