]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc: Fix the wrong BufferHead offset 22865/head
authordongdong tao <tdd21151186@gmail.com>
Mon, 28 May 2018 21:44:59 +0000 (05:44 +0800)
committerPrashant D <pdhange@redhat.com>
Thu, 5 Jul 2018 03:02:35 +0000 (23:02 -0400)
the BufferHead offset should be "opos - bh->start()"

Fixes: https://tracker.ceph.com/issues/24484
Signed-off-by: dongdong tao <tdd21151186@gmail.com>
(cherry picked from commit 10f3204cca240c7172aef94b16fde203b33a19fd)

src/osdc/ObjectCacher.cc

index bb974bed670f2305ac13ca06563d0573820ff796..8b498cabfe0c3c37ab27445cc6737b1153e44d0f 100644 (file)
@@ -1729,7 +1729,7 @@ int ObjectCacher::writex(OSDWrite *wr, ObjectSet *oset, Context *onfreespace,
       ldout(cct, 10) << "writex writing " << f_it->first << "~"
                     << f_it->second << " into " << *bh << " at " << opos
                     << dendl;
-      uint64_t bhoff = bh->start() - opos;
+      uint64_t bhoff = opos - bh->start();
       assert(f_it->second <= bh->length() - bhoff);
 
       // get the frag we're mapping in