linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: Mike Snitzer <snitzer@kernel.org>
Cc: Jeff Layton <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH v3] NFSD: Implement NFSD_IO_DIRECT for NFS WRITE
Date: Fri, 17 Oct 2025 17:54:00 -0400	[thread overview]
Message-ID: <5bf67a27-8a1c-4771-aeba-625bb20ec45f@kernel.org> (raw)
In-Reply-To: <aPKvGynfz0n84Ldm@kernel.org>

On 10/17/25 5:03 PM, Mike Snitzer wrote:
> On Fri, Oct 17, 2025 at 10:13:14AM -0400, Chuck Lever wrote:
>> On 10/15/25 6:13 PM, Mike Snitzer wrote:

>>> +	*cnt = 0;
>>> +	for (int i = 0; i < n_iters; i++) {
>>> +		if (iter_is_dio_aligned[i])
>>> +			kiocb->ki_flags |= IOCB_DIRECT;
>>> +		else
>>> +			kiocb->ki_flags &= ~IOCB_DIRECT;
>>> +
>>> +		host_err = vfs_iocb_iter_write(file, kiocb, &iter[i]);
>>> +		if (host_err < 0) {
>>> +			/*
>>> +			 * VFS will return -ENOTBLK if DIO WRITE fails to
>>> +			 * invalidate the page cache. Retry using buffered IO.
>>> +			 */
>>
>> I'm debating with myself whether, now that NFSD is using DIO, nfserrno
>> should get a mapping from ENOTBLK to nfserr_serverfault or nfserr_io,
>> simply as a defensive measure.
>>
>> I kind of like the idea that we get a warning in nfserrno: "hey, I
>> didn't expect ENOTBLK here" so I'm leaning towards leaving it as is
>> for now.
> 
> While ENOTBLK isn't expected, it is a real possibility from the MM
> subsystem's inability invalidate the page cache ("for reasons").
> 
> So it isn't that NFSD would've done anything wrong.. it just needs to
> deal with the possibility (as should any other DIO write in kernel).
Well my point is that if the MM/VFS can return this on a buffered write,
should NFSD be prepared to deal with it in other places besides this
path? I think it's handling ENOTBLK correctly here. Just wondering about
elsewhere.

This is something we can set aside and worry about after merge. It
actually has more to do with the existing parts of NFSD, not the new
direct write code path.

I'll repost the "stable_how" patch and this one together in a new
series, for Christoph, and pull that series into nfsd-testing.


-- 
Chuck Lever

  reply	other threads:[~2025-10-17 21:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-13 19:01 [PATCH v1] NFSD: Enable return of an updated stable_how to NFS clients Chuck Lever
2025-10-13 19:34 ` Jeff Layton
2025-10-14  5:24 ` NeilBrown
2025-10-15 16:53 ` Mike Snitzer
2025-10-15 18:00   ` Chuck Lever
2025-10-15 18:11     ` Jeff Layton
2025-10-15 18:16       ` Chuck Lever
2025-10-17  6:22       ` NeilBrown
2025-10-17 11:09         ` Jeff Layton
2025-10-17 23:15           ` NeilBrown
2025-10-17 13:43         ` Chuck Lever
2025-10-17 23:19           ` NeilBrown
2025-10-15 18:40     ` Mike Snitzer
2025-10-15 22:13 ` [PATCH v3] NFSD: Implement NFSD_IO_DIRECT for NFS WRITE Mike Snitzer
2025-10-16 16:10   ` Jeff Layton
2025-10-17 14:13   ` Chuck Lever
2025-10-17 21:03     ` Mike Snitzer
2025-10-17 21:54       ` Chuck Lever [this message]
2025-10-17 22:49         ` Mike Snitzer
2025-10-17 23:23     ` NeilBrown
2025-10-17  4:08 ` [PATCH v1] NFSD: Enable return of an updated stable_how to NFS clients Christoph Hellwig
2025-10-17 13:27   ` Chuck Lever
2025-10-20  6:59     ` Christoph Hellwig

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=5bf67a27-8a1c-4771-aeba-625bb20ec45f@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --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).