coverage: fellow_busy_body_seg_return()

parent b07819cf
......@@ -4008,6 +4008,9 @@ static size_t fellow_busy_seg_memalloc(buddy_t *membuddy,
AZ(fcs->alloc.ptr);
AZ(fcs->alloc.size);
if (FC_INJ)
return (0);
fcs->alloc = buddy_alloc1_ptr_extent_wait(membuddy, FEP_SPC,
fds->seg.size, cram);
......@@ -5904,6 +5907,7 @@ t_cache(unsigned chksum)
const size_t dsksz = 100 * 1024 * 1024;
const size_t objsize_hint = 1 * 1024 * 1024;
struct fellow_cache_res fcr;
int injcount;
char *ptr;
DBGSZ(fellow_disk_seg);
......@@ -6049,6 +6053,32 @@ t_cache(unsigned chksum)
test_bocdone(fbo, TRUST_ME(hash), 1);
fellow_cache_obj_deref(fc, fco);
// === alloc space error inject
fbo = fellow_busy_obj_alloc(fc, &fco, &priv2, 1234).r.ptr;
CHECK_OBJ_NOTNULL(fbo, FELLOW_BUSY_MAGIC);
fc_inj_reset();
injcount = -1;
while (injcount) {
DBG("injcount=%d", injcount);
if (injcount > 0)
fc_inj_set(injcount);
sz = 1234;
fcr = fellow_busy_obj_getspace(fbo, &sz, (uint8_t **)&ptr);
if (fcr.status == fcr_ok)
fellow_busy_obj_extend(fbo, sz);
else
assert(fcr.status == fcr_allocerr);
if (injcount < 0)
injcount = fc_inj_count();
else
injcount--;
}
fellow_busy_obj_trimstore(fbo);
test_bocdone(fbo, TRUST_ME(hash), 1);
fellow_cache_obj_deref(fc, fco);
// === hit objsize_max
fbo = fellow_busy_obj_alloc(fc, &fco, &priv2, 1234).r.ptr;
CHECK_OBJ_NOTNULL(fbo, FELLOW_BUSY_MAGIC);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment