aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-06-18 00:47:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-06-18 00:47:20 +0000
commitde6a6383a70b4bdd7b0707fbe4e2da704294b263 (patch)
treeed70efce2f2ae9feb5d1cf85f4173560311d65cc /src/backend/storage/buffer/bufmgr.c
parent011b51cb7e912af2674ee6685a51651182ceab4f (diff)
downloadpostgresql-de6a6383a70b4bdd7b0707fbe4e2da704294b263.tar.gz
postgresql-de6a6383a70b4bdd7b0707fbe4e2da704294b263.zip
Update obsolete comment: it's no longer the case that mdread() will allow
reads beyond EOF, except by special coercion.
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r--src/backend/storage/buffer/bufmgr.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index bbb6e0bc04a..fb09389e4eb 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -8,7 +8,7 @@
*
*
* 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
* the relation but we found a pre-existing buffer marked BM_VALID.
* This can happen because mdread doesn't complain about reads beyond
- * EOF --- which is arguably bogus, but changing it seems tricky ---
- * and so a previous attempt to read a block just beyond EOF could
- * have left a "valid" zero-filled buffer. Unfortunately, we have
- * also seen this case occurring because of buggy Linux kernels that
- * sometimes return an lseek(SEEK_END) result that doesn't account for
- * a recent write. In that situation, the pre-existing buffer would
- * contain valid data that we don't want to overwrite. Since the
- * legitimate cases should always have left a zero-filled buffer,
- * complain if not PageIsNew.
+ * EOF (when zero_damaged_pages is ON) and so a previous attempt to
+ * read a block beyond EOF could have left a "valid" zero-filled
+ * buffer. Unfortunately, we have also seen this case occurring
+ * because of buggy Linux kernels that sometimes return an
+ * lseek(SEEK_END) result that doesn't account for a recent write.
+ * In that situation, the pre-existing buffer would contain valid data
+ * that we don't want to overwrite. Since the legitimate case should
+ * always have left a zero-filled buffer, complain if not PageIsNew.
*/
bufBlock = isLocalBuf ? LocalBufHdrGetBlock(bufHdr) : BufHdrGetBlock(bufHdr);
if (!PageIsNew((PageHeader) bufBlock))