From: Chuck Lever <cel@kernel.org>
To: Mike Snitzer <snitzer@kernel.org>
Cc: neil@brown.name, jlayton@kernel.org, okorniev@redhat.com,
dai.ngo@oracle.com, tom@talpey.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH v2 4/4] NFSD: Implement NFSD_IO_DIRECT for NFS READ
Date: Thu, 18 Sep 2025 11:27:37 -0700 [thread overview]
Message-ID: <1f530bb2-3813-4f8f-a326-d6ae6dc2466a@kernel.org> (raw)
In-Reply-To: <aMwzU50fiZSN00JP@kernel.org>
On 9/18/25 9:29 AM, Mike Snitzer wrote:
>> + /* Read a properly-aligned region of bytes into rq_bvec */
>> + dio_start = round_down(offset, nf->nf_dio_read_offset_align);
>> + dio_end = round_up(offset + *count, nf->nf_dio_read_offset_align);
>> +
>> + kiocb.ki_pos = dio_start;
>> +
>> + v = 0;
>> + total = *count;
> Hi Chuck,
>
> Looks like you introduced a copy-n-paste bug when updating
> nfsd_direct_read's while loop to follow nfsd_iter_read's lead.
>
> Should be:
> total = dio_end - dio_start;
>
> [NOTE: this was the reason I saw a crash with my incremental patch
> that handled 'base', see:
> https://lore.kernel.org/linux-nfs/aMwcUdWdey69k2iK@kernel.org/
> ]
Indeed. Fixed in my tree, I will push it in a moment.
I'm traveling this week, so I don't have an opportunity to do more
than compile-test these before posting/pushing.
--
Chuck Lever
prev parent reply other threads:[~2025-09-18 18:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 14:31 [PATCH v2 0/4] NFSD direct I/O read Chuck Lever
2025-09-17 14:31 ` [PATCH v2 1/4] NFSD: Add array bounds-checking in nfsd_iter_read() Chuck Lever
2025-09-17 17:51 ` Mike Snitzer
2025-09-17 14:31 ` [PATCH v2 2/4] NFSD: filecache: add STATX_DIOALIGN and STATX_DIO_READ_ALIGN support Chuck Lever
2025-09-17 14:31 ` [PATCH v2 3/4] NFSD: pass nfsd_file to nfsd_iter_read() Chuck Lever
2025-09-17 14:32 ` [PATCH v2 4/4] NFSD: Implement NFSD_IO_DIRECT for NFS READ Chuck Lever
2025-09-17 23:29 ` NeilBrown
2025-09-18 14:50 ` Mike Snitzer
2025-09-18 15:20 ` Mike Snitzer
2025-09-18 18:42 ` Chuck Lever
2025-09-18 19:01 ` Mike Snitzer
2025-09-18 16:29 ` Mike Snitzer
2025-09-18 18:27 ` Chuck Lever [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=1f530bb2-3813-4f8f-a326-d6ae6dc2466a@kernel.org \
--to=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