From: Trond Myklebust <trondmy@hammerspace.com>
To: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"tao.lyu@epfl.ch" <tao.lyu@epfl.ch>
Subject: Re: Question about O_APPEND | O_DIRECT
Date: Sat, 25 Nov 2023 23:54:48 +0000 [thread overview]
Message-ID: <2d948b43fa625952e50589e4bedf9551df7ee112.camel@hammerspace.com> (raw)
In-Reply-To: <c609e5f9df75438dbfe3810859935d58@epfl.ch>
On Thu, 2023-11-23 at 18:14 +0000, Tao Lyu wrote:
> 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,
> I found it has one function that checks explicitly whether there is a
> combination flag of "O_APPEND | O_DIRECT".
> If so, it will return invalid arguments.
>
> int nfs_check_flags(int flags)
> {
> if ((flags & (O_APPEND | O_DIRECT)) == (O_APPEND | O_DIRECT))
> return -EINVAL;
>
> 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.
Why do you need O_APPEND|O_DIRECT?
In order to implement O_APPEND|O_DIRECT, we would need to add an APPEND
operation, which does not exist in the NFS protocol. The WRITE
operation does not suffice, because it requires you to know the offset
at which you will be writing the data.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
next prev parent reply other threads:[~2023-11-25 23:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-23 18:14 Question about O_APPEND | O_DIRECT Tao Lyu
2023-11-25 23:54 ` Trond Myklebust [this message]
2023-11-27 15:28 ` Tao Lyu
2023-11-27 16:36 ` Christoph Hellwig
2023-11-27 16:41 ` Tao Lyu
2023-11-27 16:50 ` Chuck Lever III
2023-11-27 16:55 ` Christoph Hellwig
2023-11-27 16:59 ` Chuck Lever III
2023-11-28 13:06 ` Christoph Hellwig
2023-11-28 1:50 ` Rick Macklem
2023-11-28 13:09 ` Christoph Hellwig
2023-11-28 18:28 ` Trond Myklebust
2023-11-27 17:08 ` Trond Myklebust
2023-11-27 17:19 ` hch
2023-11-27 17:23 ` Tao Lyu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2d948b43fa625952e50589e4bedf9551df7ee112.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=linux-nfs@vger.kernel.org \
--cc=tao.lyu@epfl.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox