From: Sage Weil Date: Fri, 18 Dec 2015 22:40:17 +0000 (-0500) Subject: os/bluestore/BlueStore: fix read bug when there is a hole X-Git-Tag: v10.0.3~154^2~94 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8941e3257006a4343d98119dec34b76989344554;p=ceph.git os/bluestore/BlueStore: fix read bug when there is a hole Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e3844e0044ef..0f0a2851e550 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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;