From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=epfl.ch header.i=@epfl.ch header.b="doe7THtQ" X-Greylist: delayed 398 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 23 Nov 2023 10:21:36 PST Received: from smtp0.epfl.ch (smtp0.epfl.ch [IPv6:2001:620:618:1e0:1:80b2:e058:1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B596F9 for ; Thu, 23 Nov 2023 10:21:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=epfl.ch; s=epfl; t=1700763294; h=From:To:Subject:Date:Message-ID:Content-Type:Content-Transfer-Encoding:MIME-Version; bh=LKE7a7WUe5YoK/V5zT/ELU27eBfC14QgGED0o0vh5iw=; b=doe7THtQIUJ7bgQ3mfiQjwseRN+hFiIRY0w8W865v4rN1UDVoBNYUWufhYojR/jTn SXZlHy+Srh6NtvYyI7PJP5LjOLl64mgf7sWWMclIFVPbaEisbRKIWV98V4PEeOGq5 5C8uQ+zJ3nAf/ilhKEkDBhXkXVfP4GOCsxdwPX9e8= Received: (qmail 2029 invoked by uid 107); 23 Nov 2023 18:14:54 -0000 Received: from ax-snat-224-177.epfl.ch (HELO ewa06.intranet.epfl.ch) (192.168.224.177) (TLS, ECDHE-RSA-AES256-GCM-SHA384 (P-256 curve) cipher) by mail.epfl.ch (AngelmatoPhylax SMTP proxy) with ESMTPS; Thu, 23 Nov 2023 19:14:54 +0100 X-EPFL-Auth: rOfTDiA50tYiPU4849FIMcDLqLac6pRoBE0IZhcfKia8Nd0e6T0= Received: from ewa07.intranet.epfl.ch (128.178.224.178) by ewa06.intranet.epfl.ch (128.178.224.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Thu, 23 Nov 2023 19:14:51 +0100 Received: from ewa07.intranet.epfl.ch ([fe80::f470:9b62:7382:7f3a]) by ewa07.intranet.epfl.ch ([fe80::f470:9b62:7382:7f3a%4]) with mapi id 15.01.2507.034; Thu, 23 Nov 2023 19:14:51 +0100 From: Tao Lyu To: "linux-nfs@vger.kernel.org" Subject: Question about O_APPEND | O_DIRECT Thread-Topic: Question about O_APPEND | O_DIRECT Thread-Index: AQHaHjflhODFfyeMXUSkxSGiPt/2HA== Date: Thu, 23 Nov 2023 18:14:51 +0000 Message-ID: Accept-Language: en-US, fr-CH Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi, Sorry to bother you here. I'm using NFS and realize it doesn't support opening a file with "O_DIRECT = | O_APPEND". After checking the source code,=20 I found it has one function that checks explicitly whether there is a combi= nation flag of "O_APPEND | O_DIRECT". If so, it will return invalid arguments. int nfs_check_flags(int flags) { =A0=A0=A0 if ((flags & (O_APPEND | O_DIRECT)) =3D=3D (O_APPEND | O_DIRECT)) =A0=A0=A0=A0=A0=A0=A0 return -EINVAL; =A0=A0=A0 return 0; } But I don't understand why NFS doesn't support this flag combination. I'd appreciate it if someone could explain this to me. Thanks in advance. Best, Tao