🌐 AI搜索 & 代理 主页
Skip to content

Commit dd74e59

Browse files
committed
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 da72269. 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
1 parent 78e6047 commit dd74e59

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/backend/storage/aio/aio_init.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@
3030
static Size
3131
AioCtlShmemSize(void)
3232
{
33-
Size sz;
34-
3533
/* pgaio_ctl itself */
36-
sz = offsetof(PgAioCtl, io_handles);
37-
38-
return sz;
34+
return sizeof(PgAioCtl);
3935
}
4036

4137
static uint32

0 commit comments

Comments
 (0)