]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Journaler: fix obj count in Journaler:erase
authorJohn Spray <john.spray@inktank.com>
Tue, 20 May 2014 10:59:53 +0000 (11:59 +0100)
committerJohn Spray <john.spray@inktank.com>
Tue, 20 May 2014 13:43:54 +0000 (14:43 +0100)
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 <john.spray@inktank.com>
src/osdc/Journaler.cc

index f87598686ee1b685f4bc90c7a5faefd1cc992eeb..5578f742bff951157c9702caf9615652dee8d360 100644 (file)
@@ -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));