]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/journal: fixed possible infinite loop which could kill the OSD 18417/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 12 Oct 2017 12:58:03 +0000 (08:58 -0400)
committerKarol Mroz <kmroz@suse.de>
Fri, 20 Oct 2017 02:05:34 +0000 (19:05 -0700)
Fixes: http://tracker.ceph.com/issues/21771
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 9e7475f8fb08b0ef30cad2c0d680cecf331b44ef)

src/cls/journal/cls_journal.cc
src/test/cls_journal/test_cls_journal.cc

index f966c07f24aed7c48cc7f04087aed941434d8957..dfcba9813a3a37e41ae7bdb6e5841aafb9704857 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) {