Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp527842rdh; Thu, 23 Nov 2023 10:21:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoVgH62CFnOp9FoAcf3HncuSVFKUoFMG6nmlsNEnJ/xFJubTUTqO4vtVrJhes1lR4vjQGY X-Received: by 2002:a5e:dc02:0:b0:798:2415:1189 with SMTP id b2-20020a5edc02000000b0079824151189mr470329iok.12.1700763703407; Thu, 23 Nov 2023 10:21:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700763703; cv=none; d=google.com; s=arc-20160816; b=b4EzZd8jowUNpW+Q4YU023ZGM2IH3DRctJimwQJQlzSmUS9fvJPl8ZG0cd0awuLqT0 8mYTdBAUytKYvRN6wr8ZS0f/xqaItX95dwfLc/GwbeljB8pQXYY+GR4r0WUL7OJJ29Iy YcV560rfyCtFh4XlxwxXlbPLoTIYPHfT1Bt+lxXJRyMQipRgaNtOe3hF2aUJ0LtGxKy8 RdZpalrP6DARaVCFpEQ2lqq1sRzWlTHQ5/ZElqKl8jptYXSaQYK9Zs0vaXlpSp+2z4VS 6tr7ZqNpFQv4pDuZJlgQCr6ssC52xOU6IO9H7EomLIMofCIWd302lNn9mrkIZhXXie+J yVjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :message-id:date:thread-index:thread-topic:subject:to:from :dkim-signature; bh=LKE7a7WUe5YoK/V5zT/ELU27eBfC14QgGED0o0vh5iw=; fh=2JZbA8KkqpmcyWkL5kr0WH6bxLMBXIomqvvZBxo8I8o=; b=aAz3ywoNutCkhZ3wLG0iTuUF3lJLhaTTPQZJsQziAPhKSUilXqRMA6o/i6LKsmQ7dF C/OGDhJj9L/6zCETeF2HREgTANOWjUqPxK7FdRpDgStSdZoGRrg7/IRKSJtQ4cj3B/Mh iD9qXQKjpPXhDZqdGqIL2K4sOFdVQDod9DP2gcCpvKZazfl01sC9hGOFmwGAwLnC7dru zEhoGHlrwNfMKPw7oMmZGsgsLja3QFnOwkWC92GSrHKvT3cu3mKdTivfv40BgLf/l8tB BcFNdrH3oQ72xmgfP0rjByBAnbiw+Fmp1Lg2UHXdza0SvaEt0Q+yoIsNvLw7AeeRpIrX dHcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@epfl.ch header.s=epfl header.b=doe7THtQ; spf=pass (google.com: domain of linux-nfs+bounces-39-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-39-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=epfl.ch Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bi6-20020a056a02024600b005c2203bfc01si1949285pgb.170.2023.11.23.10.21.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 10:21:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-39-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@epfl.ch header.s=epfl header.b=doe7THtQ; spf=pass (google.com: domain of linux-nfs+bounces-39-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-39-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=epfl.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DEEBD281B10 for ; Thu, 23 Nov 2023 18:21:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F4F54B5C8; Thu, 23 Nov 2023 18:21:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=epfl.ch header.i=@epfl.ch header.b="doe7THtQ" X-Original-To: linux-nfs@vger.kernel.org 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