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
db8b7ee3
Unverified
Commit
db8b7ee3
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
fda16980
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 @
db8b7ee3
...
...
@@ -2302,6 +2302,18 @@ fellow_cache_seglists_wait_locked(struct fellow_cache_obj *fco)
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
*
...
...
@@ -4620,8 +4632,10 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
// stack usage
assert
(
readahead
<=
31
);
fcr
.
status
=
fcr_ok
;
// also if func() != 0
fcr
.
r
.
integer
=
0
;
// fcr_ok is also returned if func() != 0
fcr
=
fco
->
fcr
;
if
(
fcr
.
status
!=
fcr_ok
)
return
(
fcr
);
CHECK_OBJ_NOTNULL
(
fco
,
FELLOW_CACHE_OBJ_MAGIC
);
...
...
@@ -4769,7 +4783,14 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
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
...
...
@@ -6630,11 +6651,7 @@ static void test_fellow_cache_obj_iter_final(
fc_inj_reset
();
injcount
=
-
1
;
AN
(
injcount
);
/*
* XXX TEMP BROKEN until
* commit "fellow_cache: Ensure we see seglist loading errors for _iter()"
*/
while
(
0
&&
injcount
)
{
while
(
injcount
)
{
DBG
(
"injcount %d"
,
injcount
);
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