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
a6d07a72
Unverified
Commit
a6d07a72
authored
Feb 02, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_cache: Handle FCO write errors
parent
88296a05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
25 deletions
+17
-25
fellow_cache.c
src/fellow_cache.c
+17
-25
No files found.
src/fellow_cache.c
View file @
a6d07a72
...
...
@@ -3421,6 +3421,7 @@ fellow_cache_async_write_complete(struct fellow_cache *fc,
struct
fellow_busy
*
fbo
;
struct
fellow_cache_seg
*
fcs
=
NULL
;
struct
fellow_cache_obj
*
fco
;
struct
fellow_cache_res
fcr
;
struct
fellow_disk_obj
*
fdo
,
*
fdo2
;
enum
fcos_state
fcos_next
=
FCOS_INVAL
;
enum
fellow_busy_io_e
type
;
...
...
@@ -3455,20 +3456,11 @@ fellow_cache_async_write_complete(struct fellow_cache *fc,
assert
(
fcs
->
fco
==
fco
);
assert
(
fcs
->
alloc
.
size
<=
INT32_MAX
);
#ifdef TODO_WRITE_ERR
if
(
FC_INJ
||
result
<
(
int32_t
)
fcs
->
alloc
.
size
)
{
if
(
fc
->
tune
->
ioerr_obj
==
0
)
FC_WRONG
(
"write error result %d size %d"
,
result
,
(
int32_t
)
fcs
->
alloc
.
size
);
// XXX handle
INCOMPL
();
}
#else
if
(
result
<
(
int32_t
)
fcs
->
alloc
.
size
)
{
FC_WRONG
(
"write error result %d size %d"
,
result
,
(
int32_t
)
fcs
->
alloc
.
size
);
}
#endif
if
(
FC_INJ
||
result
<
(
int32_t
)
fcs
->
alloc
.
size
)
fcr
=
FCR_IOFAIL
(
"fcs write error"
);
else
fcr
=
FCR_OK
(
fco
);
assert
(
FCOS
(
fcs
->
state
)
==
FCOS_WRITING
);
fcos_next
=
(
typeof
(
fcos_next
))
...
...
@@ -3482,13 +3474,10 @@ fellow_cache_async_write_complete(struct fellow_cache *fc,
}
}
else
{
assert
(
type
==
FBIO_SEGLIST
);
if
(
result
<
(
int32_t
)
fbio
->
u
.
seglist
.
reg
.
size
)
{
if
(
fc
->
tune
->
ioerr_obj
==
0
)
FC_WRONG
(
"write error result %d size %ld"
,
result
,
fbio
->
u
.
seglist
.
reg
.
size
);
// XXX handle
INCOMPL
();
}
if
(
result
<
(
int32_t
)
fbio
->
u
.
seglist
.
reg
.
size
)
fcr
=
FCR_IOFAIL
(
"seglist write error"
);
else
fcr
=
FCR_OK
(
fco
);
}
/* we keep the FCO writing until all else is written
...
...
@@ -3513,13 +3502,16 @@ fellow_cache_async_write_complete(struct fellow_cache *fc,
AZ
(
pthread_cond_broadcast
(
&
fco
->
cond
));
}
}
/*
* We latch an error, but _still_ add the object to the log, such that
* fellow_cache_obj_delete() can do a thin delete
*/
(
void
)
fellow_cache_obj_res
(
fc
,
fco
,
fcr
);
//lint --e{456} Two execution paths are being combined...
//lint --e{454} A thread mutex has been locked...
if
(
io_outstanding
==
0
)
{
/* XXX if error, make object mem only and
* free disk space
*/
switch
(
fco
->
logstate
)
{
case
FCOL_WANTLOG
:
/* fellow_cache_obj_delete() can not race
...
...
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