Safeguards against incorrect fd flags for fsync()
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-10-09T06:26:40Z
Lists: pgsql-hackers
Attachments
- fsync-safeguards.patch (text/x-diff) patch
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(): https://www.postgresql.org/message-id/16039-196fc97cc05e141c@postgresql.org 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? Thanks, -- Michael
Commits
-
Make safeguard against incorrect flags for fsync more portable.
- d0a695cf41de 13.22 landed
- 71d71ac4d1bb 14.19 landed
- 0fb496c704fc 15.14 landed
- 45c5276628d1 18.0 landed
- 3a2617e4f0be 16.10 landed
- 29c54ea7b49c 17.6 landed
- 29213636e6cd 19 (unreleased) landed
-
Add safeguards for pg_fsync() called with incorrectly-opened fds
- 12198239c0a5 13.0 landed