BufferAlloc() doesn't allocate write error buffers.
authorHiroshi Inoue <inoue@tpf.co.jp>
Fri, 29 Sep 2000 03:55:45 +0000 (03:55 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Fri, 29 Sep 2000 03:55:45 +0000 (03:55 +0000)
Remove compiler waring(my fault).

src/backend/storage/buffer/bufmgr.c

index 6db9d170e6dc57a264bd8924ee8895021b6ef2e1..338d69bf8cebeaa4a4bd0486782bba2d9edfbb2f 100644 (file)
@@ -448,6 +448,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
@@ -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);