From: Samuel Just Date: Wed, 13 Mar 2013 23:04:23 +0000 (-0700) Subject: FileJournal: queue_pos \in [get_top(), header.max_size) X-Git-Tag: v0.59~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=de8edb732e3a5ce4471670e43cfe6357ae6a2758;p=ceph.git FileJournal: queue_pos \in [get_top(), header.max_size) 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 Reviewed-by: Sage Weil --- diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 0056f1f23b4..218347efa49 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -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;