From: Christoph Hellwig <hch@infradead.org>
To: Chuck Lever <cel@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Mike Snitzer <snitzer@kernel.org>, NeilBrown <neil@brown.name>,
Jeff Layton <jlayton@kernel.org>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH v4 2/3] NFSD: Implement NFSD_IO_DIRECT for NFS WRITE
Date: Wed, 22 Oct 2025 22:52:04 -0700 [thread overview]
Message-ID: <aPnChLocfNsu_UN7@infradead.org> (raw)
In-Reply-To: <3728820c-d0a5-46d7-b886-3343606cb776@kernel.org>
On Wed, Oct 22, 2025 at 01:59:04PM -0400, Chuck Lever wrote:
> On 10/20/25 3:19 AM, Christoph Hellwig wrote:
> >> + /*
> >> + * Any buffered IO issued here will be misaligned, use
> >> + * sync IO to ensure it has completed before returning.
> >> + * Also update @stable_how to avoid need for COMMIT.
> >> + */
> >> + kiocb->ki_flags |= (IOCB_DSYNC | IOCB_SYNC);
> > What do you mean with completed before returning? I guess you
> > mean writeback actually happening, right? Why do you need that,
> > why do you also force it for the direct I/O?
>
> This is the only comment where I'm not clear on what corrective
> action to take.
I have multiple issues with the comment. One is that it really should
talk about commiting data to stable storage instead of completing,
as that seems to be the main point (and also what IOCB_DSYNC /
IOCB_SYNC) does. If we stick to using IOCB_SYNC it should also
mention metadata or more specifically timestamps.
But I also really don't get the "Any buffered IO issued here will
be misaligned, ..." part. What does buffered I/O and/or misalignment
have to do with not wanting to do a COMMIT?
> I think IOCB_SYNC would be needed with O_DIRECT to force timestamp
> updates. Otherwise, IOCB_SYNC is relevant only when the function is
> forced to fall back to some form of write through the page cache.
Well, IOCB_SYNC is only needed to commit timestamps. O_DSYNC is
always required if you want to commit to stable storage. As said
above I don't really understand from the patch why we want to do
that, but IFF we want to do that, we need IOCB_DSYNC bother for
direct and buffered I/O.
next prev parent reply other threads:[~2025-10-23 5:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-18 0:54 [PATCH v4 0/3] NFSD: Implement NFSD_IO_DIRECT for NFS WRITE Chuck Lever
2025-10-18 0:54 ` [PATCH v4 1/3] NFSD: Enable return of an updated stable_how to NFS clients Chuck Lever
2025-10-20 7:02 ` Christoph Hellwig
2025-10-18 0:54 ` [PATCH v4 2/3] NFSD: Implement NFSD_IO_DIRECT for NFS WRITE Chuck Lever
2025-10-20 7:19 ` Christoph Hellwig
2025-10-20 13:56 ` Chuck Lever
2025-10-20 14:05 ` Christoph Hellwig
2025-10-20 16:27 ` Mike Snitzer
2025-10-22 5:14 ` Christoph Hellwig
2025-10-22 14:37 ` Chuck Lever
2025-10-23 5:46 ` Christoph Hellwig
2025-10-21 11:24 ` Jeff Layton
2025-10-22 5:16 ` Christoph Hellwig
2025-10-22 10:15 ` Jeff Layton
2025-10-22 11:17 ` Christoph Hellwig
2025-10-22 11:30 ` Jeff Layton
2025-10-22 13:31 ` Chuck Lever
2025-10-23 5:27 ` Christoph Hellwig
2025-10-22 17:59 ` Chuck Lever
2025-10-23 5:52 ` Christoph Hellwig [this message]
2025-10-18 0:54 ` [PATCH v4 3/3] svcrdma: Mark Read chunks Chuck Lever
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=aPnChLocfNsu_UN7@infradead.org \
--to=hch@infradead.org \
--cc=cel@kernel.org \
--cc=dai.ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=snitzer@kernel.org \
--cc=tom@talpey.com \
/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;
as well as URLs for NNTP newsgroup(s).