From 203e94ecd2175c05bca1ea37d1ad1ca04ef26df1 Mon Sep 17 00:00:00 2001 From: dongdong tao Date: Tue, 29 May 2018 05:44:59 +0800 Subject: [PATCH] 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) --- src/osdc/ObjectCacher.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3