From: dongdong tao Date: Mon, 28 May 2018 21:44:59 +0000 (+0800) Subject: osdc: Fix the wrong BufferHead offset X-Git-Tag: v13.2.1~33^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22869%2Fhead;p=ceph.git osdc: Fix the wrong BufferHead offset the BufferHead offset should be "opos - bh->start()" Fixes: https://tracker.ceph.com/issues/24484 Signed-off-by: dongdong tao (cherry picked from commit 10f3204cca240c7172aef94b16fde203b33a19fd) --- diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 4b658408ab2c..249f24636f68 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -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