This commit updates seastore to increment used_bytes only when
allocation is successful.
Without this commit, the seatore reports incorrect size if alloc_paddr fails
(e.g., due to insufficient space)
Signed-off-by: Myoungwon Oh <ohmyoungwon@gmail.com>
// TODO: implement allocation strategy (dirty metadata and multiple devices)
auto rbs = rb_group->get_rb_managers();
auto paddr = rbs[0]->alloc_extent(length);
- stats.used_bytes += length;
+ if (paddr != P_ADDR_NULL) {
+ stats.used_bytes += length;
+ }
return paddr;
}
// TODO: implement allocation strategy (dirty metadata and multiple devices)
auto rbs = rb_group->get_rb_managers();
auto ret = rbs[0]->alloc_extents(length);
- stats.used_bytes += length;
+ if (!ret.empty()) {
+ stats.used_bytes += length;
+ }
return ret;
}