diff options
author | Samuel Just <sam.just@inktank.com> | 2013-02-27 16:58:45 -0800 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2013-02-28 11:10:44 -0800 |
commit | 50b4f72eb74c4ae8238731ac3ceb40b5a21b79b6 (patch) | |
tree | 5959fd3c0f07d08b7253fc0e8ca799cdf1e549f3 | |
parent | 9cb6c33f0e2281b66cc690a28e08459f2e62ca13 (diff) | |
download | ceph-50b4f72eb74c4ae8238731ac3ceb40b5a21b79b6.tar.gz |
FileJournal::wrap_read_bl: adjust pos before returning
Otherwise, we may feed an offset past the end of the journal to
check_header in read_entry and incorrectly determine that the entry is
corrupt.
Fixes: 4296
Backport: bobtail
Backport: argonaut
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 5d54ab154ca790688a6a1a2ad5f869c17a23980a)
-rw-r--r-- | src/os/FileJournal.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 2a832d74da3..78227332e03 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -1586,6 +1586,8 @@ void FileJournal::wrap_read_bl(off64_t& pos, int64_t olen, bufferlist& bl) pos += len; olen -= len; } + if (pos >= header.max_size) + pos = pos + get_top() - header.max_size; } bool FileJournal::read_entry(bufferlist& bl, uint64_t& seq) |