Prevent overflow for block number in buffile.c

Michael Paquier <michael@paquier.xyz>

Commit: 3650e7a3933166b40f7f9043bd91f45d3467c74d
Author: Michael Paquier <michael@paquier.xyz>
Date: 2023-11-20T00:14:53Z
Releases: 17.0
Prevent overflow for block number in buffile.c

As coded, the start block calculated by BufFileAppend() would overflow
once more than 16k files are used with a default block size.  This issue
existed before b1e5c9fa9ac4, but there's no reason not to be clean about
it.

Per report from Coverity, with a fix suggested by Tom Lane.

Files

PathChange+/−
src/backend/storage/file/buffile.c modified +1 −1