Safeguards against incorrect fd flags for fsync()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Safeguards against incorrect fd flags for fsync()
Date: 2019-10-09 06:26:40
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi all,

After the set of issues discussed here, it seems to me that it would
be a good thing to have some safeguards against incorrect flags when
opening a fd which would be used for fsync():

Attached is a patch aimed at doing that. Historically O_RDONLY is 0,
so when looking at a directory we just need to make sure that no write
flags are used. For files, that's the contrary, a write flag has to
be used.

Thoughts or better ideas?


Attachment Content-Type Size
fsync-safeguards.patch text/x-diff 1.0 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2019-10-09 06:39:00 Re: [HACKERS] Deadlock in XLogInsert at AIX
Previous Message Moon, Insung 2019-10-09 06:20:35 Re: Transparent Data Encryption (TDE) and encrypted files