]> granicus.if.org Git - postgresql/commit
Ensure all files created for a single BufFile have the same resource owner.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 Nov 2013 20:10:08 +0000 (16:10 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 Nov 2013 20:10:08 +0000 (16:10 -0400)
commitd74eaf374f715b357f0617cfc34ce9e43e6238f9
treebe3e6ffe033271a8a13c6156e03b68cf99c9f653
parent01499ea330b2c4bbef7f274416fc58d4dece8050
Ensure all files created for a single BufFile have the same resource owner.

Callers expect that they only have to set the right resource owner when
creating a BufFile, not during subsequent operations on it.  While we could
insist this be fixed at the caller level, it seems more sensible for the
BufFile to take care of it.  Without this, some temp files belonging to
a BufFile can go away too soon, eg at the end of a subtransaction,
leading to errors or crashes.

Reported and fixed by Andres Freund.  Back-patch to all active branches.
src/backend/storage/file/buffile.c