crimson/onode-staged-tree: use extent_len_t and node_offset_t correctly
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 8 Jun 2021 01:55:15 +0000 (09:55 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Fri, 11 Jun 2021 14:59:18 +0000 (22:59 +0800)
commitd163f1f9d14f2f5e11a02939d4f02ab39f42e783
tree192559e5041eefc92c3dd0d6c2877ecef0e2d6ff
parentb2f1c7df9c5258adc1bdbfc57629924b926a394e
crimson/onode-staged-tree: use extent_len_t and node_offset_t correctly

extent_len_t represents a value that may include the node size, but
node_offset_t cannot and may overflow. Also add validations when
try to cast a larger type to node_offset_t.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/onode_manager/staged-fltree/node_impl.h
src/crimson/os/seastore/onode_manager/staged-fltree/node_layout.h
src/crimson/os/seastore/onode_manager/staged-fltree/stages/node_stage.cc
src/crimson/os/seastore/onode_manager/staged-fltree/stages/node_stage.h
src/crimson/os/seastore/onode_manager/staged-fltree/stages/node_stage_layout.cc
src/crimson/os/seastore/onode_manager/staged-fltree/stages/node_stage_layout.h
src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h
src/test/crimson/seastore/onode_tree/test_staged_fltree.cc