From: Zhiqiang Wang Date: Wed, 24 Feb 2016 13:49:56 +0000 (+0800) Subject: ObjectCacher: fix the bytes_written in writex X-Git-Tag: v11.0.0~796^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca6f1681e4baf61682e258c5761536d67bf6bdb8;p=ceph.git ObjectCacher: fix the bytes_written in writex The BufferHead returned after map_write may include other dirty data to the left and/or right. The actual length of data been written is in the ObjectExtent. Signed-off-by: Zhiqiang Wang --- diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index ede6aa3bb4d..54dac972e1d 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -1571,10 +1571,10 @@ int ObjectCacher::writex(OSDWrite *wr, ObjectSet *oset, Context *onfreespace) BufferHead *bh = o->map_write(*ex_it, wr->journal_tid); bool missing = bh->is_missing(); bh->snapc = wr->snapc; - - bytes_written += bh->length(); + + bytes_written += ex_it->length; if (bh->is_tx()) { - bytes_written_in_flush += bh->length(); + bytes_written_in_flush += ex_it->length; } // adjust buffer pointers (ie "copy" data into my cache)