Postpone op callbacks to the end of handle_read(), fix a bug where primary OSD could reply -EPIPE with data to a read operation

This commit is contained in:
Vitaliy Filippov
2020-06-16 01:36:38 +03:00
parent 27ee14a4e6
commit 0f6d193d73
4 changed files with 50 additions and 16 deletions
+4 -1
View File
@@ -100,7 +100,6 @@ void osd_t::continue_primary_read(osd_op_t *cur_op)
// Fast happy-path
cur_op->buf = alloc_read_buffer(op_data->stripes, pg.pg_minsize, 0);
submit_primary_subops(SUBMIT_READ, pg.pg_minsize, pg.cur_set.data(), cur_op);
cur_op->send_list.push_back(cur_op->buf, cur_op->req.rw.len);
op_data->st = 1;
}
else
@@ -150,6 +149,10 @@ resume_2:
}
}
}
else
{
cur_op->send_list.push_back(cur_op->buf, cur_op->req.rw.len);
}
finish_op(cur_op, cur_op->req.rw.len);
}