diff --git a/src/cls/journal/cls_journal.cc b/src/cls/journal/cls_journal.cc index 7cc2866586a..091fac1feef 100644 --- a/src/cls/journal/cls_journal.cc +++ b/src/cls/journal/cls_journal.cc @@ -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) { diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 086e94a7d91..6c5414627a3 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -14,6 +14,7 @@ add_subdirectory(cls_log) add_subdirectory(cls_numops) add_subdirectory(cls_sdk) if(WITH_RBD) + add_subdirectory(cls_journal) add_subdirectory(cls_rbd) endif(WITH_RBD) add_subdirectory(cls_refcount) diff --git a/src/test/cls_journal/CMakeLists.txt b/src/test/cls_journal/CMakeLists.txt new file mode 100644 index 00000000000..6e99cdc5af0 --- /dev/null +++ b/src/test/cls_journal/CMakeLists.txt @@ -0,0 +1,18 @@ +# cls_test_cls_journal +add_executable(ceph_test_cls_journal + test_cls_journal.cc + $) +set_target_properties(ceph_test_cls_journal PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) +target_link_libraries(ceph_test_cls_journal + cls_journal_client + librados + global + ${UNITTEST_LIBS} + ${CMAKE_DL_LIBS} + ${CRYPTO_LIBS} + ${EXTRALIBS} + radostest) +install(TARGETS + ceph_test_cls_journal + DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/test/cls_journal/test_cls_journal.cc b/src/test/cls_journal/test_cls_journal.cc index 2e112360775..d9cdb6b7754 100644 --- a/src/test/cls_journal/test_cls_journal.cc +++ b/src/test/cls_journal/test_cls_journal.cc @@ -547,6 +547,14 @@ TEST_F(TestClsJournal, TagList) { ASSERT_EQ(0, client::tag_list(ioctx, oid, "id1", boost::optional(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(), + &tags)); + ASSERT_EQ(expected_all_tags, tags); } TEST_F(TestClsJournal, GuardAppend) {