]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
FileJournal: queue_pos \in [get_top(), header.max_size)
authorSamuel Just <sam.just@inktank.com>
Wed, 13 Mar 2013 23:04:23 +0000 (16:04 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 15 Mar 2013 18:07:12 +0000 (11:07 -0700)
If queue_pos == header.max_size when we create the entry
header magic, the entry will be rejected at get_top() on
replay.

Fixes: #4436
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/os/FileJournal.cc

index 0056f1f23b447326f46be836eb83931b5cc119dc..218347efa4962abc637cb79d04c8791282c83556 100644 (file)
@@ -914,7 +914,7 @@ int FileJournal::prepare_single_write(bufferlist& bl, off64_t& queue_pos, uint64
   writing_seq = seq;
 
   queue_pos += size;
-  if (queue_pos > header.max_size)
+  if (queue_pos >= header.max_size)
     queue_pos = queue_pos + get_top() - header.max_size;
 
   return 0;