]> granicus.if.org Git - postgresql/commit
Fix VM buffer pin management in heap_lock_updated_tuple_rec().
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 2 Mar 2018 22:40:48 +0000 (17:40 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 2 Mar 2018 22:40:48 +0000 (17:40 -0500)
commit0b1d1a038babff4aadf0862c28e7b667f1b12a30
tree4aa84f8e727026718c61665fdb884356637fb5a0
parente94f2bc809a0c684185666f19d81f6496e732a3a
Fix VM buffer pin management in heap_lock_updated_tuple_rec().

Sloppy coding in this function could lead to leaking a VM buffer pin,
or to attempting to free the same pin twice.  Repair.  While at it,
reduce the code's tendency to free and reacquire the same page pin.

Back-patch to 9.6; before that, this routine did not concern itself
with VM pages.

Amit Kapila and Tom Lane

Discussion: https://postgr.es/m/CAA4eK1KJKwhc=isgTQHjM76CAdVswzNeAuZkh_cx-6QgGkSEgA@mail.gmail.com
src/backend/access/heap/heapam.c