Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcKB1-0007xs-SJ for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 01:09:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gcKB0-0004cf-JC for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Dec 2018 01:09:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcKB0-0004cY-C4 for pgsql-hackers@lists.postgresql.org; Thu, 27 Dec 2018 01:09:30 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gcKAw-0004c1-35 for pgsql-hackers@postgresql.org; Thu, 27 Dec 2018 01:09:29 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A14D821C86; Wed, 26 Dec 2018 20:09:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 26 Dec 2018 20:09:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=LPyas9YJbnC85dyV8qOD7fESga0 ClNI0R2uPoUo61Yo=; b=PjzGybVfMB2hqBj+xvwiEwD6956vnxylYn+4Oi/1Vk0 Hst2tmFeQ+bJ3yxOfKfYQ0qys7kS4zYQkdyfO7NsYGj3aLi7UKw/eWFMt33YHWYv +xFa1SeOeLEUuG2I5a+m4XIrwnrTKHs98eRmeAiYZlOzfV62IkohLpi83FiaL8HL SD1m/VGdt2i3K4Q+mjI3nCFXjMVe5iryi4FlPn9AISYI/8yVw+sc1NeTp81ndkRW TfKvaq/X/2zHpuuiLj6DibYBzeeV053XflJrgDsY2w8YlZtmcuSaLPf/ExR38kQj seWXr9UYPZsx1mx5DMow6tw0uJmulB+Vdk+nRjHMx8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=LPyas9 YJbnC85dyV8qOD7fESga0ClNI0R2uPoUo61Yo=; b=tLNfeeTGlt0ZvFM2VuuKVh YOL+lcXD5JDJfItIa9QKCx3gnyoPpU2do/ufqqGzcCsaToTbm9feojLNfxV+n7Vg vcGbl/weX8bpWg+ks+MkzgnGHK4d8SgAfpP/CArs7x0TOtA6cCJpVo8jLrK0N+kL Jeyt3xjU0IsQd2kQsuUqBrr9igo/EMp9KWC7ozQKf3fAiGnslD/A18tdu9oRuZV0 0XB+d3e4eW9pnfNVOLyF5Lw+EE+dYdrccGo8peXwHHHHkX5eDzXGpjZNSQT/RkIn BnAHidhOEKoEJJtjvZrNdsnrnWtPpAU/vyVANFPoERQl5GjB4QV7KJd78CheC+GA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrtddugdeftdculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepiedurddvudehrddufeejrdduiedvnecurfgrrhgr mhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluh hsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 1A296100B9; Wed, 26 Dec 2018 20:09:21 -0500 (EST) Date: Thu, 27 Dec 2018 10:09:18 +0900 From: Michael Paquier To: Tom Lane Cc: Postgres hackers , Peter Eisentraut Subject: Re: pgsql: Fix failure to check for open() or fsync() failures. Message-ID: <20181227010918.GC2106@paquier.xyz> References: <20181226224351.GA2106@paquier.xyz> <26009.1545864936@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5QAgd0e35j3NYeGe" Content-Disposition: inline In-Reply-To: <26009.1545864936@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --5QAgd0e35j3NYeGe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 26, 2018 at 05:55:36PM -0500, Tom Lane wrote: > It appears to me that the code is intentionally not worrying about > fsync failure, so it seems wrong for it to FATAL out if it's unable > to open the file to fsync it. And it surely shouldn't do so if the > file isn't there. My point is a bit different though: it seems to me that we could just call BasicOpenFilePerm() and remove the stat() to do exactly the same things, simplifying the code. -- Michael --5QAgd0e35j3NYeGe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlwkJj4ACgkQnvQgOdby QH3GWQ//YOYYYCu0NfdtWtrvmOCD8HC6Jy1h05671BBs94BjlIItO+mfldL7jnyQ i9DRy2J6gWFvK5UHjH3svs8/z+16aejG72xqemu4rsM6GXRj76eknRXhp33RVP31 +Xd0vihpGgyzFQxJJH7Jvk0MOHLACY2rc9qDhy5Vb3cbybccpIHRcHBFxH4zg99X z9s0jkS3V5qLmKInxM4+CSr9iF2D3O1AH9ga5eatVLV67zwcrSa7+jWdLZapGjoD i4YVdmF8GbyuspbtZd4jq2JHKwU75ueIBxuGyV5+shY4AgsL7w+eYcsQgbF4qxt6 oQrDPi0cCjvHnsDOsgzezEaCnLwJ+RhIRW8LrAVijHP3K3VAoI10qszelG5fcDXc hXZLMChv7PNtdoC26e8KeryznDeCEvD9kOP8pemMlfPjrIyd9akv0GHd3WvvII9p 2IpKcLv6LyA/1ecbD98v5DTObb/BrP1n974fzNk6HiBzHjGAZoqqIhU0R4j0RRYI XqfGF3K6gN2eGZEZ7yfFDSbFgP47SIXWYzRhZtqkm1JbLUVu+K+Zt3DJ3/aeay+1 f9MLHAHMxgeIUMVMrPLXYnmhsirymFzRWMgmC+0eNFKIltL5MDEN/rMbXvDIHGlu xWuRZdUgB1yEeJ48/GQze2Y2/FVirEW9vWzRtm3r4VvJNK1zvwI= =xZxx -----END PGP SIGNATURE----- --5QAgd0e35j3NYeGe--