Update obsolete comment: it's no longer the case that mdread() will allow
reads beyond EOF, except by special coercion.
This commit is contained in:
parent
011b51cb7e
commit
de6a6383a7
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.220 2007/05/30 20:11:58 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.221 2007/06/18 00:47:20 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -223,15 +223,14 @@ ReadBuffer_common(Relation reln, BlockNumber blockNum, bool zeroPage,
|
||||||
* We get here only in the corner case where we are trying to extend
|
* We get here only in the corner case where we are trying to extend
|
||||||
* the relation but we found a pre-existing buffer marked BM_VALID.
|
* the relation but we found a pre-existing buffer marked BM_VALID.
|
||||||
* This can happen because mdread doesn't complain about reads beyond
|
* This can happen because mdread doesn't complain about reads beyond
|
||||||
* EOF --- which is arguably bogus, but changing it seems tricky ---
|
* EOF (when zero_damaged_pages is ON) and so a previous attempt to
|
||||||
* and so a previous attempt to read a block just beyond EOF could
|
* read a block beyond EOF could have left a "valid" zero-filled
|
||||||
* have left a "valid" zero-filled buffer. Unfortunately, we have
|
* buffer. Unfortunately, we have also seen this case occurring
|
||||||
* also seen this case occurring because of buggy Linux kernels that
|
* because of buggy Linux kernels that sometimes return an
|
||||||
* sometimes return an lseek(SEEK_END) result that doesn't account for
|
* lseek(SEEK_END) result that doesn't account for a recent write.
|
||||||
* a recent write. In that situation, the pre-existing buffer would
|
* In that situation, the pre-existing buffer would contain valid data
|
||||||
* contain valid data that we don't want to overwrite. Since the
|
* that we don't want to overwrite. Since the legitimate case should
|
||||||
* legitimate cases should always have left a zero-filled buffer,
|
* always have left a zero-filled buffer, complain if not PageIsNew.
|
||||||
* complain if not PageIsNew.
|
|
||||||
*/
|
*/
|
||||||
bufBlock = isLocalBuf ? LocalBufHdrGetBlock(bufHdr) : BufHdrGetBlock(bufHdr);
|
bufBlock = isLocalBuf ? LocalBufHdrGetBlock(bufHdr) : BufHdrGetBlock(bufHdr);
|
||||||
if (!PageIsNew((PageHeader) bufBlock))
|
if (!PageIsNew((PageHeader) bufBlock))
|
||||||
|
|
Loading…
Reference in New Issue