]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ObjectCacher: fix bh_read_finish offset logic
authorGreg Farnum <gfarnum@redhat.com>
Mon, 23 May 2016 22:14:21 +0000 (15:14 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Thu, 23 Jun 2016 21:24:06 +0000 (14:24 -0700)
If we have an incoming read split across multiple BufferHeads, we want to
line up the BufferHead's bl with the incoming OSDOp's bl at the right offset. We
were erroneously using this nonsense calculation (always equal to zero!) when
a much simpler comparison of the BufferHead's logical object offset to the
incoming OSDOp's logical offset will do the trick nicely.

Fixes: http://tracker.ceph.com/issues/16002
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/osdc/ObjectCacher.cc

index 93b2412de53a1731ec7be474bca0eecc14b636bf..90c8329a826e4ff26eda4eeace3001b0bd8c3fbd 100644 (file)
@@ -833,7 +833,6 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid,
       if (bh->error < 0)
        err = bh->error;
 
-      loff_t oldpos = opos;
       opos = bh->end();
 
       if (r == -ENOENT) {
@@ -853,7 +852,7 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid,
        mark_error(bh);
       } else {
        bh->bl.substr_of(bl,
-                        oldpos-bh->start(),
+                        bh->start() - start,
                         bh->length());
        mark_clean(bh);
       }