model-writtenrun 3293 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Xing Guo proposed checking blocknum + nblocks against the relation size in mdwritev(), so the assertion covers every block of a vectored write #1.
- Michael Paquier agreed that the assertion should be stricter and reported that adding an extra block to the calculation immediately failed during initdb #2.
- Tom Lane identified a possible 32-bit wraparound and proposed uint64 casts to preserve the overflow check; Michael accepted that expression #3 #4 #5.
- Michael committed Xing's patch with Tom's overflow protection as f04d1c1db0 and announced its application to HEAD #6.
- After the commit, Andres Freund pointed out that common/int.h already provides efficient overflow checks, and Michael agreed that pg_add_u32_overflow() could be used here #7 #8.
- Michael posted a follow-up delta using pg_add_u32_overflow() and an assertion-build guard, asking whether it addressed Andres's concerns; the original fix was committed, while this alternative remained awaiting feedback at the thread's end #9.