mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
cls/journal: fixed possible infinite loop in expire_tags
Fixes: http://tracker.ceph.com/issues/21956 Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
parent
900f1c024a
commit
9e66dca495
@ -188,6 +188,7 @@ int expire_tags(cls_method_context_t hctx, const std::string *skip_client_id) {
|
||||
if (tag.tid >= minimum_tag_tid) {
|
||||
// no need to check for tag classes beyond this point
|
||||
vals.clear();
|
||||
more = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -322,15 +322,21 @@ TEST_F(TestClsJournal, ClientUnregisterPruneTags) {
|
||||
bufferlist()));
|
||||
ASSERT_EQ(0, client::tag_create(ioctx, oid, 1, Tag::TAG_CLASS_NEW,
|
||||
bufferlist()));
|
||||
ASSERT_EQ(0, client::tag_create(ioctx, oid, 2, 1, bufferlist()));
|
||||
|
||||
for (uint32_t i = 2; i <= 96; ++i) {
|
||||
ASSERT_EQ(0, client::tag_create(ioctx, oid, i, 1, bufferlist()));
|
||||
}
|
||||
|
||||
librados::ObjectWriteOperation op1;
|
||||
client::client_commit(&op1, "id1", {{{1, 2, 120}}});
|
||||
client::client_commit(&op1, "id1", {{{1, 32, 120}}});
|
||||
ASSERT_EQ(0, ioctx.operate(oid, &op1));
|
||||
|
||||
ASSERT_EQ(0, client::client_unregister(ioctx, oid, "id2"));
|
||||
|
||||
std::set<Tag> expected_tags = {{0, 0, {}}, {2, 1, {}}};
|
||||
std::set<Tag> expected_tags = {{0, 0, {}}};
|
||||
for (uint32_t i = 32; i <= 96; ++i) {
|
||||
expected_tags.insert({i, 1, {}});
|
||||
}
|
||||
std::set<Tag> tags;
|
||||
ASSERT_EQ(0, client::tag_list(ioctx, oid, "id1",
|
||||
boost::optional<uint64_t>(), &tags));
|
||||
|
Loading…
Reference in New Issue
Block a user