]> git.ipfire.org Git - thirdparty/postgresql.git/commit
aio: Improve assertions related to io_method
authorAndres Freund <andres@anarazel.de>
Wed, 5 Nov 2025 00:23:13 +0000 (19:23 -0500)
committerAndres Freund <andres@anarazel.de>
Wed, 5 Nov 2025 01:03:54 +0000 (20:03 -0500)
commit19e391e38a5efe1e798a0e7e3c87b3ba2208b110
tree9c976bbbcfa06719e7dd1fd8286fc78c774f3c5a
parent850b7da15b8dc5d479181095fde89be340680a06
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
src/backend/storage/aio/aio.c