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)
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)