Fix failure to mark init buffers as BM_PERMANENT.

Robert Haas <rhaas@postgresql.org>

Commit: bbd5e600ff5cd23bdbb63687748d34fa02690600
Author: Robert Haas <rhaas@postgresql.org>
Date: 2017-03-14T16:06:36Z
Releases: 9.4.12
Fix failure to mark init buffers as BM_PERMANENT.

This could result in corruption of the init fork of an unlogged index
if the ambuildempty routine for that index used shared buffers to
create the init fork, which was true for gin, gist, and hash indexes.

Patch by me, based on an earlier patch by Michael Paquier, who also
reviewed this one.  This also incorporates an idea from Artur
Zakirov.

Discussion: http://postgr.es/m/CACYUyc8yccE4xfxhqxfh_Mh38j7dRFuxfaK1p6dSNAEUakxUyQ@mail.gmail.com

Files

Discussion