pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Improve pg_check_dir code and comments.
5+ messages / 3 participants
[nested] [flat]

* pgsql: Improve pg_check_dir code and comments.
@ 2015-02-17 15:32  Robert Haas <rhaas@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Robert Haas @ 2015-02-17 15:32 UTC (permalink / raw)
  To: pgsql-committers

Improve pg_check_dir code and comments.

Avoid losing errno if readdir() fails and closedir() works.  Consistently
return 4 rather than 3 if both a lost+found directory and other files are
found, rather than returning one value or the other depending on the
order of the directory listing.  Update comments to match the actual
behavior.

These oversights date to commits 6f03927fce038096f53ca67eeab9adb24938f8a6
and 17f15239325a88581bb4f9cf91d38005f1f52d69.

Marco Nenciarini

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5d6c2405f4bae6c87533d981d6a47587db501220

Modified Files
--------------
src/port/pgcheckdir.c |   23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Improve pg_check_dir code and comments.
@ 2015-02-17 15:45  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Robert Haas <rhaas@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2015-02-17 15:45 UTC (permalink / raw)
  To: Robert Haas <rhaas@postgresql.org>; +Cc: pgsql-committers

Robert Haas <rhaas@postgresql.org> writes:
> Improve pg_check_dir code and comments.
> Avoid losing errno if readdir() fails and closedir() works.  Consistently
> return 4 rather than 3 if both a lost+found directory and other files are
> found, rather than returning one value or the other depending on the
> order of the directory listing.  Update comments to match the actual
> behavior.

> These oversights date to commits 6f03927fce038096f53ca67eeab9adb24938f8a6
> and 17f15239325a88581bb4f9cf91d38005f1f52d69.

In that case, doesn't this need to be back-patched?

In addition to the problems you cite, the previous coding appears to fail
to close the directory handle if readdir() fails, which is certainly a
significant enough bug to merit back-patching.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Improve pg_check_dir code and comments.
@ 2015-02-17 15:49  Robert Haas <robertmhaas@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Robert Haas @ 2015-02-17 15:49 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers

On Tue, Feb 17, 2015 at 10:45 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <rhaas@postgresql.org> writes:
>> Improve pg_check_dir code and comments.
>> Avoid losing errno if readdir() fails and closedir() works.  Consistently
>> return 4 rather than 3 if both a lost+found directory and other files are
>> found, rather than returning one value or the other depending on the
>> order of the directory listing.  Update comments to match the actual
>> behavior.
>
>> These oversights date to commits 6f03927fce038096f53ca67eeab9adb24938f8a6
>> and 17f15239325a88581bb4f9cf91d38005f1f52d69.
>
> In that case, doesn't this need to be back-patched?
>
> In addition to the problems you cite, the previous coding appears to fail
> to close the directory handle if readdir() fails, which is certainly a
> significant enough bug to merit back-patching.

OK, I'll work on that.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Improve pg_check_dir code and comments.
@ 2015-02-17 15:57  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Robert Haas @ 2015-02-17 15:57 UTC (permalink / raw)
  To: pgsql-committers

Improve pg_check_dir code and comments.

Avoid losing errno if readdir() fails and closedir() works.  Consistently
return 4 rather than 3 if both a lost+found directory and other files are
found, rather than returning one value or the other depending on the
order of the directory listing.  Update comments to match the actual
behavior.

These oversights date to commits 6f03927fce038096f53ca67eeab9adb24938f8a6
and 17f15239325a88581bb4f9cf91d38005f1f52d69.

Marco Nenciarini

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/5e49c98e0a9949e6f86b068837ca59c36d8619ba

Modified Files
--------------
src/port/pgcheckdir.c |   23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Improve pg_check_dir code and comments.
@ 2015-02-17 15:57  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Robert Haas @ 2015-02-17 15:57 UTC (permalink / raw)
  To: pgsql-committers

Improve pg_check_dir code and comments.

Avoid losing errno if readdir() fails and closedir() works.  Consistently
return 4 rather than 3 if both a lost+found directory and other files are
found, rather than returning one value or the other depending on the
order of the directory listing.  Update comments to match the actual
behavior.

These oversights date to commits 6f03927fce038096f53ca67eeab9adb24938f8a6
and 17f15239325a88581bb4f9cf91d38005f1f52d69.

Marco Nenciarini

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/9a90ec9cff34168994f5d544c2c3cc1b1ae21277

Modified Files
--------------
src/port/pgcheckdir.c |   23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2015-02-17 15:57 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-02-17 15:32 pgsql: Improve pg_check_dir code and comments. Robert Haas <rhaas@postgresql.org>
2015-02-17 15:45 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-02-17 15:49   ` Robert Haas <robertmhaas@gmail.com>
2015-02-17 15:57 pgsql: Improve pg_check_dir code and comments. Robert Haas <rhaas@postgresql.org>
2015-02-17 15:57 pgsql: Improve pg_check_dir code and comments. Robert Haas <rhaas@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox