Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5f18e21

Browse files
author
Hiroshi Inoue
committed
BufferAlloc() doesn't allocate write error buffers.
Remove compiler waring(my fault).
1 parent77df055 commit5f18e21

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/2901:23:47 inoue Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.85 2000/09/2903:55:45 inoue Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -448,6 +448,16 @@ BufferAlloc(Relation reln,
448448
{
449449
boolsmok;
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)

[8]ページ先頭

©2009-2025 Movatter.jp