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
a1ae2aa5
Unverified
Commit
a1ae2aa5
authored
May 10, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve IO error erporting
Ref #65
parent
3103049d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
fellow_cache.c
src/fellow_cache.c
+17
-6
No files found.
src/fellow_cache.c
View file @
a1ae2aa5
...
...
@@ -788,6 +788,11 @@ struct fellow_cache_obj {
(struct fellow_cache_res){.r.err = (str), .status = fcr_ioerr}
#define FCR_ALLOCFAIL(str) FCR_ALLOCERR(FC_ERRSTR(str))
#define FCR_IOFAIL(str) FCR_IOERR(FC_ERRSTR(str))
#define FCR_IOFAILHOW(str, have, want) \
((have) < 0 ? errno = -(have), FCR_IOFAIL(str " error") \
: ((have) == 0 ? FCR_IOFAIL(str " zero") \
: ((have) < (want) ? FCR_IOFAIL(str " short") \
: FCR_IOFAIL(str " other"))))
const char * const fellow_cache_res_s[FCR_LIM] = {
[fcr_ok] = "ok",
...
...
@@ -2213,7 +2218,8 @@ 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) {
fcr
=
FCR_IOFAIL
(
"disk seglist read"
);
fcr = FCR_IOFAILHOW("disk seglist read",
(size_t)ssz, next.size);
goto err;
}
err = fellow_disk_seglist_check(fdsl);
...
...
@@ -3390,7 +3396,8 @@ fellow_cache_read_complete(struct fellow_cache *fc, void *ptr, int32_t result)
assert(fcs->alloc.size <= INT32_MAX);
if (FC_INJ || result < (int32_t)fcs->alloc.size) {
fcr
=
FCR_IOFAIL
(
"fcs read error"
);
fcr = FCR_IOFAILHOW("fcs read",
result, (int32_t)fcs->alloc.size);
fcos_next = (typeof(fcos_next))FCOS_READFAIL;
}
else {
...
...
@@ -3465,8 +3472,10 @@ fellow_cache_async_write_complete(struct fellow_cache *fc,
assert(fcs->alloc.size <= INT32_MAX);
if
(
FC_INJ
||
result
<
(
int32_t
)
fcs
->
alloc
.
size
)
fcr
=
FCR_IOFAIL
(
"fcs write error"
);
if (FC_INJ || result < (int32_t)fcs->alloc.size) {
fcr = FCR_IOFAILHOW("fcs write", result,
(int32_t)fcs->alloc.size);
}
else
fcr = FCR_OK(fco);
...
...
@@ -3482,8 +3491,10 @@ fellow_cache_async_write_complete(struct fellow_cache *fc,
}
} else {
assert(type == FBIO_SEGLIST);
if
(
FC_INJ
||
result
<
(
int32_t
)
fbio
->
u
.
seglist
.
reg
.
size
)
fcr
=
FCR_IOFAIL
(
"seglist write error"
);
if (FC_INJ || result < (int32_t)fbio->u.seglist.reg.size) {
fcr = FCR_IOFAILHOW("seglist write",
result, (int32_t)fbio->u.seglist.reg.size);
}
else
fcr = FCR_OK(fco);
}
...
...
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