Skip to content

Commit 5f18e21

Browse files
author
Hiroshi Inoue
committed
BufferAlloc() doesn't allocate write error buffers.
Remove compiler waring(my fault).
1 parent 77df055 commit 5f18e21

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.84 2000/09/29 01:23:47 inoue Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.85 2000/09/29 03:55:45 inoue Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -448,6 +448,16 @@ BufferAlloc(Relation reln,
448448
{
449449
bool smok;
450450

451+
/*
452+
* skip write error buffers
453+
*/
454+
if ((buf->flags & BM_IO_ERROR) != 0)
455+
{
456+
PrivateRefCount[BufferDescriptorGetBuffer(buf) - 1] = 0;
457+
buf->refcount--;
458+
buf = (BufferDesc *) NULL;
459+
continue;
460+
}
451461
/*
452462
* Set BM_IO_IN_PROGRESS to keep anyone from doing anything
453463
* with the contents of the buffer while we write it out. We
@@ -2529,7 +2539,7 @@ AbortBufferIO(void)
25292539
else
25302540
{
25312541
Assert((buf->flags & BM_DIRTY) != 0);
2532-
if (buf->flags & BM_IO_ERROR != 0)
2542+
if ((buf->flags & BM_IO_ERROR) != 0)
25332543
{
25342544
elog(NOTICE, "write error may be permanent: cannot write block %u for %s/%s",
25352545
buf->tag.blockNum, buf->blind.dbname, buf->blind.relname);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy