fellow_cache_test: fault injection for seglist load

parent 53984931
...@@ -2185,22 +2185,18 @@ fellow_cache_seglists_load(struct worker *wrk, void *priv) ...@@ -2185,22 +2185,18 @@ fellow_cache_seglists_load(struct worker *wrk, void *priv)
break; break;
} }
// XXX FIX FC_INJ (requires FCO_READFAIL error handling)
fcsl_mem = buddy_ptr_extent_nil; fcsl_mem = buddy_ptr_extent_nil;
fdsl_mem = buddy_alloc1_ptr_extent_wait(fc->membuddy, FEP_META, fdsl_mem = buddy_alloc1_ptr_extent_wait(fc->membuddy, FEP_META,
next.size, 0); next.size, 0);
fdsl = fdsl_mem.ptr; fdsl = fdsl_mem.ptr;
//if (FC_INJ || fdsl == NULL) { if (FC_INJ || fdsl == NULL) {
if (fdsl == NULL) {
res = FCR_ALLOCFAIL("disk seglist fdsl"); res = FCR_ALLOCFAIL("disk seglist fdsl");
goto err; goto err;
} }
assert(fdsl_mem.size >= next.size); assert(fdsl_mem.size >= next.size);
ssz = fellow_io_pread_sync(fc->ffd, fdsl, next.size, next.off); ssz = fellow_io_pread_sync(fc->ffd, fdsl, next.size, next.off);
//if (FC_INJ || ssz < 0 || (size_t)ssz != next.size) { if (FC_INJ || ssz < 0 || (size_t)ssz != next.size) {
if (ssz < 0 || (size_t)ssz != next.size) {
res = FCR_IOFAIL("disk seglist read"); res = FCR_IOFAIL("disk seglist read");
goto err; goto err;
} }
...@@ -2212,8 +2208,7 @@ fellow_cache_seglists_load(struct worker *wrk, void *priv) ...@@ -2212,8 +2208,7 @@ fellow_cache_seglists_load(struct worker *wrk, void *priv)
fcsl_mem = buddy_alloc1_ptr_extent_wait(fc->membuddy, FEP_META, fcsl_mem = buddy_alloc1_ptr_extent_wait(fc->membuddy, FEP_META,
SEGLIST_SIZE(fcsl, fdsl->nsegs), 0); SEGLIST_SIZE(fcsl, fdsl->nsegs), 0);
//if (FC_INJ || fcsl_mem.ptr == NULL) { if (FC_INJ || fcsl_mem.ptr == NULL) {
if (fcsl_mem.ptr == NULL) {
res = FCR_ALLOCFAIL("disk seglist fcsl"); res = FCR_ALLOCFAIL("disk seglist fcsl");
goto err; goto err;
} }
......
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