Thread: pgsql: Oops, don't forget to rewind the directory before scanning it to

pgsql: Oops, don't forget to rewind the directory before scanning it to

From
stark@postgresql.org (Greg Stark)
Date:
Log Message:
-----------
Oops, don't forget to rewind the directory before scanning it to fsync files in CREATE DATABASE

Modified Files:
--------------
    pgsql/src/port:
        copydir.c (r1.28 -> r1.29)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/port/copydir.c?r1=1.28&r2=1.29)

Re: pgsql: Oops, don't forget to rewind the directory before scanning it to

From
Tom Lane
Date:
stark@postgresql.org (Greg Stark) writes:
> Oops, don't forget to rewind the directory before scanning it to fsync files in CREATE DATABASE

This is certainly not right:

+     AllocateDir(fromdir);
      if (xldir == NULL)
          ereport(ERROR,

There's no guarantee AllocateDir will hand back the same pointer as
it did the previous time.

            regards, tom lane

Re: pgsql: Oops, don't forget to rewind the directory before scanning it to

From
Fujii Masao
Date:
On Mon, Feb 22, 2010 at 9:11 AM, Greg Stark <stark@postgresql.org> wrote:
> Log Message:
> -----------
> Oops, don't forget to rewind the directory before scanning it to fsync files in CREATE DATABASE

      }
+     Free(xldir);

s/Free/FreeDir ?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center