| From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Add assertion about ssize_t narrowing in AIO code |
| Date: | 2026-07-15 09:05:31 |
| Message-ID: | E1wjvYZ-000GvJ-0P@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(at)iki(dot)fi>
Discussion: https://www.postgresql.org/message-id/flat/f9aab072-0078-49e4-ab93-3b08086a4406(at)eisentraut(dot)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(+)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2026-07-15 09:14:02 | pgsql: doc PG 19 relnotes: remove duplicate word |
| Previous Message | Peter Eisentraut | 2026-07-15 07:50:07 | pgsql: Clean up read() return type |