diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-04-16 10:21:09 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-04-16 10:27:01 +0300 |
commit | 61df3d090c0e42fd0ad06e5a3d70aca148107c30 (patch) | |
tree | bc568f1319eb2930c284017f78e459caa75bfd68 /src | |
parent | 0de1068365909970eb75c51d82467d28631b63ef (diff) | |
download | postgresql-61df3d090c0e42fd0ad06e5a3d70aca148107c30.tar.gz postgresql-61df3d090c0e42fd0ad06e5a3d70aca148107c30.zip |
Use correctly-sized buffer when zero-filling a WAL file.
I mixed up BLCKSZ and XLOG_BLCKSZ when I changed the way the buffer is
allocated a couple of weeks ago. With the default settings, they are both
8k, but they can be changed at compile-time.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/transam/xlog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 6b9209d882a..d0672a54d0d 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -2348,7 +2348,7 @@ XLogFileInit(uint32 log, uint32 seg, { char path[MAXPGPATH]; char tmppath[MAXPGPATH]; - char zbuffer_raw[BLCKSZ + MAXIMUM_ALIGNOF]; + char zbuffer_raw[XLOG_BLCKSZ + MAXIMUM_ALIGNOF]; char *zbuffer; uint32 installed_log; uint32 installed_seg; @@ -2410,7 +2410,7 @@ XLogFileInit(uint32 log, uint32 seg, * cycles transferring data to the kernel. */ zbuffer = (char *) MAXALIGN(zbuffer_raw); - memset(zbuffer, 0, BLCKSZ); + memset(zbuffer, 0, XLOG_BLCKSZ); for (nbytes = 0; nbytes < XLogSegSize; nbytes += XLOG_BLCKSZ) { errno = 0; |