mirror of
https://github.com/ceph/ceph
synced 2024-12-26 21:43:10 +00:00
Merge pull request #18270 from dillaman/wip-21391
cls/journal: possible infinite loop within tag_list class method Reviewed-by: Mykola Golub <to.my.trociny@gmail.com>
This commit is contained in:
commit
914c99717e
@ -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) {
|
||||
|
@ -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)
|
||||
|
18
src/test/cls_journal/CMakeLists.txt
Normal file
18
src/test/cls_journal/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
||||
# cls_test_cls_journal
|
||||
add_executable(ceph_test_cls_journal
|
||||
test_cls_journal.cc
|
||||
$<TARGET_OBJECTS:common_texttable_obj>)
|
||||
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})
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user