Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uP6Dx-000GrQ-MN for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jun 2025 21:09:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uP6Dv-009rDp-Mj for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jun 2025 21:09:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uP6Dv-009rDh-CP for pgsql-hackers@lists.postgresql.org; Tue, 10 Jun 2025 21:09:36 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uP6Du-001Ipa-1Z for pgsql-hackers@lists.postgresql.org; Tue, 10 Jun 2025 21:09:35 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43cfe63c592so68047505e9.2 for ; Tue, 10 Jun 2025 14:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749589772; x=1750194572; darn=lists.postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :subject:cc:to:from:date:sender:message-id:from:to:cc:subject:date :message-id:reply-to; bh=4bTKC+fTULxrTmOYYaigPU32Hm9VfEcvlGjp6+9TUqg=; b=MbmOe/Dwm0Yqh0G5VwQ/YJvH8+9AEeoF302xF0EJiFnQjvUsa8A4H0iIm8AwdcQp3l JJRzTW4fZmXyYz43ZKWBnx+KHW9kghFHGY88lFWKThntra9cFKCCDbLBTrdnCSB9x/y0 q+0Uz37zgjDfLKjP4cA8ZQNXjSxk127simsOsLHtl5dTJz3rq0ZR7OnT2zvZ0ExuVQJU yOf46FSNEVWzbxFU1X46FXTvw9sDlsmqhmS/ex9cIyo2vTfd0rscExKttRe9lrbrQj8c y3FpZ6V8n40EHiVBFgCe8VQdKtTYcx0aD+R+t3epgjhfA8h1pk3pm8g9ch8vfKzD/O9q BDUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749589772; x=1750194572; h=user-agent:in-reply-to:content-disposition:mime-version:references :subject:cc:to:from:date:sender:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4bTKC+fTULxrTmOYYaigPU32Hm9VfEcvlGjp6+9TUqg=; b=MAYgVUMYqYy/2naD6IXQgchFQ/OV9BT9KJaojytYsnm1EwXYCtShtXSR/MSpaBVaBb pCwPAsNMSNRm5gn2cksvm49vey2TACqbkJ5KZ+ytdfyyQZLYTmfsy5ETJnydTzsJYxya E4PU52fcv4ePXDOHG4eveqel+CWv3tRF/5El9ocEFdX3Y+E7vhYvo8bd817WFsV1rzLN 0yJYEZjgegMF5dUurlK4bovFEm/ICJsWdmQcmrt57DkER127VQlxJP5HjO6QvFsqENlC KB/gtJIv7ZWkbmyRKth7+ONtLDpLHOieoWPnHI4xBZChFk6DT9wNpHrsv9LVQDAT2IwS Gw9g== X-Gm-Message-State: AOJu0Ywb3NoypXoA1PSl8oNoIH+pIeuLdDih62dLXCpAUkisw20EEbww qT2+EJu/xe1RMSfGxeD4yvDL91CQW7fy/O1khCLodO7E/UiWRz75VjgWr3PedA== X-Gm-Gg: ASbGncsi1seN8Uo4r5x55kb22bd+5MTRJcWSIza7HPLJbAMWkx4rL/Z/uzRSk9gfZpS 3svOpAkKfr/8KEc1geD3CcKONICZPozs/Codlb3L/CE4hz5PlKDdVhWXpHtvoCFhvgeMDdlALca M7sokeZbqnozCVj+O2eHQ1Y1FRgVtnxsWm9lmknZYsr1fGCDHWQtMGYP/U5dnsnVabxicLn1Al0 ju5/B82gE/QRue4XzF8r5+R5C0rXmCYEwfHmRIxEj60Y+j7IW16TrPBm0/t3P4BNSCULtBikmJ7 BDlxbJl7BzNDl0l1gLuCSE03zIRz4KtLAveC/+z6RNOiCR2PgXG8UmtWJQQkk4Y2xPUQ3FJY3eG 00GWBwi0VC3EXQtVEmC4= X-Google-Smtp-Source: AGHT+IGcKCk0FzcZCUGdaCvtNnUn4szNdh0sJmGt61a5iQU4gsqTD+XtD1bTfqKNdMBd715gGmJumg== X-Received: by 2002:a05:600c:1910:b0:43d:fa59:a685 with SMTP id 5b1f17b1804b1-453248fb58amr4852275e9.33.1749589772102; Tue, 10 Jun 2025 14:09:32 -0700 (PDT) Received: from lightning.caipicrew.dd-dns.de ([2001:a61:aa3:d01:75c4:e686:37fd:e458]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53244f07dsm13460731f8f.79.2025.06.10.14.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jun 2025 14:09:31 -0700 (PDT) Message-ID: <68489f0b.050a0220.21ce72.f4b3@mx.google.com> X-Google-Original-Message-ID: <20250610210931.GE27427@caipicrew.dd-dns.de;lightning.caipicrew.dd-dns.de> Sender: Michael Banck Received: from mbanck by lightning.caipicrew.dd-dns.de with local (Exim 4.92) (envelope-from ) id 1uP6Dr-00027s-Bm; Tue, 10 Jun 2025 23:09:31 +0200 Date: Tue, 10 Jun 2025 23:09:31 +0200 From: Michael Banck To: Michael Paquier Cc: Postgres hackers Subject: Re: Safeguards against incorrect fd flags for fsync() References: <20191009062640.GB21379@paquier.xyz> <68480868.5d0a0220.1e214d.68a6@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <68480868.5d0a0220.1e214d.68a6@mx.google.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, one more thing: On Tue, Jun 10, 2025 at 12:26:48PM +0200, Michael Banck wrote: > The better way might be to mask the flags with O_ACCMODE and then just > check what you want, like in the attached. I forgot to mention it in the patch, but Samuel Thibault reviewed the patch and suggested improvements to the point where he should probably be credited as co-author but at least as reviewer should this be accepted. Michael