Hi!
> 13 дек. 2018 г., в 17:03, Alexander Korotkov <aekorot...@gmail.com> > написал(а): > > Thank you. I've revised your patch and pushed it. As long as two > other patches in this thread. That's great! Thanks! > 13 дек. 2018 г., в 20:12, chjis...@163.com написал(а): > > > hi > I Have a question. Why the order of unlocking is not adjusted in this patch? > like this: > > if (BufferIsValid(lbuffer)) > UnlockReleaseBuffer(lbuffer); > if (BufferIsValid(pbuffer)) > UnlockReleaseBuffer(pbuffer); > if (BufferIsValid(dbuffer)) > UnlockReleaseBuffer(dbuffer); > ==> > if (BufferIsValid(pbuffer)) > UnlockReleaseBuffer(pbuffer); > if (BufferIsValid(dbuffer)) > UnlockReleaseBuffer(dbuffer); > if (BufferIsValid(lbuffer)) > UnlockReleaseBuffer(lbuffer); I think that unlock order does not matter. But I may be wrong. May be just for uniformity? > 13 дек. 2018 г., в 21:48, Tom Lane <t...@sss.pgh.pa.us> написал(а): > > Bruce Momjian <br...@momjian.us> writes: >> I am seeing this warning in the 9.4 branch: >> ginxlog.c:756:5: warning: ‘lbuffer’ may be used uninitialized >> in this function [-Wmaybe-uninitialized] > > I'm also getting that, just in 9.4, but at a different line number: > > ginxlog.c: In function 'ginRedoDeletePage': > ginxlog.c:693: warning: 'lbuffer' may be used uninitialized in this function > > That's with gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) That's the same variable, one place is definition while other is potential misuse. Seems like these 2 lines [0] + if (BufferIsValid(lbuffer)) + UnlockReleaseBuffer(lbuffer); are superfluous: lbuffer is UnlockReleased earlier. Best regards, Andrey Borodin. [0] https://github.com/postgres/postgres/commit/19cf52e6cc33b9e126775f28269ccccb6ddf7e30#diff-ed6446a8993c76d2884ec6413e49a6b6R757