]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/journal: fixed possible infinite loop which could kill the OSD 18270/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 12 Oct 2017 12:58:03 +0000 (08:58 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 12 Oct 2017 13:00:30 +0000 (09:00 -0400)
Fixes: http://tracker.ceph.com/issues/21771
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/cls/journal/cls_journal.cc
src/test/cls_journal/test_cls_journal.cc

index 7cc2866586ad8b8eefcff1a58d27dedb8dba2efc..091fac1feef1a51229b0e07f1b1416803c027a7e 100644 (file)
@@ -1047,6 +1047,7 @@ int journal_tag_list(cls_method_context_t hctx, bufferlist *in,
         // completed calculation of tag class minimums
         if (tag.tid >= minimum_tag_tid) {
           vals.clear();
+          more = false;
           break;
         }
       } else if (tag_pass == TAG_PASS_LIST) {
index 2e1123607752e2864bc6586b93c3d4dbb4e1d3f5..d9cdb6b7754f19765e9855c227a3c14f1ea227cb 100644 (file)
@@ -547,6 +547,14 @@ TEST_F(TestClsJournal, TagList) {
   ASSERT_EQ(0, client::tag_list(ioctx, oid, "id1", boost::optional<uint64_t>(0),
                                 &tags));
   ASSERT_EQ(expected_filtered_tags, tags);
+
+  librados::ObjectWriteOperation op1;
+  client::client_commit(&op1, "id1", {{{96, 0, 120}}});
+  ASSERT_EQ(0, ioctx.operate(oid, &op1));
+
+  ASSERT_EQ(0, client::tag_list(ioctx, oid, "id1", boost::optional<uint64_t>(),
+                                &tags));
+  ASSERT_EQ(expected_all_tags, tags);
 }
 
 TEST_F(TestClsJournal, GuardAppend) {