pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: aio: Improve assertions related to io_method
2+ messages / 1 participants
[nested] [flat]

* pgsql: aio: Improve assertions related to io_method
@ 2025-11-05 01:04  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2025-11-05 01:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

aio: Improve assertions related to io_method

First, the assertions in assign_io_method() were the wrong way round. Second,
the lengthof() assertion checked the length of io_method_options, which is the
wrong array to check and is always longer than pgaio_method_ops_table.

While add it, add a static assert to ensure pgaio_method_ops_table and
io_method_options stay in sync.

Per coverity and Tom Lane.

Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/dae00f333bdd98d094275080dba248cc80d4ca04

Modified Files
--------------
src/backend/storage/aio/aio.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: aio: Improve assertions related to io_method
@ 2025-11-05 01:04  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2025-11-05 01:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

aio: Improve assertions related to io_method

First, the assertions in assign_io_method() were the wrong way round. Second,
the lengthof() assertion checked the length of io_method_options, which is the
wrong array to check and is always longer than pgaio_method_ops_table.

While add it, add a static assert to ensure pgaio_method_ops_table and
io_method_options stay in sync.

Per coverity and Tom Lane.

Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/19e391e38a5efe1e798a0e7e3c87b3ba2208b110

Modified Files
--------------
src/backend/storage/aio/aio.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-11-05 01:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-11-05 01:04 pgsql: aio: Improve assertions related to io_method Andres Freund <andres@anarazel.de>
2025-11-05 01:04 pgsql: aio: Improve assertions related to io_method Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox