Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c7920fa8
Commit
c7920fa8
authored
Mar 12, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-16264: Eliminate unsafe os_aio_userdata_t type cast
parent
8be3794b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
storage/innobase/include/os0file.h
storage/innobase/include/os0file.h
+6
-0
storage/innobase/os/os0file.cc
storage/innobase/os/os0file.cc
+1
-1
tpool/tpool.h
tpool/tpool.h
+1
-1
No files found.
storage/innobase/include/os0file.h
View file @
c7920fa8
...
@@ -1350,6 +1350,12 @@ struct os_aio_userdata_t
...
@@ -1350,6 +1350,12 @@ struct os_aio_userdata_t
fil_node_t
*
node
;
fil_node_t
*
node
;
IORequest
type
;
IORequest
type
;
void
*
message
;
void
*
message
;
os_aio_userdata_t
(
fil_node_t
*
node
,
IORequest
type
,
void
*
message
)
:
node
(
node
),
type
(
type
),
message
(
message
)
{}
/** Construct from tpool::aiocb::m_userdata[] */
os_aio_userdata_t
(
const
char
*
buf
)
{
memcpy
((
void
*
)
this
,
buf
,
sizeof
*
this
);
}
};
};
/**
/**
NOTE! Use the corresponding macro os_aio(), not directly this function!
NOTE! Use the corresponding macro os_aio(), not directly this function!
...
...
storage/innobase/os/os0file.cc
View file @
c7920fa8
...
@@ -3883,7 +3883,7 @@ extern void fil_aio_callback(os_aio_userdata_t *data);
...
@@ -3883,7 +3883,7 @@ extern void fil_aio_callback(os_aio_userdata_t *data);
static
void
io_callback
(
tpool
::
aiocb
*
cb
)
static
void
io_callback
(
tpool
::
aiocb
*
cb
)
{
{
ut_a
(
cb
->
m_err
==
DB_SUCCESS
);
ut_a
(
cb
->
m_err
==
DB_SUCCESS
);
os_aio_userdata_t
data
=
*
(
os_aio_userdata_t
*
)
cb
->
m_userdata
;
os_aio_userdata_t
data
(
cb
->
m_userdata
)
;
/* Return cb back to cache*/
/* Return cb back to cache*/
if
(
cb
->
m_opcode
==
tpool
::
aio_opcode
::
AIO_PREAD
)
{
if
(
cb
->
m_opcode
==
tpool
::
aio_opcode
::
AIO_PREAD
)
{
if
(
read_slots
->
contains
(
cb
))
{
if
(
read_slots
->
contains
(
cb
))
{
...
...
tpool/tpool.h
View file @
c7920fa8
...
@@ -137,7 +137,7 @@ struct aiocb
...
@@ -137,7 +137,7 @@ struct aiocb
int
m_err
;
int
m_err
;
void
*
m_internal
;
void
*
m_internal
;
task
m_internal_task
;
task
m_internal_task
;
char
m_userdata
[
MAX_AIO_USERDATA_LEN
];
alignas
(
8
)
char
m_userdata
[
MAX_AIO_USERDATA_LEN
];
aiocb
()
:
m_internal_task
(
nullptr
,
nullptr
)
aiocb
()
:
m_internal_task
(
nullptr
,
nullptr
)
{}
{}
...
...
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