I think this new code needs to go before the UnlockReleaseBuffer() calls above. Calling BufferGetBlockNumber() on an already-released buffer is not cool.
- Heikki
I know that. This is the old version of the patch. I had sent updated patch later. Please have a look at updated patch.