]> 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:53 +0000 (20:03 -0500)
commitdae00f333bdd98d094275080dba248cc80d4ca04
tree6e6b03c47cbe0be0ef3fee7afa10274343139e04
parent2d83d729d5a1a6cc5c62bf3a932fdb508ce3d1ac
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