]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ObjectCacher: fix the bytes_written in writex
authorZhiqiang Wang <zhiqiang@xsky.com>
Wed, 24 Feb 2016 13:49:56 +0000 (21:49 +0800)
committerJason Dillaman <dillaman@redhat.com>
Thu, 9 Jun 2016 18:06:03 +0000 (14:06 -0400)
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 <zhiqiang@xsky.com>
(cherry picked from commit ca6f1681e4baf61682e258c5761536d67bf6bdb8)

src/osdc/ObjectCacher.cc

index 4cfed9c60c35843c3f2b4190e07720dac92dec68..bb592c1c20a3061cb451b4a9ca761ab35c8f74c2 100644 (file)
@@ -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)