From: Jeff Layton <jlayton@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: ceph-devel@vger.kernel.org, idryomov@gmail.com,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v3 2/3] ceph: Make ceph_netfs_issue_op() handle inlined data
Date: Fri, 21 Jan 2022 10:18:56 -0500 [thread overview]
Message-ID: <aa6ecc69eeb4c1e25c11f37f86a7796e7c40997b.camel@kernel.org> (raw)
In-Reply-To: <1130437.1642777077@warthog.procyon.org.uk>
On Fri, 2022-01-21 at 14:57 +0000, David Howells wrote:
> Jeff Layton <jlayton@kernel.org> wrote:
>
> > + len = iinfo->inline_len;
> > + iov_iter_xarray(&iter, READ, &rreq->mapping->i_pages, subreq->start, len);
> > + err = copy_to_iter(iinfo->inline_data, len, &iter);
>
> I think this is probably wrong. It will read the entirety of the inline data
> into the buffer, even if it's bigger than the buffer and you need to offset
> pointer into the buffer.
>
> You need to limit it to subreq->len. Maybe:
>
> len = min_t(size_t, iinfo->inline_len - subreq->start, subreq->len);
> iov_iter_xarray(&iter, READ, &rreq->mapping->i_pages,
> subreq->start, len);
> err = copy_to_iter(iinfo->inline_data + subreq->start, len, &iter);
>
> David
>
Good point. I'll make that change and re-test, but it makes sense.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2022-01-21 15:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-21 14:18 [PATCH v3 0/3] ceph: uninline data on open instead of write Jeff Layton
2022-01-21 14:18 ` [PATCH v3 1/3] ceph: switch netfs read ops to use rreq->inode instead of rreq->mapping->host Jeff Layton
2022-01-21 14:18 ` [PATCH v3 2/3] ceph: Make ceph_netfs_issue_op() handle inlined data Jeff Layton
2022-01-21 14:57 ` David Howells
2022-01-21 15:18 ` Jeff Layton [this message]
2022-01-21 14:18 ` [PATCH v3 3/3] ceph: Uninline the data on a file opened for writing Jeff Layton
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=aa6ecc69eeb4c1e25c11f37f86a7796e7c40997b.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=idryomov@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
/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