]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/filestore: fix do_copy_range replay bug 20957/head
authorSage Weil <sage@redhat.com>
Sat, 10 Mar 2018 20:52:45 +0000 (14:52 -0600)
committerPrashant D <pdhange@redhat.com>
Mon, 19 Mar 2018 03:04:12 +0000 (23:04 -0400)
The 'from' value is an fd, not an offset.  We want 'r' to be the number of
bytes copied, or len.

It looks like this has been broken since 9499cdcd87ddac4a91abffe401baddb91f8a11d5

Fixes: http://tracker.ceph.com/issues/23298
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit df7fa174ad604822c034226593ff1eb700506e4a)

src/os/filestore/FileStore.cc

index 8b596a7236160a64ba77fe5285b0e00e1b1a481f..cd4972c1a9d55e0295f1251993e3ceef0ca36fd5 100644 (file)
@@ -3888,7 +3888,7 @@ int FileStore::_do_copy_range(int from, int to, uint64_t srcoff, uint64_t len, u
   if (r < 0 && replaying) {
     assert(r == -ERANGE);
     derr << __FUNC__ << ": short source tolerated because we are replaying" << dendl;
-    r = pos - from;;
+    r = len;
   }
   assert(replaying || pos == end);
   if (r >= 0 && !skip_sloppycrc && m_filestore_sloppy_crc) {