smgr: Make SMgrRelation initialization safer against errors
authorAndres Freund <andres@anarazel.de>
Tue, 18 Mar 2025 17:43:10 +0000 (13:43 -0400)
committerAndres Freund <andres@anarazel.de>
Tue, 18 Mar 2025 18:04:44 +0000 (14:04 -0400)
commit499faf9063a4c5a9985d7ac657b86e8e34e02199
treeb128ef16b08f98e111eb875406e48aa33bf067a9
parent62d712ecfd940f60e68bde5b6972b6859937c412
smgr: Make SMgrRelation initialization safer against errors

In case the smgr_open callback failed, the ->pincount field would not be
initialized and the relation would not be put onto the unpinned_relns list.

This buglet was introduced in 21d9c3ee4ef7, in 17.

Discussion: https://postgr.es/m/3vae7l5ozvqtxmd7rr7zaeq3qkuipz365u3rtim5t5wdkr6f4g@vkgf2fogjirl
Backpatch-through: 17
src/backend/storage/smgr/smgr.c