Fix a small memory leak and BS_OP_SYNC mishandling, now fio does not hang during primary-osd test

This commit is contained in:
Vitaliy Filippov
2020-02-28 01:46:39 +03:00
parent 1733de2db6
commit 2be4824a7a
9 changed files with 91 additions and 30 deletions
+12 -5
View File
@@ -249,11 +249,18 @@ void osd_t::cancel_osd_ops(osd_client_t & cl)
void osd_t::cancel_op(osd_op_t *op)
{
op->reply.hdr.magic = SECONDARY_OSD_REPLY_MAGIC;
op->reply.hdr.id = op->req.hdr.id;
op->reply.hdr.opcode = op->req.hdr.opcode;
op->reply.hdr.retval = -EPIPE;
op->callback(op);
if (op->op_type == OSD_OP_OUT)
{
op->reply.hdr.magic = SECONDARY_OSD_REPLY_MAGIC;
op->reply.hdr.id = op->req.hdr.id;
op->reply.hdr.opcode = op->req.hdr.opcode;
op->reply.hdr.retval = -EPIPE;
op->callback(op);
}
else
{
delete op;
}
}
void osd_t::stop_client(int peer_fd)