All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: Chuck Lever <cel@kernel.org>
Cc: 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, sashiko-bot <sashiko-bot@kernel.org>
Subject: Re: NFSD: Refuse a direct READ whose aligned range exceeds the reply pages
Date: Wed, 11 Nov 2026 12:07:59 -0500	[thread overview]
Message-ID: <avSg75nnYeR3t60Y@kernel.org> (raw)
In-Reply-To: <20261111152050.172047-1-cel@kernel.org>

On Wed, Nov 11, 2026 at 10:20:50AM -0500, Chuck Lever wrote:
> nfsd_direct_read() expands the READ's byte range to the file's direct
> I/O alignment, then maps reply pages until the range is covered or
> rq_page_end is reached. A block device whose logical block size
> exceeds PAGE_SIZE reports an alignment larger than PAGE_SIZE. With
> 16KB blocks and 4KB pages, a maximum-size READ at an offset that is
> not a multiple of 16KB needs one more page than the svc_rqst has.
> The loop stops at rq_page_end and passes a truncated iterator to the
> filesystem. iomap rejects the unaligned length with -EINVAL, and NFSD
> returns NFSERR_SERVERFAULT for a READ that a buffered read would have
> satisfied.
> 
> Check the aligned range against the reply pages in
> nfsd_direct_read_ok(), and fall back to a buffered read when the
> range does not fit.
> 
> Reported-by: sashiko-bot <sashiko-bot@kernel.org>
> Closes: https://sashiko.dev/#/patchset/20261109-xdr-page-base-v1-0-a4f4411d760d@kernel.org?part=11
> Fixes: d686e64e931c ("NFSD: Implement NFSD_IO_DIRECT for NFS READ")
> Signed-off-by: Chuck Lever <cel@kernel.org>

Reviewed-by: Mike Snitzer <snitzer@kernel.org>

      reply	other threads:[~2026-11-11 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 15:20 [PATCH] NFSD: Refuse a direct READ whose aligned range exceeds the reply pages Chuck Lever
2026-11-11 17:07 ` Mike Snitzer [this message]

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=avSg75nnYeR3t60Y@kernel.org \
    --to=snitzer@kernel.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=sashiko-bot@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.