]> granicus.if.org Git - postgresql/commitdiff
Fix range check for effective_io_concurrency
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 24 May 2016 18:55:34 +0000 (14:55 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 24 May 2016 18:55:34 +0000 (14:55 -0400)
Commit 1aba62ec moved the range check of that option form guc.c into
bufmgr.c, but introduced a bug by changing a >= 0.0 to > 0.0, which made
the value 0 no longer accepted.  Put it back.

Reported by Jeff Janes, diagnosed by Tom Lane

src/backend/storage/buffer/bufmgr.c

index c0d5fa74e102add8a2df483e8249c3b978ef7723..e5dafaf00c045286d37eb55525ba56ea0e64b2c9 100644 (file)
@@ -514,7 +514,7 @@ ComputeIoConcurrency(int io_concurrency, double *target)
        *target = new_prefetch_pages;
 
        /* This range check shouldn't fail, but let's be paranoid */
-       return (new_prefetch_pages > 0.0 && new_prefetch_pages < (double) INT_MAX);
+       return (new_prefetch_pages >= 0.0 && new_prefetch_pages < (double) INT_MAX);
 }
 
 /*