]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/filestore/FileJournal: bail out if transaction is too large
authorKefu Chai <kchai@redhat.com>
Fri, 19 Aug 2016 06:50:38 +0000 (14:50 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 19 Aug 2016 07:09:57 +0000 (15:09 +0800)
if a transaction is too large to fit in the FileJournal's ring buffer,
we will wait. but if its size is larger than the max_size, it's likely
due to a bug or an invalid setting. in that case, we'd better fail
earlier.

Fixes: http://tracker.ceph.com/issues/16982
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/os/filestore/FileJournal.cc

index 394a5cc399faa4cdaa409164098e66c77157ff5e..4375a9731dabe4fec0e5f8cd8b9b48ebf87efc05 100644 (file)
@@ -1667,6 +1667,7 @@ void FileJournal::submit_entry(uint64_t seq, bufferlist& e, uint32_t orig_len,
          << " len " << e.length()
          << " (" << oncommit << ")" << dendl;
   assert(e.length() > 0);
+  assert(e.length() < header.max_size);
 
   if (osd_op)
     osd_op->mark_event("commit_queued_for_journal_write");