]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ECBackend: handle short reads
authorSamuel Just <sam.just@inktank.com>
Wed, 19 Feb 2014 23:50:16 +0000 (15:50 -0800)
committerSamuel Just <sam.just@inktank.com>
Thu, 20 Feb 2014 01:31:37 +0000 (17:31 -0800)
async reads may have a length past the end of the object.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ECBackend.cc

index d430ea7d87b65d4b420da3c678dc4a1e6c3f9b98..3a92c45eefaa702dd4460e8055bcbf048889832d 100644 (file)
@@ -1536,7 +1536,7 @@ struct CallClientContexts :
       i->second.first->substr_of(
        bl,
        i->first.first - adjusted.first,
-       i->first.second);
+       MIN(i->first.second, bl.length() - (i->first.first - adjusted.first)));
       if (i->second.second) {
        i->second.second->complete(i->second.first->length());
       }