mirror of
https://github.com/postgres/postgres.git
synced 2025-10-19 15:49:24 +03:00
Fix shared memory calculation size of PgAioCtl
The shared memory size was calculated based on an offset of io_handles,
which is itself a pointer included in the structure. We tend to
overestimate the shared memory size overall, so this was unlikely an
issue in practice, but let's be correct and use the full size of the
structure in the calculation, so as the pointer for io_handles is
included.
Oversight in da7226993f
.
Author: Madhukar Prasad <madhukarprasad@google.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Discussion: https://postgr.es/m/CAKi+wrbC2dTzh_vKJoAZXV5wqTbhY0n4wRNpCjJ=e36aoo0kFw@mail.gmail.com
Backpatch-through: 18
This commit is contained in:
@@ -30,12 +30,8 @@
|
|||||||
static Size
|
static Size
|
||||||
AioCtlShmemSize(void)
|
AioCtlShmemSize(void)
|
||||||
{
|
{
|
||||||
Size sz;
|
|
||||||
|
|
||||||
/* pgaio_ctl itself */
|
/* pgaio_ctl itself */
|
||||||
sz = offsetof(PgAioCtl, io_handles);
|
return sizeof(PgAioCtl);
|
||||||
|
|
||||||
return sz;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32
|
static uint32
|
||||||
|
Reference in New Issue
Block a user