agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add assertion about ssize_t narrowing in AIO code
Date: Wed, 15 Jul 2026 09:05:31 +0000
Message-ID: <E1wjvYZ-000GvJ-0P@gemulon.postgresql.org> (raw)

Add assertion about ssize_t narrowing in AIO code

The result from pg_preadv() or pg_pwritev(), which is of type ssize_t,
is assigned to PgAioHandle.result, which is of type int.  This should
be ok because the maximum result is limited by PG_IOV_MAX times
BLCKSZ.  Add an assertion and a code comment to explain and check
this.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://www.postgresql.org/message-id/flat/f9aab072-0078-49e4-ab93-3b08086a4406@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/01f78a84bf5aca4c00fe1168381830aca6f1b873

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



Message-ID: <E1wjvYZ-000GvJ-0P@gemulon.postgresql.org>
Permalink:  ../E1wjvYZ-000GvJ-0P@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wjvYZ-000GvJ-0P@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add assertion about ssize_t narrowing in AIO code
  In-Reply-To: <E1wjvYZ-000GvJ-0P@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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