]> 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:09:52 +0000 (16:09 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 Nov 2013 20:09:52 +0000 (16:09 -0400)
commit14d4548f1c9ba21d2c1eb26e4169e6fee3b3fd68
tree9183888c8ebd43be7a9b82e1e548eb365689c093
parent2650c5cf4beb727e739f71a77369b01bf6daaf60
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