diff options
author | Michael Paquier | 2025-09-17 00:33:32 +0000 |
---|---|---|
committer | Michael Paquier | 2025-09-17 00:33:32 +0000 |
commit | 158c48303e8ae0248d7d95b60b56dd67e7033c48 (patch) | |
tree | c2e2e093cfd4d2c552687936065c3bfce2f8435e /src/backend | |
parent | ac06ea8f7b6c6aeedef9bff5fb30f606f6054a55 (diff) |
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 da7226993fd4.
Author: Madhukar Prasad <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Reviewed-by: Matthias van de Meent <[email protected]>
Discussion: https://postgr.es/m/CAKi+wrbC2dTzh_vKJoAZXV5wqTbhY0n4wRNpCjJ=e36aoo0kFw@mail.gmail.com
Backpatch-through: 18
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/storage/aio/aio_init.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/backend/storage/aio/aio_init.c b/src/backend/storage/aio/aio_init.c index 885c3940c66..54ab84dd6f0 100644 --- a/src/backend/storage/aio/aio_init.c +++ b/src/backend/storage/aio/aio_init.c @@ -30,12 +30,8 @@ static Size AioCtlShmemSize(void) { - Size sz; - /* pgaio_ctl itself */ - sz = offsetof(PgAioCtl, io_handles); - - return sz; + return sizeof(PgAioCtl); } static uint32 |