pgsql: Improve assertion in mdwritev() - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Improve assertion in mdwritev()
Date
Msg-id E1sEFz7-002rky-0T@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Improve assertion in mdwritev()

The assertion used at the beginning of mdwritev(), that is not enabled
except by defining -DCHECK_WRITE_VS_EXTEND as mdnblocks() is costly,
forgot about the total number of blocks to write at location specified
by the caller.  The calculation is fixed to count for that, and uses
casts to uint64 to ensure a proper check should the number of blocks
overflow.

Using a cast is a suggestion from Tom Lane.

Oversight in 4908c5872059.

Author: Xing Guo
Discussion: https://postgr.es/m/CACpMh+BM-VgKeO7suPG-VHTtpzJ+zsbDPwVHu42PLp-iTk0z+A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f04d1c1db01199f02b0914a7ca2962c531935717

Modified Files
--------------
src/backend/storage/smgr/md.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Nathan Bossart
Date:
Subject: pgsql: Fix documentation for System V semaphores.
Next
From: Andres Freund
Date:
Subject: pgsql: ci: windows: Use the same image for VS and MinGW tasks