From: John Spray Date: Tue, 20 May 2014 10:59:53 +0000 (+0100) Subject: osdc/Journaler: fix obj count in Journaler:erase X-Git-Tag: v0.82~48^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3207c50507c647d9abd663da31e69a878f53e9f8;p=ceph.git osdc/Journaler: fix obj count in Journaler:erase This was off by one (too few) in the case of a trimmedpos->write_pos range that had length layout_period+2 and starting position one byte before a period boundary. Signed-off-by: John Spray --- diff --git a/src/osdc/Journaler.cc b/src/osdc/Journaler.cc index f87598686ee1..5578f742bff9 100644 --- a/src/osdc/Journaler.cc +++ b/src/osdc/Journaler.cc @@ -936,7 +936,7 @@ void Journaler::erase(Context *completion) { // Async delete the journal data uint64_t first = trimmed_pos / get_layout_period(); - uint64_t num = (write_pos - trimmed_pos) / get_layout_period() + 1; + uint64_t num = (write_pos - trimmed_pos) / get_layout_period() + 2; filer.purge_range(ino, &layout, SnapContext(), first, num, ceph_clock_now(cct), 0, new C_EraseFinish(this, completion));