[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <298117.1626893692@warthog.procyon.org.uk>
Date: Wed, 21 Jul 2021 19:54:52 +0100
From: David Howells <dhowells@...hat.com>
To: Jeff Layton <jlayton@...hat.com>
Cc: dhowells@...hat.com, linux-fsdevel@...r.kernel.org,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Anna Schumaker <anna.schumaker@...app.com>,
Steve French <sfrench@...ba.org>,
Dominique Martinet <asmadeus@...ewreck.org>,
Mike Marshall <hubcap@...ibond.com>,
David Wysochanski <dwysocha@...hat.com>,
Shyam Prasad N <nspmangalore@...il.com>,
Miklos Szeredi <miklos@...redi.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-cachefs@...hat.com, linux-afs@...ts.infradead.org,
linux-nfs@...r.kernel.org, linux-cifs@...r.kernel.org,
ceph-devel@...r.kernel.org, v9fs-developer@...ts.sourceforge.net,
devel@...ts.orangefs.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 03/12] netfs: Remove netfs_read_subrequest::transferred
Jeff Layton <jlayton@...hat.com> wrote:
> The above two deltas seem like they should have been in patch #2.
Yeah. Looks like at least partially so.
> > @@ -635,15 +625,8 @@ void netfs_subreq_terminated(struct netfs_read_subrequest *subreq,
> > goto failed;
> > }
> >
> > - if (WARN(transferred_or_error > subreq->len - subreq->transferred,
> > - "Subreq overread: R%x[%x] %zd > %zu - %zu",
> > - rreq->debug_id, subreq->debug_index,
> > - transferred_or_error, subreq->len, subreq->transferred))
> > - transferred_or_error = subreq->len - subreq->transferred;
> > -
> > subreq->error = 0;
> > - subreq->transferred += transferred_or_error;
> > - if (subreq->transferred < subreq->len)
> > + if (iov_iter_count(&subreq->iter))
> > goto incomplete;
> >
>
> I must be missing it, but where does subreq->iter get advanced to the
> end of the current read? If you're getting rid of subreq->transferred
> then I think that has to happen above, no?
For afs, afs_req_issue_op() points fsreq->iter at the subrequest iterator and
calls afs_fetch_data(). Thereafter, we wend our way to
afs_deliver_fs_fetch_data() or yfs_deliver_fs_fetch_data() which set
call->iter to point to that iterator and then call afs_extract_data() which
passes it to rxrpc_kernel_recv_data(), which eventually passes it to
skb_copy_datagram_iter(), which advances the iterator.
For the cache, the subrequest iterator is passed to the cache backend by
netfs_read_from_cache(). This would be cachefiles_read() which calls
vfs_iocb_iter_read() which I thought advances the iterator (leastways,
filemap_read() keeps going until iov_iter_count() reaches 0 or some other stop
condition occurs and doesn't thereafter call iov_iter_revert()).
David
Powered by blists - more mailing lists