Re: Safeguards against incorrect fd flags for fsync()

2019-11-25 Thread Michael Paquier
On Mon, Nov 25, 2019 at 04:18:33PM +0900, Michael Paquier wrote: > Thanks for the review. I'll look at that pretty soon. Tweaked a bit the comment block added, and committed. Thanks Mark for the input! -- Michael signature.asc Description: PGP signature

Re: Safeguards against incorrect fd flags for fsync()

2019-11-24 Thread Michael Paquier
On Sun, Nov 24, 2019 at 08:18:38PM -0800, Mark Dilger wrote: > Ok, it passes all regression tests, and I played around with > intentionally breaking the code to open file descriptors in > the wrong mode. The assertion appears to work as intended. > > I'd say this is ready for commit. Thanks for

Re: Safeguards against incorrect fd flags for fsync()

2019-11-24 Thread Mark Dilger
On 11/24/19 6:53 PM, Mark Dilger wrote: On 11/24/19 6:28 PM, Michael Paquier wrote: On Thu, Nov 07, 2019 at 01:57:57PM -0800, Mark Dilger wrote: The code and comments don't clearly indicate what you have said in the email, that you are verifying directories are opened read-only and files

Re: Safeguards against incorrect fd flags for fsync()

2019-11-24 Thread Mark Dilger
On 11/24/19 6:28 PM, Michael Paquier wrote: On Thu, Nov 07, 2019 at 01:57:57PM -0800, Mark Dilger wrote: The code and comments don't clearly indicate what you have said in the email, that you are verifying directories are opened read-only and files are opened either read-write or write-only.

Re: Safeguards against incorrect fd flags for fsync()

2019-11-24 Thread Michael Paquier
On Thu, Nov 07, 2019 at 01:57:57PM -0800, Mark Dilger wrote: > The code and comments don't clearly indicate what you have said in the > email, that you are verifying directories are opened read-only and files are > opened either read-write or write-only. I'd recommend changing the comments > a bit

Re: Safeguards against incorrect fd flags for fsync()

2019-11-07 Thread Mark Dilger
On 10/8/19 11:26 PM, Michael Paquier wrote: 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-196fc97cc05e1.

Safeguards against incorrect fd flags for fsync()

2019-10-08 Thread Michael Paquier
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-196fc97cc05e1...@postgresql.org Attached is a patch aimed at