tresor_tester.run: fix asynchronous rekeying test

The virtual block device module used to hand over the wrong VBA as
parameter "rekeying VBA" to the Free Tree when allocating PBAs for data
access during rekeying. In certain constellations, this caused the Free
Tree to alloc PBAs that were still in use. The Free Tree PBA selection
algorithm, however, is just fine. When fixing the call parameter, it works
as desired. This re-enables the async rekeying test.

Ref #5075
This commit is contained in:
Martin Stein 2023-12-07 12:17:25 +01:00 committed by Christian Helmuth
parent 02ef158748
commit ef0c3f9d2c
4 changed files with 8 additions and 11 deletions

View File

@ -398,7 +398,7 @@ append config {
<free-tree
nr_of_levels="4"
nr_of_children="8"
nr_of_leafs="100" />
nr_of_leafs="512" />
</initialize>
<construct/>
@ -425,10 +425,7 @@ append config {
<request op="sync" vba="0" count="256" sync="yes"/>
<check/>
<log string="Step 11: test asynchronous rekeying (SKIPPED BECAUSE OF KNOWN BUG)"/>
<!-- FIXME: this step would yet trigger a hash mismatch in the
VBD rekeying module
<log string="Step 11: test asynchronous rekeying"/>
<request op="write" vba="20" count="3" sync="no" salt="7384"/>
<request op="rekey" sync="no"/>
@ -461,7 +458,6 @@ append config {
<request op="read" vba="10" count="2" sync="no" salt="3758"/>
<request op="sync" vba="0" count="256" sync="yes"/>
<check/>
-->
<log string="Step 12: test synchronous free tree extension"/>

View File

@ -54,6 +54,7 @@ class Tresor::Virtual_block_device_request : public Module_request
Physical_block_address &_pba;
Number_of_blocks &_num_pbas;
Number_of_leaves &_num_leaves;
Virtual_block_address const _rekeying_vba;
bool &_success;
NONCOPYABLE(Virtual_block_device_request);
@ -64,7 +65,7 @@ class Tresor::Virtual_block_device_request : public Module_request
Tree_root &, Tree_root &, Tree_degree, Virtual_block_address, bool,
Virtual_block_address, Snapshot_index, Snapshots &, Tree_degree, Key_id,
Key_id, Generation, Physical_block_address &, bool &, Number_of_leaves &,
Number_of_blocks &);
Number_of_blocks &, Virtual_block_address);
static char const *type_to_string(Type);

View File

@ -105,7 +105,7 @@ _generate_vbd_req(Virtual_block_device_request::Type type, State_uint complete_s
complete_state, progress, type, _req_ptr->_client_req_offset, _req_ptr->_client_req_tag,
_sb.last_secured_generation, *_ft, *_mt, _sb.degree, _sb.max_vba(), _sb.state == Superblock::REKEYING,
vba, _sb.curr_snap_idx, _sb.snapshots, _sb.degree, _sb.previous_key.id, key_id,
_curr_gen, _pba, _gen_req_success, _nr_of_leaves, _req_ptr->_nr_of_blks);
_curr_gen, _pba, _gen_req_success, _nr_of_leaves, _req_ptr->_nr_of_blks, _sb.rekeying_vba);
}

View File

@ -28,14 +28,14 @@ Virtual_block_device_request(Module_id src_module_id, Module_channel_id src_chan
Virtual_block_address vba, Snapshot_index curr_snap_idx, Snapshots &snapshots,
Tree_degree snap_degr, Key_id prev_key_id, Key_id curr_key_id,
Generation curr_gen, Physical_block_address &pba, bool &success,
Number_of_leaves &num_leaves, Number_of_blocks &num_pbas)
Number_of_leaves &num_leaves, Number_of_blocks &num_pbas, Virtual_block_address rekeying_vba)
:
Module_request { src_module_id, src_chan_id, VIRTUAL_BLOCK_DEVICE }, _type { type }, _vba { vba },
_snapshots { snapshots }, _curr_snap_idx { curr_snap_idx }, _snap_degr { snap_degr }, _curr_gen { curr_gen },
_curr_key_id { curr_key_id }, _prev_key_id { prev_key_id }, _ft { ft }, _mt { mt }, _vbd_degree { vbd_degree },
_vbd_highest_vba { vbd_highest_vba }, _rekeying { rekeying }, _client_req_offset { client_req_offset },
_client_req_tag { client_req_tag }, _last_secured_gen { last_secured_gen }, _pba { pba },
_num_pbas { num_pbas }, _num_leaves { num_leaves }, _success { success }
_num_pbas { num_pbas }, _num_leaves { num_leaves }, _rekeying_vba { rekeying_vba }, _success { success }
{ }
@ -761,7 +761,7 @@ void Virtual_block_device_channel::_generate_ft_req(State complete_state, bool p
_generate_req<Free_tree_request>(
complete_state, progress, type, req._ft, req._mt, req._snapshots, req._last_secured_gen, req._curr_gen,
_free_gen, _num_blks, _new_pbas, _t1_nodes, req._snapshots.items[_snap_idx].max_level, _vba, req._vbd_degree,
req._vbd_highest_vba, req._rekeying, req._prev_key_id, req._curr_key_id, _vba, *(Physical_block_address*)0,
req._vbd_highest_vba, req._rekeying, req._prev_key_id, req._curr_key_id, req._rekeying_vba, *(Physical_block_address*)0,
*(Number_of_blocks*)0);
}