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
a2192e8d
Unverified
Commit
a2192e8d
authored
Jan 29, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_cache: Ensure we see seglist loading errors for _iter()
parent
0a007211
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
8 deletions
+25
-8
fellow_cache.c
src/fellow_cache.c
+25
-8
No files found.
src/fellow_cache.c
View file @
a2192e8d
...
@@ -2323,6 +2323,18 @@ fellow_cache_seglists_wait_locked(struct fellow_cache_obj *fco)
...
@@ -2323,6 +2323,18 @@ fellow_cache_seglists_wait_locked(struct fellow_cache_obj *fco)
assert(fco->seglstate == SEGL_DONE || fco->seglstate == SEGL_NEED);
assert(fco->seglstate == SEGL_DONE || fco->seglstate == SEGL_NEED);
}
}
static void
fellow_cache_seglists_wait(struct fellow_cache_obj *fco)
{
CHECK_OBJ_NOTNULL(fco, FELLOW_CACHE_OBJ_MAGIC);
if (fco->seglstate != SEGL_LOADING)
return;
AZ(pthread_mutex_lock(&fco->mtx));
fellow_cache_seglists_wait_locked(fco);
AZ(pthread_mutex_unlock(&fco->mtx));
}
/*
/*
* MEM LAYOUT
* MEM LAYOUT
*
*
...
@@ -4642,8 +4654,10 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
...
@@ -4642,8 +4654,10 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
// stack usage
// stack usage
assert(readahead <= 31);
assert(readahead <= 31);
fcr
.
status
=
fcr_ok
;
// also if func() != 0
// fcr_ok is also returned if func() != 0
fcr
.
r
.
integer
=
0
;
fcr = fco->fcr;
if (fcr.status != fcr_ok)
return (fcr);
CHECK_OBJ_NOTNULL(fco, FELLOW_CACHE_OBJ_MAGIC);
CHECK_OBJ_NOTNULL(fco, FELLOW_CACHE_OBJ_MAGIC);
...
@@ -4791,7 +4805,14 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
...
@@ -4791,7 +4805,14 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
fcr.r.integer = ret2;
fcr.r.integer = ret2;
}
}
return
(
fcr
);
// if ok, wait for seglist loading to complete to see errors
if (fcr.status != fcr_ok)
fco_latch_err(fco, fcr);
else
fellow_cache_seglists_wait(fco);
// to properly return func() return value with fcr_ok
return (fco->fcr.status == fcr_ok ? fcr : fco->fcr);
}
}
/* Auxiliary attributes
/* Auxiliary attributes
...
@@ -6653,11 +6674,7 @@ static void test_fellow_cache_obj_iter_final(
...
@@ -6653,11 +6674,7 @@ static void test_fellow_cache_obj_iter_final(
fc_inj_reset();
fc_inj_reset();
injcount = -1;
injcount = -1;
AN(injcount);
AN(injcount);
/*
while (injcount) {
* XXX TEMP BROKEN until
* commit "fellow_cache: Ensure we see seglist loading errors for _iter()"
*/
while
(
0
&&
injcount
)
{
DBG("injcount %d", injcount);
DBG("injcount %d", injcount);
fc_inj_set(0);
fc_inj_set(0);
...
...
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