forked from vitalif/vitastor
Fix chained (snapshot) reads often not working at all with chain size > 2
parent
10e2e6a7c8
commit
63c2b9832c
|
@ -129,16 +129,19 @@ bool osd_t::prepare_primary_rw(osd_op_t *cur_op)
|
|||
data_buf = (uint8_t*)data_buf + chain_size * (pool_cfg.scheme == POOL_SCHEME_REPLICATED ? 0 : pg_it->second.pg_size);
|
||||
// Copy chain
|
||||
int chain_num = 0;
|
||||
op_data->read_chain[chain_num++] = cur_op->req.rw.inode;
|
||||
op_data->read_chain[chain_num] = cur_op->req.rw.inode;
|
||||
op_data->chain_states[chain_num] = NULL;
|
||||
chain_num++;
|
||||
auto inode_it = st_cli.inode_config.find(cur_op->req.rw.inode);
|
||||
while (inode_it != st_cli.inode_config.end() && inode_it->second.parent_id &&
|
||||
INODE_POOL(inode_it->second.parent_id) == pg_it->second.pool_id &&
|
||||
// Check for loops
|
||||
inode_it->second.parent_id != cur_op->req.rw.inode)
|
||||
{
|
||||
op_data->read_chain[chain_num++] = inode_it->second.parent_id;
|
||||
op_data->chain_states[chain_num++] = NULL;
|
||||
op_data->read_chain[chain_num] = inode_it->second.parent_id;
|
||||
op_data->chain_states[chain_num] = NULL;
|
||||
inode_it = st_cli.inode_config.find(inode_it->second.parent_id);
|
||||
chain_num++;
|
||||
}
|
||||
}
|
||||
pg_it->second.inflight++;
|
||||
|
|
Loading…
Reference in New Issue