Re: BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: bianpan2016(at)163(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close()
Date: 2018-03-09 04:40:52
Message-ID: 20180309044052.GC1416@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Mar 09, 2018 at 03:29:25AM +0000, PG Bug reporting form wrote:
> Details: The handler opened with OpenTransientFile() should be closed with
> CloseTransientFile(). However, in function dsm_impl_mmap(), on a certain
> path, the return value of OpenTransientFile() (at line 885) is passed to
> close() (at line 926). It is better to use CloseTransientFile() here, as
> done at line 909.

Good catch! This is visibly a copy-paste error coming from
dsm_impl_posix(). As a patch it gives the attached. I am adding also
Robert in CC for awareness.
--
Michael

Attachment Content-Type Size
dsm-impl-close.patch text/x-diff 465 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Mehdi Rahman 2018-03-09 10:51:49 Re: BUG #15102: Performance problem when doing join, index are not used
Previous Message PG Bug reporting form 2018-03-09 03:29:25 BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close()