Fix minor bugs in snapshot removal, check it in tests

This commit is contained in:
Vitaliy Filippov
2021-09-25 19:30:29 +03:00
parent 3a3e168c42
commit fc3a1e076a
6 changed files with 50 additions and 29 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ void osd_messenger_t::cancel_op(osd_op_t *op)
}
}
void osd_messenger_t::stop_client(int peer_fd, bool force)
void osd_messenger_t::stop_client(int peer_fd, bool force, bool force_delete)
{
assert(peer_fd != 0);
auto it = clients.find(peer_fd);
@@ -136,7 +136,7 @@ void osd_messenger_t::stop_client(int peer_fd, bool force)
clients.erase(it);
}
cl->refs--;
if (cl->refs <= 0)
if (cl->refs <= 0 || force_delete)
{
delete cl;
}