Re: [PATCH] introduce XLogLockBlockRangeForCleanup()

From: Amit Khandekar <amit(dot)khandekar(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] introduce XLogLockBlockRangeForCleanup()
Date: 2014-07-04 09:37:14
Message-ID: CACoZds3KL9MxRe5PPDruT2s+Ay==iGrWGLHJqPygPTtXciR_=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3 July 2014 16:59, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:

>
> I think we should say this though
>
> LockBufHdr(buf);
> valid = ((buf->flags & BM_VALID) != 0);
> if (valid)
> PinBuffer_Locked(buf);
> else
> UnlockBufHdr(buf);
>
> since otherwise we would access the buffer flags without the spinlock
> and we would leak a pin if the buffer was not valid
>

Ah right. That is essential.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2014-07-04 09:40:59 Re: WAL replay bugs
Previous Message Kyotaro HORIGUCHI 2014-07-04 09:37:05 Re: WAL replay bugs