]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueStore: fix read bug when there is a hole
authorSage Weil <sage@redhat.com>
Fri, 18 Dec 2015 22:40:17 +0000 (17:40 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:07:21 +0000 (13:07 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index e3844e0044ef019c5a8cedbf59f05e6fb941dbf9..0f0a2851e5500b6515d39646970ee7ff370a35d7 100644 (file)
@@ -2169,6 +2169,7 @@ int BlueStore::_do_read(
   dout(20) << __func__ << " " << offset << "~" << length << " size "
           << o->onode.size << dendl;
   bl.clear();
+  _dump_onode(o);
 
   if (offset > o->onode.size) {
     r = 0;
@@ -2226,7 +2227,6 @@ int BlueStore::_do_read(
       offset += x_len;
       continue;
     }
-
     unsigned x_len = length;
     if (op != oend &&
        op->first > offset &&
@@ -2271,6 +2271,11 @@ int BlueStore::_do_read(
       }
       continue;
     }
+    if (bp != bend &&
+       bp->first > offset &&
+       bp->first - offset < x_len) {
+      x_len = bp->first - offset;
+    }
 
     // zero.
     dout(30) << __func__ << " zero " << offset << "~" << x_len << dendl;