pgsql: aio: Improve assertions related to io_method - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: aio: Improve assertions related to io_method
Date
Msg-id E1vGRwx-0054gr-13@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: pgsql: Special case C_COLLATION_OID in pg_newlocale_from_collation().
Next
From: Michael Paquier
Date:
Subject: pgsql: Add assertions checking for the startup process in WAL replay ro