|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.220 2007/05/30 20:11:58 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.221 2007/06/18 00:47:20 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -223,15 +223,14 @@ ReadBuffer_common(Relation reln, BlockNumber blockNum, bool zeroPage,
|
223 | 223 | * We get here only in the corner case where we are trying to extend
|
224 | 224 | * the relation but we found a pre-existing buffer marked BM_VALID.
|
225 | 225 | * This can happen because mdread doesn't complain about reads beyond
|
226 |
| - * EOF --- which is arguably bogus, but changing it seems tricky --- |
227 |
| - * and so a previous attempt to read a block just beyond EOF could |
228 |
| - * have left a "valid" zero-filled buffer. Unfortunately, we have |
229 |
| - * also seen this case occurring because of buggy Linux kernels that |
230 |
| - * sometimes return an lseek(SEEK_END) result that doesn't account for |
231 |
| - * a recent write. In that situation, the pre-existing buffer would |
232 |
| - * contain valid data that we don't want to overwrite. Since the |
233 |
| - * legitimate cases should always have left a zero-filled buffer, |
234 |
| - * complain if not PageIsNew. |
| 226 | + * EOF (when zero_damaged_pages is ON) and so a previous attempt to |
| 227 | + * read a block beyond EOF could have left a "valid" zero-filled |
| 228 | + * buffer. Unfortunately, we have also seen this case occurring |
| 229 | + * because of buggy Linux kernels that sometimes return an |
| 230 | + * lseek(SEEK_END) result that doesn't account for a recent write. |
| 231 | + * In that situation, the pre-existing buffer would contain valid data |
| 232 | + * that we don't want to overwrite. Since the legitimate case should |
| 233 | + * always have left a zero-filled buffer, complain if not PageIsNew. |
235 | 234 | */
|
236 | 235 | bufBlock = isLocalBuf ? LocalBufHdrGetBlock(bufHdr) : BufHdrGetBlock(bufHdr);
|
237 | 236 | if (!PageIsNew((PageHeader) bufBlock))
|
|
0 commit comments