Invalidate smgr_targblock in smgrrelease().

Thomas Munro <tmunro@postgresql.org>

Commit: 81e36d3e0df8d3d7a3daa2e2216f96df23ffc96a
Author: Thomas Munro <tmunro@postgresql.org>
Date: 2023-08-17T03:45:13Z
Releases: 17.0
Invalidate smgr_targblock in smgrrelease().

In rare circumstances involving relfilenode reuse, it might have been
possible for smgr_targblock to finish up pointing past the end.

Oversight in b74e94dc.  Back-patch to 15.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CA%2BhUKGJ8NTvqLHz6dqbQnt2c8XCki4r2QvXjBQcXpVwxTY_pvA%40mail.gmail.com

Files

PathChange+/−
src/backend/storage/smgr/smgr.c modified +1 −0

Discussion