Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
856d0f6e
Unverified
Commit
856d0f6e
authored
Jan 22, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_cache: latch fellow_cache_seglists_load() errors
parent
87fa0004
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
fellow_cache.c
src/fellow_cache.c
+18
-11
No files found.
src/fellow_cache.c
View file @
856d0f6e
...
...
@@ -789,6 +789,16 @@ struct fellow_cache_obj {
#define FCR_ALLOCFAIL(str) FCR_ALLOCERR(FC_ERRSTR(str))
#define FCR_IOFAIL(str) FCR_IOERR(FC_ERRSTR(str))
static inline void
fco_latch_err(struct fellow_cache_obj *fco, struct fellow_cache_res res)
{
assert(res.status != fcr_ok);
if (fco->res.status != fcr_ok)
return;
fco->res = res;
}
const char * const fellow_cache_res_s[FCR_LIM] = {
[fcr_ok] = "ok",
[fcr_allocerr] = "allocation",
...
...
@@ -2144,6 +2154,7 @@ fellow_cache_seglists_load(struct worker *wrk, void *priv)
struct fellow_lru_chgbatch lcb[1] =
FELLOW_LRU_CHGBATCH_INIT(lcb, fco, 1);
struct fellow_cache_res res = FCR_OK(NULL);
// invalidates fclsp, no use after this point
TAKE(mem, fclsp->mem);
...
...
@@ -2182,7 +2193,7 @@ fellow_cache_seglists_load(struct worker *wrk, void *priv)
fdsl = fdsl_mem.ptr;
//if (FC_INJ || fdsl == NULL) {
if (fdsl == NULL) {
err
=
FC_ERRSTR
(
"disk seglist fdsl alloc failed
"
);
res = FCR_ALLOCFAIL("disk seglist fdsl
");
goto err;
}
assert(fdsl_mem.size >= next.size);
...
...
@@ -2190,19 +2201,20 @@ fellow_cache_seglists_load(struct worker *wrk, void *priv)
ssz = fellow_io_pread_sync(fc->ffd, fdsl, next.size, next.off);
//if (FC_INJ || ssz < 0 || (size_t)ssz != next.size) {
if (ssz < 0 || (size_t)ssz != next.size) {
err
=
FC_ERRSTR
(
"disk seglist read faile
d"
);
res = FCR_IOFAIL("disk seglist rea
d");
goto err;
}
err = fellow_disk_seglist_check(fdsl);
if
(
err
!=
NULL
)
if (err != NULL) {
res = FCR_IOFAIL(err);
goto err;
}
fcsl_mem = buddy_alloc1_ptr_extent_wait(fc->membuddy, FEP_META,
SEGLIST_SIZE(fcsl, fdsl->nsegs), 0);
//if (FC_INJ || fcsl_mem.ptr == NULL) {
if (fcsl_mem.ptr == NULL) {
err
=
FC_ERRSTR
(
"disk seglist fcsl alloc failed
"
);
res = FCR_ALLOCFAIL("disk seglist fcsl
");
goto err;
}
...
...
@@ -2251,6 +2263,7 @@ fellow_cache_seglists_load(struct worker *wrk, void *priv)
fellow_cache_seg_transition_locked(lcb, FCO_FCS(fco),
FCO_STATE(fco), FCO_READFAIL);
}
fco_latch_err(fco, res);
refcnt = fellow_cache_obj_deref_locked(lcb, fc, fco);
AZ(pthread_cond_broadcast(&fco->cond));
fellow_cache_lru_chgbatch_apply(lcb);
...
...
@@ -2259,12 +2272,6 @@ fellow_cache_seglists_load(struct worker *wrk, void *priv)
fellow_cache_obj_free(fc, &fco);
else
AZ(pthread_mutex_unlock(&fco->mtx));
// XXX where to store?
(
void
)
err
;
// XXX handle
//INCOMPL();
}
static void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment