Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRDv8-00026p-SG for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Oct 2020 12:24:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kRDv6-00037C-7a for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Oct 2020 12:24:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRDv4-0002pH-MZ for pgsql-hackers@lists.postgresql.org; Sat, 10 Oct 2020 12:24:16 +0000 Received: from [64.147.123.25] (helo=wout2-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRDv0-0001Zp-VJ for pgsql-hackers@lists.postgresql.org; Sat, 10 Oct 2020 12:24:13 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 118F26C3; Sat, 10 Oct 2020 08:23:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 10 Oct 2020 08:23:59 -0400 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=fm2; bh=OQuX9qssUU0hozuciThmfWpS5aq fjCCghhmJhgaRIFY=; b=QEoSBQe/gEDyQVFt5/10m/ylkl9WWYr2P7gTIKUhRgD AqFb5PjccoxUsgrWSNxJBsu6pDU5tf6jGRlbeisYv0nwIzAMf37n5XNCvhfzB26q pQrpzBn0w83VxstslhYJX7PXjD7dsAUTILJnjM0y4TvVNiLUtbp8uWF4cNc/A8nJ qOjHot7jX00lErXDo7YDPygTTp+Hw2lkGVN+fq7KmmjhZBGz2vQ4gkGsgAcqOjRr 8s0vGWd4vfFuVlWrGZLQO8KSvPg5JDlbmH4I3XsU4hg7z4LopDNKfB5QiP3/EQud clA4hDKJQlp2e7//T0vJpGAWp/pO1usS97rhG4ItpKQ== 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=OQuX9q ssUU0hozuciThmfWpS5aqfjCCghhmJhgaRIFY=; b=IWnLuyYc9WVEgTkSCQ01Lz 6Wf8HHD4krXSuse473Ed12g3DvlFvmuQjqUFpamxm+LTx2c30WzcgOeWMpSQR49p PpI6qjVpTWAziL+jrEuarhSxw2eYXmyck1vxtkltj2DfUpg1QWzJ9xCa182Ftq5I 4Q8niRlVG/6pTN3rfPJec+BNcRug3mkZ0fINn/LYtsQKodtTFk4tbfgSgyT/XZ6Q lw37zqnCs1tY5lOq8hmxrVBXEsBqViT8oksVHAAdTu82sE0QxcmDJ5f8AIiZyQ0p yYEICOA56MPxf4vOIROpDpqFNbgerlUYi9OAXjGPv4tuhRX5lBtobl7y3d2X93Sg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrheefgdehtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddu necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvedtgfekudduueevteefgefgjedu vddtteeuhfelueffueekiefhjefgieegudelnecukfhppeduuddurddutddvrddukedtrd dukeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep mhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id BF2C93064674; Sat, 10 Oct 2020 08:23:56 -0400 (EDT) Date: Sat, 10 Oct 2020 21:23:53 +0900 From: Michael Paquier To: Juan =?iso-8859-1?Q?Jos=E9_Santamar=EDa?= Flecha Cc: Tom Lane , Emil Iggland , PostgreSQL Hackers Subject: Re: BUG #15858: could not stat file - over 4GB Message-ID: <20201010122353.GA2985@paquier.xyz> References: <15858-9572469fd3b73263@postgresql.org> <160209800917.1171.12856112208955258625.pgcf@coridan.postgresql.org> <2831747.1602274940@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.25 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 10, 2020 at 01:31:21PM +0200, Juan Jos=E9 Santamar=EDa Flecha w= rote: > Thanks for taking care of this. I see no problems in the build farm, but > please reach me if I missed something. Thanks for continuing your work on this patch. I see no related failures in the buildfarm. - _dosmaperr(GetLastError()); + DWORD err =3D GetLastError(); + + /* report when not ERROR_SUCCESS */ + if (err =3D=3D ERROR_FILE_NOT_FOUND || err =3D=3D ERROR_PAT= H_NOT_FOUND) + errno =3D ENOENT; + else + _dosmaperr(err); Why are you changing that? The original coding is fine, as _dosmaperr() already maps ERROR_FILE_NOT_FOUND and ERROR_PATH_NOT_FOUND to ENOENT. - _dosmaperr(GetLastError()); + DWORD err =3D GetLastError(); + CloseHandle(hFile); + _dosmaperr(err); These parts are indeed incorrect. CloseHandle() could overwrite errno. -- Michael --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl+Bp9kACgkQnvQgOdby QH2IWRAAlODxua+iIAHo0EjJ5TyKkoiH5XsmJSR06AVdrhNTiBuNB2/8f9+3uWm2 SGXDKE5EILgySYWLPF8kbc3IrjnkhLgaNUnnFWfYSxaoU+uq1/qQu3CDTDQiY9IW PJOn4Lek+3GYw09KvAAorU5UQ0YQod8H40e/6PLQx3H2ssv3p0mrZgYWakxtKdFB HW7mHhBPsayvZUFzT15I7FS1y+kuTSk7IQTr+FxnK3Lae0aBcnAbsv7qYhgrtwRs HzWKRZLJaBGjUb4lGyE0lkWqv++3urRZXg1XbxC2xWjwgbOVATUYGqT4jt2LFtwR ymgq690JuRHsvlDJ6lCzJ7UIGJNxzn5YIVWSGYd82wm0f4kfpsd0a7u2MdolwDMa 6AxgkBhcTsyvC1ECNM6QiWQL06x3uzM0k8A8CVmEHP+V7vhowTcX9PxFg5W6O9c0 baIZAhCTWrvnTSWMFc4zqwtDjBXFpA8GxPfll3OeL+dQA1HQ5bO3RyUJYMV2CoNK zSOGQi5+4AFFrBXZauMpEtdo1mdlvY8OSbarvdC1C35hE9KHpZ1FqgYsNWd8f0hX cV6IjyGzde3u5pVUcDarA1t97OV/0DP+67ZcEkmcbKg3ALT25y7SbBOHyPYY+T5A pSArOEpGPABp84DeDpB0u+1hBe1nVvsPL8pZjnQLl8JoTSvMWgU= =ENmK -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe--