diff options
author | Hiroshi Inoue <inoue@tpf.co.jp> | 2000-09-29 03:55:45 +0000 |
---|---|---|
committer | Hiroshi Inoue <inoue@tpf.co.jp> | 2000-09-29 03:55:45 +0000 |
commit | 5f18e2183e465b7a1616d1955839d8c51dbd8c87 (patch) | |
tree | a5af3bb022e29634c18ced7055236e52b766a7c1 /src/backend/storage/buffer/bufmgr.c | |
parent | 77df055c54f109fab16c9c78fdd007bf313b8e47 (diff) | |
download | postgresql-5f18e2183e465b7a1616d1955839d8c51dbd8c87.tar.gz postgresql-5f18e2183e465b7a1616d1955839d8c51dbd8c87.zip |
BufferAlloc() doesn't allocate write error buffers.
Remove compiler waring(my fault).
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r-- | src/backend/storage/buffer/bufmgr.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 2324089e768..24a70d61885 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.84 2000/09/29 01:23:47 inoue Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.85 2000/09/29 03:55:45 inoue Exp $ * *------------------------------------------------------------------------- */ @@ -449,6 +449,16 @@ BufferAlloc(Relation reln, bool smok; /* + * skip write error buffers + */ + if ((buf->flags & BM_IO_ERROR) != 0) + { + PrivateRefCount[BufferDescriptorGetBuffer(buf) - 1] = 0; + buf->refcount--; + buf = (BufferDesc *) NULL; + continue; + } + /* * Set BM_IO_IN_PROGRESS to keep anyone from doing anything * with the contents of the buffer while we write it out. We * don't really care if they try to read it, but if they can @@ -2529,7 +2539,7 @@ AbortBufferIO(void) else { Assert((buf->flags & BM_DIRTY) != 0); - if (buf->flags & BM_IO_ERROR != 0) + if ((buf->flags & BM_IO_ERROR) != 0) { elog(NOTICE, "write error may be permanent: cannot write block %u for %s/%s", buf->tag.blockNum, buf->blind.dbname, buf->blind.relname); |