Several bug fixes

- Do not block flock() requests
- Fix stop_client(0) attempts leading to std::bad_function_call
- Fix degraded writes crashing due to an unset stripes[i].missing (at least with a missing parity device)
- Fix recovery B/W reporting
This commit is contained in:
Vitaliy Filippov
2020-05-24 01:51:35 +03:00
parent d1602b50b3
commit e09d0e0678
5 changed files with 26 additions and 19 deletions
+4
View File
@@ -293,6 +293,7 @@ restart:
int peer_fd;
while ((peer_fd = accept(listen_fd, (sockaddr*)&addr, &peer_addr_size)) >= 0)
{
assert(peer_fd != 0);
char peer_str[256];
printf("[OSD %lu] new client %d: connection from %s port %d\n", this->osd_num, peer_fd,
inet_ntop(AF_INET, &addr.sin_addr, peer_str, 256), ntohs(addr.sin_port));
@@ -401,6 +402,7 @@ void osd_t::cancel_op(osd_op_t *op)
void osd_t::stop_client(int peer_fd)
{
assert(peer_fd != 0);
auto it = clients.find(peer_fd);
if (it == clients.end())
{
@@ -437,6 +439,7 @@ void osd_t::stop_client(int peer_fd)
if (cl.read_op)
{
delete cl.read_op;
cl.read_op = NULL;
}
for (auto rit = read_ready_clients.begin(); rit != read_ready_clients.end(); rit++)
{
@@ -455,6 +458,7 @@ void osd_t::stop_client(int peer_fd)
}
}
free(cl.in_buf);
assert(peer_fd != 0);
close(peer_fd);
if (repeer_osd)
{